Build A Chatbot With The ChatGPT API In React (gpt-3.5-turbo Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ค. 2024
  • 🎓 Join my learning platform for module based courses, learning exercises, and more: coderprep.com/
    In this video we use the new OpenAI gpt-3.5-turbo model to create a ChatGPT application in React. This is one of the fastest GPT models to be released. This video is great for beginners to both React and ChatGPT, and is a great portfolio project. We create a chatbot that allows you to communicate directly with the ChatGPT API, which is a project that can be applied to a vast array of React projects! This project gives you a great understanding of the ChatGPT API, even if you don’t plan to replicate the project created in the video yourself.
    Final Project Code: github.com/coopercodes/ReactC...
    0:00 Intro
    0:50 Create chat UI / Manage messages state
    7:52 Set up ChatGPT API
    9:19 Process message with ChatGPT API
    17:40 Show ChatGPT response to user
    19:58 Changing system message prompt
    21:15 Thanks for watching!
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 173

  • @mathbydoing
    @mathbydoing ปีที่แล้ว

    Thanks so much! It works great, and following your video did not take much time . Presentation-wise it is a masterpiece. Using this as a template, I will repeatedly refer to your channel.

  • @yinanli2542
    @yinanli2542 หลายเดือนก่อน

    Thank you so much, your presentation is excellent!!!

  • @lukecoburn
    @lukecoburn 3 หลายเดือนก่อน

    Amazing! Thank you so much!

  • @MisterOcean5
    @MisterOcean5 ปีที่แล้ว

    Thx for this great tutorial!

  • @shakthi1811
    @shakthi1811 ปีที่แล้ว

    thank you so much! helped me a lot

  • @gokhanburhan382
    @gokhanburhan382 ปีที่แล้ว

    This tutorial is for who thinks on a new Idea with openAI API good work bro

  • @harsh9558
    @harsh9558 ปีที่แล้ว

    Awesome video!!!
    Thank u very much!!!

  • @deoarlo
    @deoarlo ปีที่แล้ว

    Amazing tutorial. And I love that you're using Vite

  • @tahamouhoud5630
    @tahamouhoud5630 9 หลายเดือนก่อน

    Thanks this was very helpful

  • @jamezjaz
    @jamezjaz ปีที่แล้ว

    Nice content here!
    Thanks for sharing

  • @KyanCox
    @KyanCox 12 วันที่ผ่านมา

    this is a really, really good video

  • @oryxchannel
    @oryxchannel ปีที่แล้ว

    Rich in tutorial content. Thank you.

  • @minhduc8a21
    @minhduc8a21 ปีที่แล้ว

    Thank you so much!

  • @CSFGIRIBAABUKG
    @CSFGIRIBAABUKG ปีที่แล้ว

    you are great man!!!

  • @srg9413
    @srg9413 22 วันที่ผ่านมา

    Thank you

  • @amanmalik781
    @amanmalik781 5 หลายเดือนก่อน

    Thank you!

  • @momobb2485
    @momobb2485 11 หลายเดือนก่อน

    nice and clean

  • @yasin_bhojani
    @yasin_bhojani ปีที่แล้ว

    Great Video ❤

  • @crypto4elik
    @crypto4elik 11 หลายเดือนก่อน

    amazing i did it!)

  • @anistagoug2957
    @anistagoug2957 ปีที่แล้ว

    Thank you very much

  • @Explorewithargho
    @Explorewithargho 13 วันที่ผ่านมา

    You are just a fabulous person, sharing great informations.

    • @user-cn5md1ri5w
      @user-cn5md1ri5w 8 วันที่ผ่านมา

      is this api need to be paid ?

    • @Explorewithargho
      @Explorewithargho 8 วันที่ผ่านมา

      @@user-cn5md1ri5w few hit tokens are free. But major are charging

  • @angelgutierrez8303
    @angelgutierrez8303 ปีที่แล้ว +3

    It was really helpful. Thank you very much! Just one think. The code as it is allowed me to send only one message. I had to modify a line as below.
    [before]
    [after]
    handleSend(message)} />
    The credit is to ChatGPT who found the issue and suggested the new line. As a person with 0 experience in react or even JavaScript, this was daunting to me. I see now that it is still very important to know your stuff, otherwise even with AGI, you will not be able to ask the right questions.

  • @paulthepink
    @paulthepink ปีที่แล้ว

    I will make a best friend for myself now thank you!

  • @vyomraval3722
    @vyomraval3722 3 หลายเดือนก่อน

    Excellent! Totally workable

    • @uparagnath5409
      @uparagnath5409 3 หลายเดือนก่อน

      Is it working

    • @vyomraval3722
      @vyomraval3722 2 หลายเดือนก่อน

      @@uparagnath5409yes of course!

  • @bhriscannan2080
    @bhriscannan2080 ปีที่แล้ว

    This is AWESOME! Thanks Cooper!
    Do you know how to get the "best_of" parameter working?

  • @rahulrudra5651
    @rahulrudra5651 ปีที่แล้ว

    Awesome tutorial. Try to explain about all the stuffs a little bit deeper . But love it

  • @Victor-wh9bs
    @Victor-wh9bs ปีที่แล้ว

    Great 🔥

  • @veronicag8479
    @veronicag8479 ปีที่แล้ว +18

    A friendly reminder for folks who are trying this out - at 12:46, code Line 52, remember to add a space after your word "Bearer ". Otherwise the API calls will fail for not being able to find the API key.

    • @DEBO5
      @DEBO5 11 หลายเดือนก่อน

      yea that's why I hate the old "" + notation, just use a string template literal

    • @rajkumarp9943
      @rajkumarp9943 11 หลายเดือนก่อน

      Brother I'm getting error in this line how to solve

    • @kanizfatema755
      @kanizfatema755 10 หลายเดือนก่อน +3

      Hey I am getting this error you execced your current quota please check your plan can anyone help ?? Why I am getting this error??

    • @seanrizarre5904
      @seanrizarre5904 7 หลายเดือนก่อน

      @@kanizfatema755 That means you've either used up your free tokens or your free tokens have expired, the tokens expire after 3 months have passed since you've signed up with that specific account.

    • @Margosha01
      @Margosha01 4 หลายเดือนก่อน

      @@kanizfatema755 did you solved?

  • @richardmcsharry
    @richardmcsharry 2 หลายเดือนก่อน

    @CooperCodes Awesome tutorial, thanks so much. Do you know why we have to send the full array of messages every time to the API?

  • @Epicurious21331
    @Epicurious21331 ปีที่แล้ว +6

    Awesome work. Idea for a part 2: add the hability to speak to the chat with whisper and to have and audible response by the chat.

    • @SaiNaru-wc5vu
      @SaiNaru-wc5vu ปีที่แล้ว +1

      thats a really interesting idea

  • @the_otherly
    @the_otherly ปีที่แล้ว +1

    Two questions. But first, thank you. I look forward to following you. A huge improvement over what I had been using. My questions are two simple formatting issues. First is there a simple code input to have the text fields left-justify instead of center-justify? [Edit: I found justification of text can be accomplished in the accompanying "App.css" file in the first section "#root" under "text-align:". Other UI formatting can be done in the "index.css", such as colors, etc.] And second, the scrolling seems wonky after the chat history fills the chat container... is there a fix for this or are those issues only addressed through the ChatScope UI? Thanks again for your time and sharing your knowledge. Much appreciated!

  • @abeechr
    @abeechr ปีที่แล้ว

    It would be great to see you, build something using the stream API

  • @user-rm2tk2ps1n
    @user-rm2tk2ps1n ปีที่แล้ว

    very useful

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      Glad you found it useful, thanks so much for watching!

  • @AlexEarthshipLeeor
    @AlexEarthshipLeeor ปีที่แล้ว

    thank u! i got it working local on a mac which is amazing. i wonder how do i use it on my webserver.. i ive triied the same process via ssh but i get issues .. clearly i dont do npm run dev .. thanks again!

  • @studyMiku1123
    @studyMiku1123 ปีที่แล้ว

    nice video!

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      thanks! appreciate you taking the time to watch it :)

  • @2002yeunglau
    @2002yeunglau 10 หลายเดือนก่อน

    With this library, can I edit the styling of chatbot for example adding a logo/icon before the chatbox or changing the background colour?

  • @DevShala678
    @DevShala678 ปีที่แล้ว

    Hi
    Firstly thank you so much for bringing this tutorial with reactjs only. just one query though, My response is very slow can help me with that ?

  • @xikaikax
    @xikaikax ปีที่แล้ว

    great, thanks man...any way to make the chat responsive?

  • @laughAFrame
    @laughAFrame ปีที่แล้ว

    Does the app preserve the responses?? Like if I refresh it will it still remember the prev responses?

  • @valentinusrosari
    @valentinusrosari 9 หลายเดือนก่อน

    can i style the component like i would to change the color of MessageInput box?

  • @aniruddhaghosh2722
    @aniruddhaghosh2722 11 หลายเดือนก่อน +1

    Does this code has the ability to continue a conversation, that is, can remember the previous responses and prompts while giving any new response like that of a chat in ChatGPT?

  • @Aliaskar98
    @Aliaskar98 ปีที่แล้ว

    Hi, I can't register on the site (because of the embargo). Is there another way to get the OpenAI secret key? Or can I use the key in the video?

  • @vitn887
    @vitn887 6 หลายเดือนก่อน

    Hello, I've got problem with CORS policy, andy idea how to fix it?

  • @supesart
    @supesart 8 หลายเดือนก่อน

    How could we add Llama index to this project to have a custom knowledge base?

  • @Printalize
    @Printalize 7 หลายเดือนก่อน

    Im having trouble on 6:15. Suddenly he skips something... The [vite] hmr update in the Terminal is not shown in my Terminal. Also, when I do want to open the project in browser it says Edit src/App.jsx and save to test HMR. What should I do? Any help or hint is appreciated!

  • @harryharrison362
    @harryharrison362 ปีที่แล้ว

    Nice Video. I have a proplem somehow...The first response from ChatGPT is always some random stuff. After the second fetch, i get the answer for my previous question...What am i doing wrong?

  • @dhanraj4552
    @dhanraj4552 7 หลายเดือนก่อน

    how we increase the accuracy of an api key get an immediate response?

  • @Printalize
    @Printalize 7 หลายเดือนก่อน

    I have a problem at min 6:00. Once I want to open the chatbot in browser, it is telling me that I should Edit src/App.jsx and save it to test HMR. So what did i do wrong? (btw I fully downloaded the code in first place)

  • @Zoo-Wee-Mama-Sq
    @Zoo-Wee-Mama-Sq 7 หลายเดือนก่อน +1

    The API used in this video is different from the new Assistants API, right? Could you quickly explain how the code would differ using that new API, or is it that more of a topic for another video?

  • @sumreenali5996
    @sumreenali5996 ปีที่แล้ว +1

    also add pinecone and their algorithm example like semantic search video audio search using open ai and pinecone

  • @worldbest3097
    @worldbest3097 หลายเดือนก่อน

    is it possbile to connect supabase? to custom chatgpt messagner

  • @Katana_SJ
    @Katana_SJ 2 หลายเดือนก่อน +1

    i tried to build the app same as your code but there is an error in console: (429) (Too Many Requests)

  • @LedZeppelinThe
    @LedZeppelinThe ปีที่แล้ว

    Can you deploy this using Streamlit?

  • @loudywen
    @loudywen 5 หลายเดือนก่อน

    no bullshit just perfect

  • @noppa2576
    @noppa2576 ปีที่แล้ว

    It is possible to build on python? (i have 0 knowledge with coding language)

  • @AP-hv5dh
    @AP-hv5dh ปีที่แล้ว +1

    Excellent! Thanks for posting. Do you have a code repository? Would like to try to learn from your example, test, fail and test again😂

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +3

      Yup! It is in the description, would just copy here but I’m on mobile 💀

  • @PoojaSinha-ir3rw
    @PoojaSinha-ir3rw ปีที่แล้ว

    This will work on wix website?

  • @tarunrawat4317
    @tarunrawat4317 ปีที่แล้ว

    This codes works on wix javascript velo code?

  • @sebaspqsiddndsacasteesasma2627
    @sebaspqsiddndsacasteesasma2627 ปีที่แล้ว

    Why i can't upload my react work with OpenAI API to Github repository?

  • @khoahocgia7671
    @khoahocgia7671 ปีที่แล้ว

    can you make a video to show us how to turn it into a simple to use android app, we don't always carry the computer with us, while portable devices next to me are very common variable, and especially you should set the maximum number of characters it can handle, and add a minimum response time of 30 seconds to get the most complete response, we look forward to hearing from you. ,

  • @harshithsshetty007
    @harshithsshetty007 3 หลายเดือนก่อน

    not working in my case
    what should i do

  • @Entheos.
    @Entheos. ปีที่แล้ว

    I have a Discord bot running with 'text-davinci-003' and am too noobish to figure out how to properly convert this to a 'GPT-3.5-Turbo' ran bot instead.
    Are there some easy fixes to this, like a simple checklist to go through and be sure everything's good to go?

  • @Wilydesu
    @Wilydesu 9 หลายเดือนก่อน

    Why doesn't typinginput appear when deployed?

  • @RukhsadKhan-et9ix
    @RukhsadKhan-et9ix หลายเดือนก่อน

    Hi, I am getting an error message as "Too Many Requests with status code: 429" and I am getting as reposne "Error communicating with OpenAI API" Can anyone help me with this?

  • @rossibytes
    @rossibytes ปีที่แล้ว

    This is awesome. I downloaded and ran your code. Just curious on one thing... why does it seem so slow to complete the responses? I'm seeing just under 10 seconds per response.

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      That unfortunately has to do with the speed in which the ChatGPT API can process requests. I think a BUNCH of people are using the API right now and so they are having to scale up their services to meet the demand. Hopefully in the future we can count on faster responses from the API, but hopefully this clears things up.

  • @abhishekgawande222
    @abhishekgawande222 ปีที่แล้ว

    It doesn't respond to entered questions what should I do

  • @mokhlestarmiz743
    @mokhlestarmiz743 3 หลายเดือนก่อน

    hello guys is the api free for all or i must buy one ?

  • @gerardoricor
    @gerardoricor ปีที่แล้ว

    Amazing stuff! How can I style those components?

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      The UI shown in this video was made for example purposes, but its highly applicable to any case as the saving of the messages is the most important part. You can make a custom UI that works similarly (shows messages in a stack like in the video) or you can modify the @chatscope/chat-ui-kit-react library which has documentation here: chatscope.io/storybook/react/?path=/story/documentation-introduction--page . This is a complicated answer but hopefully helps!

  • @DanielSeacrest
    @DanielSeacrest ปีที่แล้ว

    This was a great tutorial! However I do have one question, how can I make it so that my system messages content is derived from a text file?

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +2

      Great question, use one of the solutions provided here stackoverflow.com/questions/55830414/how-to-read-text-file-in-react . Getting text from a local file isn't as intuitive as you could hope in React, but eventually with one of the solutions there you will get a string from your text file. You can then set the content of your system message to the string, like content: textFileContents . Hopefully this helps!

  • @toshikaraikwar1911
    @toshikaraikwar1911 ปีที่แล้ว

    it is not working for me can anyone help,the bot keep saying typing please help

  • @kevinliu4569
    @kevinliu4569 ปีที่แล้ว

    why does my chatbot just freeze on typing

  • @RukhsadKhan-et9ix
    @RukhsadKhan-et9ix หลายเดือนก่อน

    Hi, I am getting an error message as below

  • @rohitrajat9322
    @rohitrajat9322 ปีที่แล้ว

    I am geeting in post method api fetching process?? Any one solve this
    Chatgpt verson issue??

  • @rjakash5208
    @rjakash5208 ปีที่แล้ว +1

    It’s not working in windows 11 can any one explain

  • @waad1503
    @waad1503 2 หลายเดือนก่อน

    i followed step by step but the chatgpt didn't work well with me

  • @CalebRoy
    @CalebRoy ปีที่แล้ว +4

    If I want to train the bot on specific information about my business or website, do I put this information in the SYSTEM role? So that when customers on my app ask the bot it can respond to them with specific information I've provided? And does this system data contribute to token consumption?

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +5

      I actually need to look into the specifics of this, as I believe it does depend on the system prompt. I will release a video discussing the system prompt in specific and how it changes the ChatGPT API soon 👍

    • @alpineswiftai
      @alpineswiftai ปีที่แล้ว

      @@CooperCodes he may want to check into embeddings. Langchain will allow this

    • @darkjedig
      @darkjedig ปีที่แล้ว

      This would be really interesting to know as i was looking to do the same thing.

    • @yousefashraf152
      @yousefashraf152 ปีที่แล้ว

      @@CooperCodes hey cooper have you looked into this problem ??

    • @ayushVerma-jl1sw
      @ayushVerma-jl1sw ปีที่แล้ว

      I am also searching this type of video..I also want to train the bot for specific information..if you found out please reply to this comment...it will be very thankful..😊

  • @marcusmahliaire8379
    @marcusmahliaire8379 ปีที่แล้ว

    It seems to, not only remember the previous prompts, but is resubmitting all of them each time you try a follow up prompt. Does anyone have a solution to this issue? This is an amazing tutorial, thank you so much.

    • @gillesz2636
      @gillesz2636 7 หลายเดือนก่อน

      no, in chatgpt it does the same, every time you make a new prompt it also send the previous

  • @bambi456sauvage3
    @bambi456sauvage3 ปีที่แล้ว +1

    hello I followed the tutorial to the letter unfortunately in my terminal I have error 429
    , how to solve it?

    • @salimaahmed3283
      @salimaahmed3283 5 หลายเดือนก่อน

      I have the same problem, did you solve it .

  • @bunnystrasse
    @bunnystrasse ปีที่แล้ว

    How do I program a personality or a historical character in the CHAT GPT?

    • @tuyrindy6380
      @tuyrindy6380 ปีที่แล้ว

      you would have to put it all in the system role, or find a way to summarize user chat history and put it in there.

  • @jackb9045
    @jackb9045 2 หลายเดือนก่อน

    Has anyone else encountered issues with all messages being aligned to the right side? I've compared my code to Cooper's and it looks almost identical so I'm not sure what the problem is... Many thanks in advance

    • @jackb9045
      @jackb9045 2 หลายเดือนก่อน

      Update: it turns out I needed to specify on all messages the direction, either "incoming" or "outgoing" fixed the issue.

  • @user-dm7kg9gf1m
    @user-dm7kg9gf1m ปีที่แล้ว +1

    Whenever I type anything to it, it just says chat-gpt is typing and doesn't provide a response. Do you know why?

    • @kanizfatema755
      @kanizfatema755 10 หลายเดือนก่อน

      Same error....did you solve it??

  • @verrr23
    @verrr23 ปีที่แล้ว +2

    Why my code show error like
    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at App.jsx:79:23
    at async processMessageToChatGPT (App.jsx:66:5)
    at async handleSend (App.jsx:36:5)
    Are you know how to solved it?

    • @daftgin
      @daftgin 6 หลายเดือนก่อน

      Have you solved this?

    • @verrr23
      @verrr23 6 หลายเดือนก่อน

      @@daftgin yes. The problem is from the trial was over. So you must subscribe it, and will be work.
      Notes: you cant use with make a new account just to get a free trial again if u used a same telp number

    • @daftgin
      @daftgin 6 หลายเดือนก่อน

      @@verrr23 I was able to fix it but my situation is different, I just had a typo in my code

  • @DocumentaryPilot
    @DocumentaryPilot ปีที่แล้ว

    when I ask for code, i cant see the code, is there a way to implement a code block in the response?

  • @kanizfatema755
    @kanizfatema755 10 หลายเดือนก่อน +1

    Hey I am getting this error you execced your current quota please check your plan can anyone help ?? Why I am getting this error??

    • @ddiilaaraa
      @ddiilaaraa 8 หลายเดือนก่อน

      Hi, this is because openAI has limited a free access to APIs to around 2-3 months. You can use the key from the newly created account.

  • @user-cn5md1ri5w
    @user-cn5md1ri5w 8 วันที่ผ่านมา

    is this api need to be paid ?

  • @elliscaicedo9045
    @elliscaicedo9045 ปีที่แล้ว

    this APP DONT WORK ERROR TYPING [0]

  • @youtubepremium-iw4qg
    @youtubepremium-iw4qg ปีที่แล้ว

    I'm getting this error - You exceeded your current quota, please check your plan and billing details.
    Any solution?

    • @miguelangelperezsantiago783
      @miguelangelperezsantiago783 ปีที่แล้ว

      i have this same error too,
      Some help please.

    • @creadoc
      @creadoc ปีที่แล้ว

      same

    • @user-zy1if1zh5k
      @user-zy1if1zh5k ปีที่แล้ว

      x2

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      You need to start paying for OpenAI credits (you ran out), and then double check you are using the API key for the account you paid for.

  • @bellaarorathelabradorretre9031
    @bellaarorathelabradorretre9031 ปีที่แล้ว +1

    @CooperCodes I ran the app in my local system with this command (npm run dev), but it is stuck and keeps saying that chatgpt is typing. Am I missing anything?

    • @salimaahmed3283
      @salimaahmed3283 5 หลายเดือนก่อน

      I have the same problem, did you solve it .

  • @yorius96
    @yorius96 ปีที่แล้ว

    I don't understand, I thought we had to pay to use this API. How are we using it?

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +1

      You get $18 worth of tokens for free whenever you create a new account, and $18 goes a really long way for this API when it comes to testing and even small production environments. All the calls from this video cost around 1 cents I believe, so you get enough tokens to test it out / see if it works for your use case. Hopefully that helps :)

    • @yorius96
      @yorius96 ปีที่แล้ว +1

      @@CooperCodes Thank you for responding. Your code is very useful. I am currently creating a virtual assistant for my company. I am trying to make the code recognize when it is asked for specific information so that it does not make it up. We have that type of information in a data spreadsheet, and my plan is to tell the API something like: "Answer this question, but use the information from this spreadsheet for your response" (Obviously, only when the code finds that it is being asked for specific data from the spreadsheet. This way, we avoid the problem of it providing false information about specific topics it doesn't know). I learned a lot from your video and your repository. You have earned another subscriber. Greetings from Chile :)

  • @emmyyassin1587
    @emmyyassin1587 ปีที่แล้ว +1

    I'm getting this error - You exceeded your current quota, please check your plan and billing details. Although I have 18$ credit that I haven't used at all

    • @pranav5532
      @pranav5532 ปีที่แล้ว

      yes same error im getting, whole project wasted

    • @emmyyassin1587
      @emmyyassin1587 ปีที่แล้ว +1

      @@pranav5532 it kinda worked... Try to change the model to gpt-3.5-turbo and hopefully this will work with you too.

    • @simtangaranvijay273
      @simtangaranvijay273 ปีที่แล้ว

      @@emmyyassin1587 Am getting the same error too , any solutions ? am using 3.5 turbo only

    • @kanizfatema755
      @kanizfatema755 10 หลายเดือนก่อน +2

      I am using gpt-3.5-turbo and still getting the same error ?? Can anyone help??

    • @kanizfatema755
      @kanizfatema755 10 หลายเดือนก่อน

      ​@@emmyyassin1587no this doesn't working do you have any other solutions??

  • @samuelpaul5923
    @samuelpaul5923 ปีที่แล้ว

    Why nobody is explaining how to train LLM model with our own custom data in react..

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      Feel free to take a look at my more recent video using Supabase and OpenAI for that.

  • @MuhammadBilal-cq6tp
    @MuhammadBilal-cq6tp 9 หลายเดือนก่อน

    when I call api request it says in response in network tab :
    "You exceeded your current quota, please check your plan and billing details."
    "insufficient_quota"
    PLEASE SEE this and fix this!

    • @MuhammadBilal-cq6tp
      @MuhammadBilal-cq6tp 9 หลายเดือนก่อน

      You can say it requires pricing in tokens , like 1K tokens is 750 words , am i right? i think i should pay first, then it will run , right ???

    • @ddiilaaraa
      @ddiilaaraa 8 หลายเดือนก่อน

      Hi, this is because openAI has limited a free access to APIs to around 2-3 months. You can use the key from the newly created account.

  • @KL13923j
    @KL13923j ปีที่แล้ว

    The tutorial is great , appreciate it.
    However when I tried to build with "npm run build" , it shows error
    Type '{ message: string; sentTime: string; sender: string; }' is missing the following properties from type 'MessageModel': direction, positionts(2739)
    Message.d.ts(58, 5): The expected type comes from property 'model' which is declared here on type 'IntrinsicAttributes & MessageProps & Omit & { ...; }'
    (property) MessageProps.model?: MessageModel | undefined
    How can I fix this?

    • @wesdc
      @wesdc ปีที่แล้ว +2

      Ask ChatGPT

  • @ggez406
    @ggez406 4 หลายเดือนก่อน

    6:28

  • @DaveKumar-
    @DaveKumar- 9 หลายเดือนก่อน

    8:18

  • @luchinazo
    @luchinazo ปีที่แล้ว +1

    I tought it was going to be svelte :(

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +2

      Aye sorry, will do an AI powered application with SvelteKit soon!

    • @luchinazo
      @luchinazo ปีที่แล้ว

      @@CooperCodes Thanks for this tutorial tho!

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      No worries I got you. The API call in here should be applicable to SvelteKit (but managing the messages is gonna be a little different with the svelte stores). Thanks for watching btw!

  • @Becci02
    @Becci02 ปีที่แล้ว

    como modifico todo con tailwind?

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว

      You would have to make custom components, I used an external library to make things easier but it is not required. If you want to do things yourself I recommend following this line of thinking: 1. Create a chat message component , 2. Create a way to get access to all the chat messages (so you can store them in the API call like this video). Hopefully this helps.

  • @AskTheSloth
    @AskTheSloth ปีที่แล้ว

    be aware - you left the api key in your github commit

    • @CooperCodes
      @CooperCodes  ปีที่แล้ว +1

      Yup I disabled it, I like to keep it there so people know what to replace. Thanks for this tho :)

  • @user-wc1mt3yc2k
    @user-wc1mt3yc2k 5 หลายเดือนก่อน +1

    it's not worked for me , this is the error :
    Failed to load resource: the server responded with a status of 429 ()
    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at App.jsx:79:23
    at async processMessageToChatGPT (App.jsx:66:5)
    at async handleSend (App.jsx:36:5)

  • @pranav5532
    @pranav5532 ปีที่แล้ว

    {error: {…}}
    error
    :
    {message: 'You exceeded your current quota, please check your plan and billing details.', type: 'insufficient_quota', param: null, code: null}
    [[Prototype]]
    :
    Object this is the error I'm getting in console.log what should I do to make it work?

    • @simtangaranvijay273
      @simtangaranvijay273 ปีที่แล้ว

      Am getting the same error too , any solutions ?

    • @pranav5532
      @pranav5532 ปีที่แล้ว

      @@simtangaranvijay273 bro i think we have to pay premium for ChatGPT, I left that project :(

    • @daftgin
      @daftgin 6 หลายเดือนก่อน

      @@pranav5532 This is a bit late but if anyone else is struggling with this issue, you have to pay for the tokens for your API key if you want to make your own chatbot.