Channel
Interviewed Person
Daniel Roe
Daniel Roe is the Head of the Nuxt Framework. He is a developer architect who strongly believes in the power of combining a clear brand, beautiful design, and leading technology to engage users and drive business growth. You can find him on many developer-focused platforms assisting Vue.js and Nuxt developers to scale up their skills and build better web! Daniel will guide you through Exercise 2. In this exercise, Daniel will hook up the chat widget to Open AIβs Chat API (GPT 3.5 Turbo) and work on nice AI-generated responses to the userβs messages. Tune in! Preparation Guide: https://www.notion.so/vueschool/Preparation-Guide-826772c7e42f4c648d230364a0c64e3f Walkthrough of the Boilerplate: https://www.notion.so/vueschool/Exercise-0-Walkthrough-of-the-Boilerplate-Daniel-Kelly-be59db322a2c4333af60e89ab4702b00 Exercise 1: https://www.notion.so/vueschool/Exercise-1-Create-a-Functional-Chat-Widget-UI-Eduardo-San-Martin-Morote-3f6ba968c36b4dd491add0798e3ebb46 Exercise 2: https://www.notion.so/vueschool/Exercise-2-Code-a-Vue-Powered-ChatGPT-Daniel-Roe-d4c0b1b81d7745a1a5de3409011ebdab π Visit Vue School - https://vueschool.io/ π Master Nuxt 3 with the only Official Nuxt 3 Course https://masteringnuxt.com/nuxt3 π Master Pinia with the Author of Pinia, Eduardo San Martin Morote https://masteringpinia.com/ π Get Vue.js Certified with the Official Vue.js Certification Program https://certificates.dev/vuejs π₯ Get the Ultimate Vue Bundle https://vuebundle.com/ π Join the Largest Online Vue.js Conference for FREE https://vuejsnation.com/ π© Contact us at team@vueschool.io
Vue School
Interviewed: Daniel Roe
[Music] [Applause] thank you Jen I don't think I've ever had such a warm introduction thank you so much that's really really lovely and actually I think we might have somebody to to come and say hello just as I just as I said bye lady whether or not
reaction to start this we will find out it's a pleasure to be with you today um and we are going to be coding uh the server part of this uh chatbot I've been loving following on um thank you everybody for um all the the great work prepping things and so I'm I'm here ready to go so I'll start the next uh Dev server um I've checked out um a local branch which is um
see two dash start if you want to follow along we've got our uh um remote code Dev server running let's open it in the browser and hopefully what we are going to have is a social media post generation now our main focus here is going to be not on the UI but on the back end um and in particular we're interested in turning this customer support chat from just a beautiful box to one that actually works and does some very very cool things
um so the first thing is that we are going to create this API route now when you start dealing with the next server you're going to want to have a folder called server in your project and this API route is located in there and it's an API route and it's called Ai and that's what we want that's how we want to access it forward slash API forward slash Ai and in particular in the notes
I noticed that we we want to restrict this to just post requests and out of the box Max offers a really easy way to do that and which is to add a DOT post you could put any method in there dot get dot options Dot patch whatever you want um so we'll just create that file now this file is going to to return a response to any request to that API and
AI endpoint and so if we create just a basic um micro endpoint here and if we were to return some content then what we should see is if we hit that uh endpoint we should get I need to save the response I should say this is going to be absolutely very much live coding here uh let's see I should be able to hit that
response why am I getting a response so and hit yeah oh that won't hit anything with it because we need a post request just about possible that in setting us up yeah okay there we go right
um and so question for you can you zoom in a smidge because we're having a hard time seeing it absolutely okay this good enough yeah I would oh that one's even better if you can manage that one if you manage it that one's probably the best thank you okay um we are going to quickly open up the uh the open API docs and it's always always the best way to to check