Build ChatGPT AI Tool in React JS | React JS Project with Working Example using OpenAI API

Поделиться
HTML-код
  • Опубликовано: 13 июн 2024
  • In this Reactjs project, we will make an awesome responsive Chat GPT 2.0 website clone step-by-step by using Open AI API. We learn React hooks, tailwind css, open AI integration, and many more. We will also build a backend using Open AI's latest package! You can build your own chatbot interface and then can integrate it into any web service. At the end, we are going to deploy this app on vercel as a full-stack application so you can share your skills with others.
    The project is surely suitable for beginners.
    Assets 📚
    drive.google.com/uc?export=do...
    Complete Source Code ( support me on ⭐):
    Frontend Repo: github.com/ZainRk/client-chat...
    Backend Repo: github.com/ZainRk/server-chat...
    Patreon: / zainkeepscode
    Buymeacoffee: www.buymeacoffee.com/zainkeep...
    Time Stamps 👇
    00:00:00 Intro
    00:01:04 Requirements/Setup
    00:09:12 Frontend
    00:34:27 Backend
    00:46:19 Integration
    1:17:50 Deployment
    "Copyright Disclaimer under Section 107 of the copyright act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational, or personal use tips the balance in favor of fair use."
    INSTAGRAM :
    / zainkeepscode
    FACEBOOK:
    / zainkeepscode-10757083...
  • НаукаНаука

Комментарии • 132

  • @chvilohith4133
    @chvilohith4133 10 месяцев назад +4

    Guy's website is working exactly and accurately. The error 429 represents openAi error its not the project error while doing this project if you get this error that means open AI have stopped giving free API services to get an free API services login with a new account which was never used and then get free API. Thank you so much for an excellent project and explanation ❤❤

  • @codinghero2001
    @codinghero2001 Год назад +1

    Thank you so much..... Successfully completed as well as Deployed Project first time on vercel.... Thank you from my bottom of Heart !!!!

  • @fatemalokhandwala3477
    @fatemalokhandwala3477 Год назад

    This is really a very interesting project done in such a short time. Appreciate your time and efforts! Thank you :)

  • @MrASH-jw5zx
    @MrASH-jw5zx Год назад

    Your channel is best for skill enhancement

  • @CharlesUkasoanya
    @CharlesUkasoanya Год назад

    Great video. Amazing stuff

  • @virendramali1754
    @virendramali1754 Год назад +2

    Thanks you So much sir for telling each and every code in detail, First time i have successfully deployed my application. All credits goes to you once again Thanks alot ❤
    Plzz make more videos like this ❤😊

  • @rishisingh1034
    @rishisingh1034 4 месяца назад

    learned so much from this project thank you you so much

  • @youhavetodoit9070
    @youhavetodoit9070 Год назад +1

    Thank You So Much For This Amazing Tutorial :)

  • @user-yf9wc8bb7h
    @user-yf9wc8bb7h 10 месяцев назад

    Thank you friend for sharing this amazing project. It will be great in my learning
    a big hug

  • @CapitaineBarbarossa
    @CapitaineBarbarossa Год назад

    First here! Hi from France!

  • @abhishek__anand__
    @abhishek__anand__ Год назад

    Awesome 🤗

  • @techno_talis
    @techno_talis Год назад +5

    second here from Bangladesh

  • @carsonz2256
    @carsonz2256 Год назад +4

    Exactly at- 52:58, I was having an error in my project where it was saying that "useState in not defined". For anyone else experiencing this issue, I fixed it by adding import React, {useState} from 'react' at the top of the App.jsx file and I also added import {useState} from 'react' at the top of the ChatInput.jsx file. This resolved my issue! 🙂

    • @srushtij
      @srushtij Год назад

      in video at 1:04:19 you are getting message in console, but im just getting some kind of unreadable text like thsi "Object { message: "') {
      \t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" }"
      so can you please tell me how can i fix this

  • @malikusman9901
    @malikusman9901 Год назад

    Bro Make more content and be consistent. Literally we have to wait a lot for your video.

  • @cezarylachut4428
    @cezarylachut4428 Год назад

    A very good project I learned a lot of skills, you are a professional programmer ?,

  • @kanavchopra7333
    @kanavchopra7333 Год назад

    Why is there an extra padding-top in some of the AI's answers, but in some there is not ?

  • @aslamiliyas7703
    @aslamiliyas7703 10 месяцев назад

    'Request failed with status code 429' am getting this error why i have change my apiKey 3 times still getting thesame error

  • @FactoryTeam56
    @FactoryTeam56 Год назад

    Thanks! make more content PLZZZ!

  • @s6hib
    @s6hib Год назад

    at 01:03:32, whenever i type to chatgpt it waits 2 seconds and then my screen goes white. I am using firefox, and have followed everything in the video. can anybody help?

  • @shreyanshrajput-km2iq
    @shreyanshrajput-km2iq 10 месяцев назад

    i followed your steps and make chatbot like you but when i ask question it says request failed with status code 429
    please help

  • @amansankhwar8645
    @amansankhwar8645 Год назад

    the message port closed before a response was received. this error occurred in console how to resolve it please help

  • @niazuddinabir1598
    @niazuddinabir1598 Год назад

    Third from Bangladesh

  • @s6hib
    @s6hib Год назад

    how do i solve "Cross-Origin Request Blocked" error at around 1 hour mark

  • @UCSBiprajitSuklabaidya
    @UCSBiprajitSuklabaidya Год назад

    @ZAINKEEPSCODE , my API expiry ended on 1st April, how shall i proceed ?

  • @Deus-lo-Vuilt
    @Deus-lo-Vuilt Год назад

    Thanks for video

  • @prajwalwalde4489
    @prajwalwalde4489 Год назад

    hey Zain can you help me solving the problem of process env?

  • @funnyclipsentertainment
    @funnyclipsentertainment Год назад

    Thank you Sir,please build us a mern video chat app we will really appreciate

  • @prajwalwalde4489
    @prajwalwalde4489 Год назад

    I am getting an error while deployiong server. Client is working fine.

  • @haian_
    @haian_ Год назад

    Please create portfolio with next js 13, tailwind and Sanity io

  • @surfskates1432
    @surfskates1432 Год назад +1

    Hi, Thanks for sharing this great tutorial. I'm getting an error " Request failed with status code 429 " I have correctly added ID and keys in .env. I have credit available? Your help would be greatly appreciated?

    • @surfskates1432
      @surfskates1432 Год назад

      Ok, even though I have never used any free allowance it expired on 1st April. I got it working by paying for API.

    • @shreyanshrajput-km2iq
      @shreyanshrajput-km2iq 10 месяцев назад

      @@surfskates1432 same problem did your problem solved

    • @aslamiliyas7703
      @aslamiliyas7703 10 месяцев назад

      @@surfskates1432 bro where you able to resolve the issue

  • @harshitdubey6596
    @harshitdubey6596 Год назад +1

    Hi
    I tried all the methods and have also tried updating my key in .env file i.e my original API key but still it is giving me the error of Request failed with status code 429
    Please help me with this

    • @divyprajapati4971
      @divyprajapati4971 Год назад

      your open ai account does not have free api access ,create a new different open ai account

    • @GopalSingh-gx5jm
      @GopalSingh-gx5jm 11 месяцев назад

      @@divyprajapati4971 still it is giving me the same error...please help brother.

    • @lokeshart3340
      @lokeshart3340 11 месяцев назад

      Yes bro same error

  • @thebookshelf3036
    @thebookshelf3036 Год назад +2

    it is always in request failed error 401...i cant fetch it properly...tried every possibilities...generated new api and replaced...entered proper org id...still no use...if anyone help me with the solution it will be of great use

    • @GopalSingh-gx5jm
      @GopalSingh-gx5jm 11 месяцев назад

      Hey bro...same problem...
      Can u help me??

    • @GopalSingh-gx5jm
      @GopalSingh-gx5jm 11 месяцев назад

      same problem bro..if u resolved, then please tell me

  • @tomioka1331
    @tomioka1331 Год назад

    Will this work in Uzbekistan?

  • @codewithsaidul
    @codewithsaidul Год назад

    can you solved the ? i'm trying some questions answer from chat gpt, but chat gpt said 401 error

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      Please put your own API key in .evn file and your project will be alright then.
      you can claim you api keys from official Open AI web account.
      if you still face same issue, please check your credit expiry in open Ai dashboard.

  • @animeshsingh7396
    @animeshsingh7396 11 месяцев назад

    i am getting request failed with status 429

  • @AMITKUMAR-rs7tg
    @AMITKUMAR-rs7tg 2 месяца назад

    sir why occur import {configuration,OpenAIApi} from 'openai'
    ^^^^^^^^^
    SyntaxError: The requested module 'openai' does not provide an export named 'OpenAIApi' error

  • @sarthaksharma1382
    @sarthaksharma1382 Год назад +1

    Request failed with status code 401 is coming from AI side. Please help anyone

    • @gauthiersamba6547
      @gauthiersamba6547 Год назад

      I have the same error as you which occurs after the deployment....
      Did you find the solution?
      Disgusted to have finished the tutorial but that the app does not work once deployed...

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      I was also facing the same problem. try this:-
      I think problem is with process.env.API_KEY
      I put api key (in string) directly instead of using process.env.API_KEY
      and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

    • @gauthiersamba6547
      @gauthiersamba6547 Год назад

      @@youhavetodoit9070

  • @danish7335
    @danish7335 Год назад

    I don't know why it showing 401 error

  • @chrisdrogaris
    @chrisdrogaris Год назад

    I get error 400 when trying to submit a prompt at around 50-60 mins

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      You can send me log of your error at insta. I will try to figure out why this is happening for you.

  • @hosseinhaghshenas7440
    @hosseinhaghshenas7440 Год назад +1

    Hey i have error Request failed with status code 429. have anybody the same problem ? how to fix that ?

    • @faizandynamicearth
      @faizandynamicearth Год назад

      i am facing this error but still not be solved have u solved

    • @hosseinhaghshenas7440
      @hosseinhaghshenas7440 Год назад

      @@faizandynamicearth unfortunately it's still unresolved. But if resolved i will say here

    • @artoffreezing8451
      @artoffreezing8451 Год назад

      ​@@hosseinhaghshenas7440 same error

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      Please put your own API key in .evn file and your project will be alright then.
      you can claim you api keys from official Open AI web account.
      if you still face same issue, please check your credit expiry in open Ai dashboard.

  • @d_halimp
    @d_halimp 9 месяцев назад

    error 404 why? i have api and have credit

  • @C0D31
    @C0D31 Год назад

    I have an console error when i give input its not giving out answers pls help me bro

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      Please put your own API key in .evn file and your project will be alright then.
      you can claim you api keys from official Open AI web account.
      if you still face same issue, please check your credit expiry in open Ai dashboard.

  • @gauthiersamba6547
    @gauthiersamba6547 Год назад

    Hey Thanks for this magic video
    I am at the end of the video and I wonder why the answer text returned by the AI is cut off as soon as the answer is too long. Could you tell me how to correct this error?
    Hello from France ;)

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      Welcome. This is because max_tokens number that you have set in config. Actually max tokens represents maximum number of words that can be returned as answer by Chatgpt. There can be two solutions:
      1. Increase max_tokens parameter
      2. Ask to continue the answer and it will continue giving response from where it left.

    • @gauthiersamba6547
      @gauthiersamba6547 Год назад

      Thank you very much for this answer it works perfectly.

  • @kineto7899
    @kineto7899 Год назад +1

    Hello how to fix Request failed with status code 401?

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      I was also facing the same problem. try this:-
      I think problem is with process.env.API_KEY
      I put api key (in string) directly instead of using process.env.API_KEY
      and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

    • @rishisingh1034
      @rishisingh1034 3 месяца назад

      @@youhavetodoit9070 still it doesn't works

  • @siddesh1210
    @siddesh1210 Год назад

    Hello sir I'm getting this error :
    {message: 'Request failed with status code 401', name: 'Error', stack: 'Error: Request failed with status code 401
    at …ections (node:internal/process/task_queues:82:21)', config: {…}, status: 401}
    What will be the solution please do help me.Humble request

    • @divyprajapati4971
      @divyprajapati4971 Год назад

      add correct organisation id

    • @siddesh1210
      @siddesh1210 Год назад

      @@divyprajapati4971 I have added it properly and have checked it twice than too same error @zainkeepscode can you plz know y this is so??

  • @geroigamechannel222
    @geroigamechannel222 2 месяца назад

    {
    "error": {
    "code": "unsupported_country_region_territory",
    "message": "Country, region, or territory not supported",
    "param": null,
    "type": "request_forbidden"
    }
    } 😑

  • @sohailakhtarali6114
    @sohailakhtarali6114 Год назад

    After deployment on vercel im getting error of Cross origin how to solve this plz tell me

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      Have you configured the cors in index. js of server?

    • @sohailakhtarali6114
      @sohailakhtarali6114 Год назад

      @@ZAINKEEPSCODE I had followed all instructions as per in video

    • @sohailakhtarali6114
      @sohailakhtarali6114 Год назад

      And I also configured cors through app.use and that error is only occurring after deployment And before deployment on localhost its working fine

  • @sweetypatel7055
    @sweetypatel7055 Год назад

    It's throwing an error 429 in the server side please help it's urgent

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      Please put your own API key in .evn file and your project will be alright then.
      you can claim you api keys from official Open AI web account.
      if you still face same issue, please check your credit expiry in open Ai dashboard.

  • @nipuranisen8920
    @nipuranisen8920 Год назад

    When I upload it on vercel then it is showing request failed with status code 401

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      You can send me log of your error at insta, I will try to figure out why this happening for you.

    • @anjanainduwara48
      @anjanainduwara48 Год назад

      @@ZAINKEEPSCODE me too brother

    • @gauthiersamba6547
      @gauthiersamba6547 Год назад

      I have the same error as you which occurs after the deployment....
      Did you find the solution?
      Disgusted to have finished the tutorial but that the app does not work once deployed...

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      I was also facing the same problem. try this:-
      I think problem is with process.env.API_KEY
      I put api key (in string) directly instead of using process.env.API_KEY
      and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      @@gauthiersamba6547 I was also facing the same problem. try this:-
      I think problem is with process.env.API_KEY
      I put api key (in string) directly instead of using process.env.API_KEY
      and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

  • @rpandidurga359
    @rpandidurga359 9 месяцев назад

    i got an error like
    import {Configuration, OpenAIApi} from 'openai'
    ^^^^^^^^^^^^^
    SyntaxError: The requested module 'openai' does not provide an export named 'Configuration'
    when i try to import in index.js
    can u help me please ?

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  9 месяцев назад +2

      Hey,
      It looks like you are not on the same version of openAI. At the time of recording the tutorial, I used the version 3.1.0 ( because that was latest at that time). Since then, they have released updates which changed the module.
      Still, you can follow the tutorial.
      * Uninstall the current OpenAI by:
      npm remove openai
      * Install the same version
      npm i openai@v3.1.0
      Thanks

    • @rpandidurga359
      @rpandidurga359 9 месяцев назад

      thank you@@ZAINKEEPSCODE

    • @chitranshsinha8620
      @chitranshsinha8620 9 месяцев назад

      I am getting the same error. How did you fix it??

    • @rishisingh1034
      @rishisingh1034 3 месяца назад

      @@ZAINKEEPSCODE it worked thank you so much

  • @artoffreezing8451
    @artoffreezing8451 Год назад

    How to solve error 429

  • @akshatverma3044
    @akshatverma3044 Год назад

    Facing request failed with status code 401 as response from ai issue

    • @AtulMaurya-ot9ki
      @AtulMaurya-ot9ki Год назад

      Same problem bro

    • @navalnehra9874
      @navalnehra9874 Год назад

      yup.... same problem

    • @navalnehra9874
      @navalnehra9874 Год назад

      firstly I think its bcs of listening port. but this problem occuring even after iIchange port as process.env.port||3000

    • @KartikRoy-sp7lo
      @KartikRoy-sp7lo Год назад

      just get a new api key from openai and add the .env file to .gitignore

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      I was also facing the same problem. try this:-
      I think problem is with process.env.API_KEY
      I put api key (in string) directly instead of using process.env.API_KEY
      and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

  • @mdsufyankhan1029
    @mdsufyankhan1029 Год назад

    I am getting error 429 how to deal with that ??

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      Please put your own API key in .evn file and your project will be alright then.
      you can claim you api keys from official Open AI web account.
      if you still face same issue, please check your credit expiry in open Ai dashboard.

    • @mdsufyankhan1029
      @mdsufyankhan1029 Год назад

      @@ZAINKEEPSCODE thanks for the reply sir..
      It wasn't working at all so I made another account on openai then used their new api and now my app is working fine and i have changed the whole UI experience and it looks so good all the credit goes to you..
      Thankyou so much for this wonderful project❤️

  • @AI_FutureZone
    @AI_FutureZone Год назад

    Please provide the github link🙏

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад

      GitHub links are available in description!

  • @digestedvalue3369
    @digestedvalue3369 Год назад +1

    The last app I built was the social media app and I never could deploy it properly :/ scared to try this.

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      Sorry for your experience, that tutorial was so long so I had to skip that part. But in this one, we are definitely going to deploy as Full Stack App.

    • @digestedvalue3369
      @digestedvalue3369 Год назад

      @@ZAINKEEPSCODE Thanks for the update. I will give this one a try!

  • @shouryasinghrathore2727
    @shouryasinghrathore2727 Год назад

    getting 401 error please help

    • @prajwalwalde4489
      @prajwalwalde4489 Год назад +1

      There is a problem in they key encryption method, even I am facing this problem. You put the entire key in your js file and the code will run fine.

  • @techgyanwithmaan5980
    @techgyanwithmaan5980 Год назад

    Pls upload new videos

  • @anuragdas1217
    @anuragdas1217 Год назад

    The api isn't free right? Did you buy it?

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      Open AI is giving the free trial of $18 which is a pretty decent amount of API requests, after that they will charge you on the basis of your usage like firebase does.
      I have not bought any subscription yet.

    • @anuragdas1217
      @anuragdas1217 Год назад

      @@ZAINKEEPSCODE So to access the free trail, do we have to pay the 18 dollars up front and we get the api for 2 months? Or do we have to put our card details only and cancel the subscription before we get charged the 18$?

    • @ZAINKEEPSCODE
      @ZAINKEEPSCODE  Год назад +1

      @@anuragdas1217 No there is nothing like you have to pay upfront, when you sign up $18 credit is for your account by default without putting any card details. You should visit OpenAI and check your API profile. That's it

    • @anuragdas1217
      @anuragdas1217 Год назад

      @@ZAINKEEPSCODE oh got it, thank you sir.

  • @youhavetodoit9070
    @youhavetodoit9070 Год назад +3

    If Anyone Is facing with 401 error. try this:-
    I think problem is with process.env.API_KEY
    I put api key (in string) directly instead of using process.env.API_KEY
    and then it is working fine. yeah but we should use process.env.API_KEY if we are going to deploy it

    • @raneemrashid9018
      @raneemrashid9018 Год назад +1

      Got the same error and just tried with a new APIkey from open AI and it worked fine, you just need to make sure that the API key is correctly pasted

    • @youhavetodoit9070
      @youhavetodoit9070 Год назад

      @@raneemrashid9018 ok Thanks bruh :)

  • @gvenkatesh8045
    @gvenkatesh8045 Год назад

    Not clear this you clearly upload