If you get an API error then please read this. If you’re getting the source code from the description link, you can skip this, as the file is already updated. This chatbot project initially uses the OpenAI API to generate responses. However, OpenAI no longer offers free API keys; the minimum cost to get started is $5. If you're willing to pay for the OpenAI API, follow the video steps as they are and ensure you purchase the API key during setup. Your chatbot should work without any issues. For those who prefer not to pay, you can use Google's free Gemini API. Follow these steps to update your script.js file: 1. 22:48 In line 6, paste your API key, which you can get for free from aistudio.google.com/app/apikey 2. 21:24 In line 18, update the API URL to: const API_URL = `generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent?key=${API_KEY}` 3. 21:46 In line 20, update the requestOptions object to: const requestOptions = { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ contents: [{ role: "user", parts: [{ text: userMessage }] }] }), }; 4. 25:24 In line 36, update: messageElement.textContent = data.candidates[0].content.parts[0].text; // Update message text with API response This will allow your chatbot to function without API errors using the free Google Gemini API.
@vedantvaity6789Күн бұрын
I followed all the steps mentioned above but it is still not working can u pls help
@CodingNepalКүн бұрын
@@vedantvaity6789 Can you share more details or any error messages from the console? I'll help you troubleshoot!
@danieloluwakemi9088 Жыл бұрын
Awesome, I can't believe it, never though I would do something like this even though I'm just calling an API, it's still very cool. Great work bro, the amount of projects in this channel is just insane! this cannel is really underrated, nice video.
@gamingarea90117 ай бұрын
is the API is free ? and if it is free then for how long ?
@exrew Жыл бұрын
why is this channel so underrated 😭😭
@user-jk6jh4zb6k Жыл бұрын
Bcz he don't make it with voice
@Ciencia_con_s Жыл бұрын
Communities* Spanish (from spain) devs communities. They choose whose to 'grow'
@liftedup299 Жыл бұрын
200k subscribers is not underrated bro
@MujHaciАй бұрын
oyda azerbaycanli gormek sevindirdi 😄
@exrewАй бұрын
@@MujHaci :D
@tasneemayham9748 ай бұрын
THIS IS THE MOSSTTT UNDERRATEDDD KZfaqE VIDEOO I HAVE EVERRR SEEEEEEEN IN MY ENTIRE LIFFEEEEE!!!!!!!!!!!!!!! THANKK YOUUUUUUU!!!!!!!!!! SOOOOOOOOO MUCHCHHHHHHCHCHCHCHC!H!!! Incrediblyyy Helpful!!!
@CodingNepal Жыл бұрын
Create AI Image Generator Website in HTML CSS and JavaScript: kzfaq.info/get/bejne/nKePp7qotbPFoIE.html Create your own ChatGPT in HTML CSS and JavaScript: kzfaq.info/get/bejne/l9p7p6pjns_Wn40.html
@longathelstan Жыл бұрын
Can you share source code
@muhammadvitoni1802 Жыл бұрын
an error occurred even though I entered the API_keys correctly is there any solution for that?
@living._truth32709 ай бұрын
how would you modify this to work as a livechat instead of a chat bot
I have been looking for this dude, Thank you so much!!
@yalejolopez-gd1ez Жыл бұрын
You are the best, I send you a hug from Colombia. 🙌
@fighter8931 Жыл бұрын
MashAllah ! what a great video ! I can't wait to subscribe
@TradeEngineer28219 ай бұрын
Bro, when I made this Chatbot, I coded it perfectly with no errors, but after using my API Key , I m getting the error 'Too many requests , you have completed your current quota', Please tell what should I do
@khushboogupta67847 ай бұрын
same, Have you got any solution?
@tuskinggiant7 ай бұрын
maybe try generating API key with a new account which is not logged in to GPT
@codingwave56 Жыл бұрын
Thank You So Much 🤗 Amazing Project For Me... i learnt so many things from it.
@nanasatoruu1910 ай бұрын
why mine didnt answer correctly and always got error message, but in console after I inspect, everything is fine..????
@CromwellEdonis4 ай бұрын
You are my savior.
@gehanadel3616 Жыл бұрын
it was brilliant but GPT doesn't be supported in my country so if you can recommend something else or do another video with another technique I will appreciate it
@realdrumfan Жыл бұрын
Whats is Your Country?
@muhammadzakariya169 Жыл бұрын
Bard in an option
@gehanadel3616 Жыл бұрын
@@realdrumfan Egypt
@zainslamdien8138Ай бұрын
@@realdrumfan South Africa
@krishnachaitanya-md8wl5 ай бұрын
Sir, I have gone through your source code. But the chatbot was only replying with one message "oops ! something went wrong". I have placed my own API key in it..even then it is showing only the same thing. What to do to make the chatbot work.
@XylomICP5 ай бұрын
same here I also added the api and it says script line 39
@Kishan_Panchal4 ай бұрын
so fir hua ki nai
@Kishan_Panchal4 ай бұрын
mera bhi same aa raha haii
@XylomICP4 ай бұрын
Okay so I found out something apparently we need to add out payment details for it to work I abandoned this method and instead created the chatbot with rule based chatbot
@Kishan_Panchal4 ай бұрын
@@XylomICP okay
@hz-vz8qj8 ай бұрын
Most awesome tutorial ever!
@CricketGuruji15 Жыл бұрын
Can you make it using Nodejs , ExpressJs and React for realtime updates?
@vaishnavisabbanwar49875 ай бұрын
thanks sir your this video was really helpful to me
@jasono873 Жыл бұрын
Awesome Tutorial 👍
@MrOse-nh5pd13 күн бұрын
Thank you for this video.
@herbyprein90966 ай бұрын
Great tutorial 👍. Because I am new to this topic two questions: 1) How can I embed the bot in my Wordpress site? 2) I am using most of the time a local LLM (LM Studio) for testing. I changed the api-url, the api-key and the model name, but it didn't work (error messages field is required). Any hints for me?
@abhishekkumar-gv6sz Жыл бұрын
awesome video brother'❤❤, pls explain how to create an account and API key.
@mdms4549 Жыл бұрын
Thanks bro 😊😊😉, can you make a valid evaluation form that validates both login and registration?
@CodingNepal Жыл бұрын
Yes, sure
@mdms4549 Жыл бұрын
@@CodingNepal Thanks bro💙😊✋
@mcombatti Жыл бұрын
It's bad practices to include API key in Javascript. Anyone who views the bot could view your secret key, & run your API account thru the roof astronomically.
@mrravipandee10 ай бұрын
i implement this, but cant run show me error...
@kontnoctilus10 ай бұрын
@@mrravipandee+1
@abdul.arif200021 күн бұрын
so what do we do instead?
@abcedutechnadiaabdalla9 ай бұрын
Thank you very much. A wonderful explanation that helped me a lot.
@gamingarea90117 ай бұрын
is the API is free ? and if it is free then for how long ?
@nishagawade3248 Жыл бұрын
if you will explain with your voice, then it will give you more views and people will like your content
@m1ke79Ай бұрын
hey mate! is this chatbot free to use? even for commercial projects? best regards, mike :)
@CodingNepalАй бұрын
Hey Mike, this chatbot is free for any use. Thanks!
@rxdeveloper873 Жыл бұрын
it's great and thanks but I have followed all your steps in the video and whenever I try to chat there is an error and the console says "You didn't provide an API key. You need to provide your API key in an Authorization header" Although I have put the API as you did in the video
@kunalpawar7527 Жыл бұрын
Same here bro. Pls reply if your issue is solved now.
@laxmidhakal2987 Жыл бұрын
Love from US
@binukbe4401 Жыл бұрын
Nice bro but how would you implement exporting and importing chat history?
@CodingNepal Жыл бұрын
Watch this video: kzfaq.info/get/bejne/l9p7p6pjns_Wn40.html Here I've shown how to save chat history to the browser's local storage and retrieve it from there.
@ompandey45957 ай бұрын
@@CodingNepal as ur from nepal so pls speak if u speak ur viewership will increase
@ankurjadhav95588 ай бұрын
great video worked for me thank you. and another thing can we use any free API if yes please suggest the name
@abdulwahabAlani Жыл бұрын
Nice bro but please in The future video please explain in detail so we will understand the code better instead of using background music
@salonirajput669011 ай бұрын
Your content is awesome but can you please start explaining the code instead of using music 🎵 🎶 . It's a request ☺️
@Azalea_tube Жыл бұрын
can we use Bard API_KEYS instead? open ai available in only 45 countries. pls make a video. and let me know if you see this comment.
@knowledgeisdone Жыл бұрын
4th comment pin pls and can you make a sidebar that can randomize any photo and set it and is fixed on top and also save in localstorage. And also shows his name and age. For example: Save Edit // Get elements const nameInput = document.getElementById('name'); const roleInput = document.getElementById('role'); const imageInput = document.getElementById('image'); const saveButton = document.getElementById('save-button'); const editButton = document.getElementById('edit-button'); // Check if data exists in local storage if (localStorage.getItem('userData')) { // Retrieve and populate data from local storage const userData = JSON.parse(localStorage.getItem('userData')); nameInput.value = userData.name; roleInput.value = userData.role; imageInput.disabled = true; saveButton.disabled = true; } else { editButton.disabled = true; } // Save data to local storage saveButton.addEventListener('click', function() { const userData = { name: nameInput.value, role: roleInput.value }; localStorage.setItem('userData', JSON.stringify(userData)); nameInput.disabled = true; roleInput.disabled = true; imageInput.disabled = true; saveButton.disabled = true; editButton.disabled = false; }); // Enable editing editButton.addEventListener('click', function() { nameInput.disabled = false; roleInput.disabled = false; imageInput.disabled = false; saveButton.disabled = false; editButton.disabled = true; }); In sidebar. The photo is fixed at top and in the place of role there are radi🥺 os.tje 🥺 format 🥺 can 🥺 look 🥺 like 🥺 this 🙏: (Image 🙏) (Name 🙏) (Image 🙏) (age 🙏)•(role 🙏) Please 🥺 it's 🥺 my 🙏 request 🥺🥺🥺🥺🥺🥺🙏🙏🙏🙏🙏🙏🥺🥺🙏🥺🥺
@zainslamdien8138Ай бұрын
Hi, love your coding. you are a legend. Can you perhaps create a chatbot with openai assistant ? Thanks
@CodingNepalАй бұрын
Glad to hear that! What do you mean by OpenAI assistant? OpenAI API or something else?
@zainslamdien8138Ай бұрын
@@CodingNepal hi legend, you know the openai assistants where you create threads and runs and it will connect to a vector database. but its all good, i used your code and converted it into an assistant. if you want the code then let me know. thanks
I've completed this project now anyone tell me how to solve API issue cuz I cant find it on stack-overflow if there is error 429 (too many requests ) and it is expired how will I solve this
@ANUJAGUPTA-jx5ri4 ай бұрын
same , im getting that error, what did you do to resolve it?
@ammarabhatti82614 ай бұрын
@@ANUJAGUPTA-jx5ri the only solution was to make a new id and generate API key, we can't use free API if we are already using openapi for a long time.... They offer free APIs to new users only (for some time )you should make new id and then generate your API key that will work .... May be there's another solution but I haven't found any yet
@yashmadaan40244 ай бұрын
Same error is coming to me also! Did you get the solution of it ?
@caidenmacgregor3271Ай бұрын
Same, anyone have a solution?
@KoYanNaing-b5v15 күн бұрын
I believe u have to spend 5 dollars for the API to work
@albertgarciabernat84523 ай бұрын
really good job
@imadbenmadi Жыл бұрын
source code please
@gauravpatel96 Жыл бұрын
Bro listen, How to pass the API in deployment it is getting revoked, I'm not able to set up environment variables please help
@longathelstan Жыл бұрын
Amazing i like this video
@CodingNepal Жыл бұрын
Thank you very much!
@julianarobayo79809 ай бұрын
I get error in the Line starting with "fetch" in js, help
@PhuongNguyen-wh8ug7 ай бұрын
metoo
@hArshan-3 ай бұрын
Did you solve it?
@user-dk5zf8fq7h9 ай бұрын
Bro one small doubt.you implement the package how to modify example "hi to reply message how can i help you"... Please tell me bro... Waiting for you bro....
@user-ru8rp4jq2l Жыл бұрын
🔥🔥🔥
@Abid.kanwal Жыл бұрын
sir make a tutorial about " About us page generator, contact us page generator, terms and conditions page generator, disclaimer page generator and also privacy policy page generator. please please please please.
@kiran_sh1 Жыл бұрын
awesome.....
@KkppPv-wu9wb4 ай бұрын
It will be beneficiary if you just include the font details on the description
@tasneemayham9748 ай бұрын
Brother, may you please make a video on how to continue from here to hide our API key? Because, we cannot host this chatbot as the API key is hardcoded into our key, so may you please make a video on how do we evade this problem?
@aaryan1i3u82uru32 ай бұрын
i tried doing it but when i used a new OpenAI API Key, it always says "Oops! We are having trouble generating the response at this time". i've tried everything but it still doesn't work. what do i do?
@CodingNepalАй бұрын
Please read the pinned comment for this.
@nghiahoang9201 Жыл бұрын
dear bro. I want to push the file to github, to deploy for friends to use, but the file contains the api key. so is there any way to deploy?
@KaptanSingh-oy1bp Жыл бұрын
Bro, Are you solved this problem? Because i am facing same problem.
@nghiahoang9201 Жыл бұрын
@@KaptanSingh-oy1bp As far as I know, putting the API key into the evn variable (.evn), then putting the .evn file into the .gitignore file solves the API leak problem. But I get an error when I import the .evn variable into the .js file
@saggysshorts11 ай бұрын
Omg that’s what I’m finding on KZfaq since last two months 😭
@Jhunti44 Жыл бұрын
I'm able to get it worked in my asp support chat project. i'm just gonna figure out how to save to the convo in the DB.
@user-cb4dh2gx5e4 ай бұрын
api key is free or paid
@christianjayenclona46523 ай бұрын
Is this chatbot can be integrated to database for fetching data like customer orders
@azzamhaer Жыл бұрын
Please make youtube video downloader in php. i've done subscribed you with 3 account😉
@aakashgautam5260 Жыл бұрын
Bhaiya ji from your description the source code is never downloaded🙁
Api key paste karne ke baad bhi error aa raha hai defeat wala, api key pasted correctly, plz help me what I do
@FocusTTocus5 ай бұрын
the best thank you
@InterviewPreparation44445 ай бұрын
It's working
@LuckyRathod2010 ай бұрын
Nice🙂
@nguyenhoangdung382311 ай бұрын
thank you very much
@ritikmanta002810 ай бұрын
Bro do we need to work on back-end for this ?
@tasneemayham9748 ай бұрын
Yes, for sure. To hide the API key.
@BrainBoostAI8204 ай бұрын
For the API usage, do you have to pay for it after using it once?
@SpeedyPaws-zk1tp3 ай бұрын
yes, you need to add some credits to your openai account
@chatgpt6628 Жыл бұрын
Hi Great Please Show me How to Add Custom Data i mean Custom Response and Custom Answers PLZ PLZ
@sujonpramanik1151 Жыл бұрын
awesome project
@CodingNepal Жыл бұрын
Glad you like it!
@AdventureIsTheLife01 Жыл бұрын
Sir how you learnt Javascript plz telll me !!!!!! anything will help !!!! javascript part was literally hard for me..
@X3NOGLADIAT0R8504 ай бұрын
guys im getting authorization error code 401 errors, i put in the api key in the authorization bearer im also signed in open ai how do i fix this
@meetpitroda421710 ай бұрын
How to make government rule Regulations chatbot Can be created by. Website api key like government api key
@mg8825 ай бұрын
Do you use websocket?
@shoaeebosman188611 ай бұрын
Thank you
@ruchitshah9954 Жыл бұрын
uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
@flormonserratlazaroflorent567529 күн бұрын
una pregunta, si quisiera usar este chatbot enlazado con una base de datos? si se podria? en vez de usar OpenAI?
@CodingNepal29 күн бұрын
Yes! You can configure the chatbot to request responses from your own database instead of OpenAI. You have the flexibility to customize it as needed.
@flormonserratlazaroflorent567529 күн бұрын
@@CodingNepal y si quiero poner una imagen en el boton, y otra imagen en el icono en vez del robot se puede?
@alelimiranda80064 ай бұрын
What is the content of material-symbols-outlined?
@flash-e4cАй бұрын
Yeah Is it using Internet to answer questions
@technicalasher9677 ай бұрын
Hello ! Code is running successfully, but I only I can send the messages but I'm continuously receiving ( Oops Something went wrong) from bot Any Solutions to the Problem ?
@NehaSharma-rl4qy5 ай бұрын
Did u get solution to this
@technicalasher9675 ай бұрын
@@NehaSharma-rl4qy No, I have stopped working on this & now I'm working on my own concept ChatBot
@IFGaurav5 ай бұрын
can i use custom info for this chatbot?
@sanketsingh5555 Жыл бұрын
Bro please try to explain the code approach why(s) how(s) etc etc also in your voice either in hindi or English...
@CodingNepal Жыл бұрын
Okay, I'll try my best.
@m.areeshrashid705 Жыл бұрын
Please 👋👋👋👋
@1240JunaidShaikh-ve9mq11 ай бұрын
Y I'm getting the something went wrong error.. I did checked tha code it's same and I created my own api key also .. can u please help ?
@KishorKadam334 ай бұрын
same message as me
@snowqueen29653 ай бұрын
I got the 429 to many request error while trying to get response from server.. How to resolve it.. Pls tell me as soon as possible
@CodingNepal3 ай бұрын
It seems OpenAI no longer provides free credits for API usage. The minimum cost to get started is now $5. Once the payment is made, the chatbot should work as expected.
@SIRIVURIVENKATASIVAVARMA Жыл бұрын
i need source code its not available in website bro?
@CodingNepal Жыл бұрын
Source code has bee uploaded. Link is in the video description.
@giorgishautidze24 күн бұрын
can i copy and paste on editor pls
@bachduy38072 ай бұрын
I want integrative with java servlet , bro can u help me ? 😢
@yogeshnoob1121 Жыл бұрын
its showing something went wrong please help
@Parthkothawade6 ай бұрын
Nowadays Nepal is getting smarter and challenging other developer...
@ShankarKaligi2 ай бұрын
nice
@priurajj53852 ай бұрын
Launch json configuration error what to do
@avinashmr394711 күн бұрын
bro how you add that hi image in html code i con t understand
@CodingNepal10 күн бұрын
That's a hello emoji 👋
@codingwave56 Жыл бұрын
{error: {…}}error: {message: 'You exceeded your current quota, please check your plan and billing details.', type: 'insufficient_quota', param: null, code: null}[[Prototype]]: Object i think now we can't used api for free 😥
@CodingNepal Жыл бұрын
The free OpenAI API is available for three months after creating an account. After that, it becomes a paid service. To continue using the API for free, create a new account and API key for limited usage.
@codingwave56 Жыл бұрын
@@CodingNepal Thank You So Much ❤😊. otherwise I was stopped my project...
@HoangNguyenViet-n6z2 ай бұрын
Can you guide me to use other free APIs
@yousufansari199910 ай бұрын
Hi sir Im used your chatbot my isnot workihng
@abgaming454511 ай бұрын
what is the import url in the css code can u send this ????
@rahmatkhan80299 ай бұрын
sir it is not working when i give api key it always show that it is offline
@rahmatkhan80299 ай бұрын
please reply fast sir
@nsvol1 Жыл бұрын
I write the password in API_KEY, but the chatbot still does not work. All codes are correct, but the console says there is an error in the key. Can you help me pls?
@CodingNepal Жыл бұрын
You need to provide API key not password in the API_KEY variable.
@nsvol1 Жыл бұрын
@@CodingNepal no I mean like key,not password I know it, I maked API key and then copy paste but its still not working
@nsvol1 Жыл бұрын
@@CodingNepal every code true but no response from bot
@fluffybaal453011 ай бұрын
You probably changed up the role from "user" to something else right that may be the caused of the error you must keep it as user if you want the chatbot to identify itself as some other bot names you gotta add another line for example in line 32 body: JSON.stringify({ model: "gpt-3.5-turbo", messages: [{role: "user", content: userMessage}, {"role": "system", "content": "Jarvis is a chatbot thats created to help viewers to learn Algorithm and Data Structure in programming in a website called Easy Learn that specializes in that area."}], })
@developersagnik4 ай бұрын
Please reply to the comments where there is an error. I got the same error of getting 'Something went wrong.' as a reply
@MB-jv7dp4 ай бұрын
same could you resolve it?
@zohamitkar2 ай бұрын
can it give any answers like chatgpt or other AI's???
@CodingNepalАй бұрын
Yes, it uses OpenAI API to generate response so it give answer like ChatGPT.
@koushiksarkar1999 Жыл бұрын
Scientific calculator for engineering study make it bro
@m.areeshrashid705 Жыл бұрын
Please Resume Generator HTML CSS JavaScript & Create ReactJS Project.
@ajayrathod75852 ай бұрын
is anyone successfully run the provided code? i'm getting the same error after creating the new account for api!! what can i do please suggest me..
@CodingNepalАй бұрын
Please read the pinned comment for the solution.
@usama579267 ай бұрын
Is source code available for this?
@DeepakKumar-ck7pn10 ай бұрын
How Solve the problem Too Many Request
@mohdzishan8795 Жыл бұрын
Bro .. I have searched in your website.. I didn't get this chatbot ?.
@CodingNepal Жыл бұрын
Source code has bee uploaded. Link is in the video description.