Тёмный

How to use ChatGPT API Python for Beginners - Full ChatBOT Tutorial 

1littlecoder
Подписаться 83 тыс.
Просмотров 152 тыс.
50% 1

In this video, we'll learn to build a ChatBOT using Python with ChatGPT API from OpenAI
1. Learn how to get OpenAI Key Token
2. Two different methods of using ChatGPT API in Python
3. Building a Python ChatGPT ChatBOT with openai Python package
4. Using ChatGPT API Completions End point
5. How to change ChatGPT API Parameters like temperature
6. Summary
Code and Demo - github.com/amr...
❤️ If you want to support the channel ❤️
Support here:
Patreon - / 1littlecoder
Ko-Fi - ko-fi.com/1lit...

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 160   
@1littlecoder
@1littlecoder 7 месяцев назад
🚨BUY with 34% Discount on my new Generative AI Course - bit.ly/3HQXsQd 🎉Coupon Code - LETSGO 🎉
@MN-yz7bp
@MN-yz7bp 3 месяца назад
Great teacher. This is the best explanation for newbies that I've seen.
@1littlecoder
@1littlecoder 3 месяца назад
Glad it was helpful!
@JunboKoh
@JunboKoh Год назад
Great tutorial for ChatGPT api. I really enjoy watching for your kind and clear teaching:)
@1littlecoder
@1littlecoder Год назад
Thank you ver much!
@jamges
@jamges Год назад
This is great! Would love to know how to chain API calls for Whisper and GPT together: For example: A Ui where a user speaks, whisper transcribers what they say , then their transcription is summarized/interpreted with a pre-made GPT prompt, and the user can see the summarized/remixed output?
@arashputata
@arashputata Год назад
Thanks bro for being so fast in announcing ai news. Already last night after ur video about chatgpt i jumped on it and made a quick chatbot
@1littlecoder
@1littlecoder Год назад
Keep it up, Thanks for sharing :)
@icontentacademy
@icontentacademy Год назад
You always put out some of the best content out on RU-vid. Thanks for sharing your knowledge of AI with the community!
@neofuturist
@neofuturist Год назад
Commenting before even watching the video because I want to thank you for all your effort!!
@1littlecoder
@1littlecoder Год назад
Thank you too!
@anshuman6623
@anshuman6623 6 месяцев назад
Great video! Covered all the points it sought out to cover. Thumbs up!
@ashishbhateja
@ashishbhateja Год назад
Very well timed and nicely explained. Wishlist : please share how to add langchain/gpt index/pinecone 🤞
@Ryan-yj4sd
@Ryan-yj4sd Год назад
yes!
@Hypersniper05
@Hypersniper05 Год назад
Yes
@dupedex1779
@dupedex1779 Год назад
Yes!!
@moni1122331
@moni1122331 Год назад
Agree
@Kalease54
@Kalease54 Год назад
Excellent video as always. A few things I’m curious about though, using the API endpoint how would you retain chat history like you did using the While True loop? Also if building an application for multiple users how would you do it in such a way that the ChatGPTs memory is specific to a certain user?
@carlosprieto2554
@carlosprieto2554 Год назад
Same question
@1mrnewton
@1mrnewton Год назад
You’d need to always append your previous message and gpt response to the new request json body He explained in the video.
@iangouvea9671
@iangouvea9671 7 месяцев назад
Nem todo Indiano, mas sempre um Indiano. Obrigado amigo, você é um amigo.
@mariasueabiera8684
@mariasueabiera8684 7 месяцев назад
Awesome tutorial especially for beginners
@1littlecoder
@1littlecoder 7 месяцев назад
Glad it was helpful!
@mohammadawwad7832
@mohammadawwad7832 Год назад
Hello, very interesting and thanks for being extremely clear. A question regarding the Data privacy, using these API's will not register any of our data for training purposes right ?
@1littlecoder
@1littlecoder Год назад
Thank you. That's what OpenAI says.
@ompathak3384
@ompathak3384 7 месяцев назад
it shows error that my model quota limits exceeds😮‍💨
@SurajSharma-bh9gf
@SurajSharma-bh9gf Год назад
The error is message": "You exceeded your current quota, please check your plan and billing details." not working please suggest
@alexisrioslopez5423
@alexisrioslopez5423 10 месяцев назад
you have some credit to do your works, now you need to recharge.
@billythebiest_9404
@billythebiest_9404 7 месяцев назад
i have the same error but when i look into my openai account I still have credits.
@ujjwalsrivastava4581
@ujjwalsrivastava4581 5 месяцев назад
Same error guys if anyone got the solution please tell me
@lazycoder112
@lazycoder112 4 месяца назад
If you still have credits prob because the request needs more credit then you have especially doing request with gpt 4
@ansar2137
@ansar2137 Месяц назад
I was getting the same error, I just updated the limits and refreshed the site, it was then working for me. (I think what worked for me is I updated the monthly limit to a number less than my available credits, suppose If I had 10 credits, my monthly credit limit should be less than 10.) Hope this helps..
@raidedcluster
@raidedcluster Год назад
Man I love your work. Thank you.
@1littlecoder
@1littlecoder Год назад
I really appreciate that :) Thanks for commenting!
@rahasyabharat4894
@rahasyabharat4894 7 месяцев назад
Will you please help me where I put this code in which application i understand the whole method how to translate key from open AI and other but I am not able to understand in which application I have to put this all
@stevefox7469
@stevefox7469 Год назад
Excellent tutorial as usual...super up to date content.
@stevezing9341
@stevezing9341 Год назад
Thank you so much, your tutorials are so helpful. Can you pls make a tutorial on how to fine tune this model. Let's say i want to provide the model with several documents. I want it to learn from it so that i can do QA on it.
@DrR0bot
@DrR0bot Год назад
This is really good. Thanks so much for the thorough explanation. A question that perhaps you have already answered. Is there a way to fine tuned CHAT gpt let's say from content or text you have created? Like your thesis or something? Thanks
@1littlecoder
@1littlecoder Год назад
Not yet, but you can use embedding from a different model and use ChatGPT model for inference
@Travestyalpha
@Travestyalpha Год назад
Thank you. Very clear explanation.
@1littlecoder
@1littlecoder Год назад
You are very welcome!
@outsidemix3626
@outsidemix3626 Год назад
Thank you! Incredibly detailed and clear.
@khushiagarwal7907
@khushiagarwal7907 26 дней назад
uch a clear explanation!
@HelenJackson-pq4nm
@HelenJackson-pq4nm Год назад
Really clear explanation, thanks a lot
@ahmimo2918
@ahmimo2918 Год назад
Thank you so much for putting this together! -- Very helpful! One noob question: is it possible at this point of time to train chatGPT on your own data using their API?
@1littlecoder
@1littlecoder Год назад
Right now, Finetuning with ChatGPT model is not available
@spicer41282
@spicer41282 Год назад
You are Always on the tip of this spear! 👌 👍 Look forward to your next gangbuster vid? How about a Mashup between this newAPI and ControlNet! Thoughts?
@Brandon-uf4dt
@Brandon-uf4dt 5 месяцев назад
Is there a way I can access public data from law books and add it to a personal chat gbt library?
@aniketkajania610
@aniketkajania610 Год назад
its the first time im using their api and im getting RateLimitError: saying that i have exceeded my quota
@ARTHUR5102000
@ARTHUR5102000 Год назад
same
@woodenmonkeyfox
@woodenmonkeyfox Год назад
same
@ecc3d452
@ecc3d452 Год назад
let me know if you find a solution, i have the same problem
@justapassingperson6546
@justapassingperson6546 Год назад
Have you paid for your tokens?
@knightye
@knightye 10 месяцев назад
It's not free; you have to pay
@zappy9880
@zappy9880 Год назад
Isn't the API paid? I can't get it without entering card info. how'd you get it?
@SONUKOL1
@SONUKOL1 Год назад
Very knowledgeable content
@1littlecoder
@1littlecoder Год назад
Thank you
@jurgenihlau4052
@jurgenihlau4052 2 месяца назад
Hello, very nicely explained. I have a small problem, maybe you can help me. I run a Linux Mint support forum (Linuxmintusers - LMU GER) with SMF software. In the first post of a support request, users often forget to include their system details so that we can help. How can I use the ChatGPT API, ChatGTP to check the first post to see if the information matches the question or not? Is that possible? Maybe you have an idea for us! Thank you!
@MuhammadYasir-uc9xt
@MuhammadYasir-uc9xt 4 месяца назад
I have a project in python language which is a Plan text editor. I want to integrate it with open AI using API for the some purposes which are content suggetions, vocabulary suggetions, spell checker, grammar checker. kindly help me with it.
@Leyverse
@Leyverse Год назад
Thank you so much, can you teach us how to integrate with whatsapp and telegram?
@markfrancisbeltran4619
@markfrancisbeltran4619 10 месяцев назад
Great video. You got me hook there and didn't even notice the time! I like how you well explained the topic. Hey you talked about building a chat interface... but I can't find your video. Can you link it here for me please.
@maftar5
@maftar5 3 месяца назад
How do you add context with the api endpoint?
@CARLOSFROMNY
@CARLOSFROMNY Год назад
thanks for your contribution, you the best!!
@1littlecoder
@1littlecoder Год назад
My pleasure!
@ahmadzaimhilmi
@ahmadzaimhilmi Год назад
Using requests module, how do you reference a particular chat. Say the conversation about Gary Kasparov vs about something else? I saw there's a chat ID in the json response. How do you reference that?
@highsobriety3491
@highsobriety3491 Год назад
Great teacher brother.
@pratyushbhatt1712
@pratyushbhatt1712 10 месяцев назад
How does the second method maintains the context like the first method was maintaining?
@95249192
@95249192 Год назад
If possible, how to set up with gradio ?
@harpreetchouhan1200
@harpreetchouhan1200 Год назад
Never used the api still showing this error "RateLimitError: You exceeded your current quota, please check your plan and billing details" any solution
@1littlecoder
@1littlecoder Год назад
I think you would have exceeded 3 months since your account creation.
@Investwithwisdome
@Investwithwisdome Год назад
what should be my system requirements if i want to train openai to create a new Application. Can i do it in 8GB Ram & I5 10Generation Laptop ?
@Sergedable
@Sergedable Год назад
Great video. I'd be grateful if you made one. How can we fine-tune ChatGPT for our own data?
@arashputata
@arashputata Год назад
It's not possible to fine tune chatgpt.. also mentioned in the fine tuning section of the openai documentation
@spicer41282
@spicer41282 Год назад
You can do so by feeding your data via the message box! Limited as far as i know directly from ChatGPT itself. It can ingest your text data @ 4070 characters including spaces at a time. You want make sure your Prompts contains the file streams so ChatGPT knows its part of a larger text file greater than 4070 characters. Hope that helps.
@Damnedindenial
@Damnedindenial Месяц назад
I am using a normal IDE, for my internship. how do I use this with a normal IDE. I don't get that helpful little box to type in and ask it questions
@1littlecoder
@1littlecoder Месяц назад
In a normal IDE you need to use with your API key
@tyler8902
@tyler8902 Год назад
Fantastic tutorial!
@rildodemarqui
@rildodemarqui Год назад
I've never used this API before, but even so I'm getting the message :"You exceeded your current quota, please check your plan and billing details." Somebody had this issue?
@riyaz8072
@riyaz8072 Год назад
Same issue.
@ecc3d452
@ecc3d452 Год назад
same
@ColabPro-ho9sx
@ColabPro-ho9sx 5 месяцев назад
my code doesn't work can you help me i copied your code but doesn’t work it
@F.D.S
@F.D.S Год назад
Great!! Thank you!
@jnealeuk
@jnealeuk Год назад
How easy/hard (!) is it to embed these chatbots into a website? Thank you for your work!!
@yogaday4835
@yogaday4835 Год назад
thanks for the tutorial !!!
@lyricsdepicted5628
@lyricsdepicted5628 Год назад
Looks like for fine-tuning you can't make use of the 10x cheaper endpoint even though the model is the same.
@lyricsdepicted5628
@lyricsdepicted5628 Год назад
Now with control over temperature, you could repeat your hullicination querries with temperature of 0 and compare :)
@roguephilosopher2465
@roguephilosopher2465 9 месяцев назад
Very helpful!
@1littlecoder
@1littlecoder 9 месяцев назад
Glad it was helpful!
@shreyashavaldar2076
@shreyashavaldar2076 6 месяцев назад
Here is some more info: INFERENCE PARAMETERS: Temperature: Control randomness in Output, High temperature high randomness. Top_p: How many possibilities does the model considers when its giving its output.
@bhaidar
@bhaidar Год назад
Another question, where would you store the "messages" if you were doing a Web App?
@1littlecoder
@1littlecoder Год назад
Maybe a temporary json
@dalisongwira1424
@dalisongwira1424 Год назад
wow you know how to explain
@1littlecoder
@1littlecoder Год назад
Thank you
@sambokhetwal
@sambokhetwal 7 месяцев назад
Can we link chat got api with facebook graph api?
@machinesmakemusic
@machinesmakemusic Год назад
Please make a video with method 1, but with more settings like temperature ! I would be so happy.
@alintambunaloko
@alintambunaloko Год назад
How to using the model in webApp like using flask
@jasvinderkumar430
@jasvinderkumar430 Месяц назад
I am always getting below error: No one giving solution of this error. even I have hit the 1 request with new api key. You exceeded your current quota, please check your plan and billing details. For more information on this error
@1littlecoder
@1littlecoder Месяц назад
you need to make sure you have got the credits / money in your account, see the daily spend limit as well
@ashishmalhotra2230
@ashishmalhotra2230 6 месяцев назад
Even with a new signup I am getting this message: "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs". What to do?
@1littlecoder
@1littlecoder 6 месяцев назад
I think you need to try with a new phone and a new email, probably the previous one's credits expired
@ashishmalhotra2230
@ashishmalhotra2230 6 месяцев назад
@@1littlecoder Still doesnt work. New email, new phone, still doesnt
@ujjwalsrivastava4581
@ujjwalsrivastava4581 5 месяцев назад
​@@1littlecoderit is still not working please tell the solution
@DjDiversant
@DjDiversant Год назад
Thank you!
@premprasad3511
@premprasad3511 Год назад
I just get this error : "You exceeded your current quota, please check your plan and billing details" This is the first time I am using it Can I know what should I do ?
@1littlecoder
@1littlecoder Год назад
It's possible you don't have any credits left. YOu might have to buy it
@Sensergaming
@Sensergaming Год назад
I want to know about youtube where we connect through API in Data studio
@1littlecoder
@1littlecoder Год назад
I'm sorry could you please elaborate?
@ujjalbaniya
@ujjalbaniya Год назад
simply adding a bool instead of infinite loop will make code more efficient.
@ujjalbaniya
@ujjalbaniya Год назад
x = True print("If you want to end the chat Please type END") while x: message = input("User : ") if "end" in message.lower():
@rodo2220
@rodo2220 4 месяца назад
great video
@TimothyCarney-kk7kw
@TimothyCarney-kk7kw Год назад
Thanks!
@bhaidar
@bhaidar Год назад
Thanks for the excellent video. However, I was able to install openai on Google Colab, but when I try to set the key, it gives me errors. NameError Traceback (most recent call last) in ----> 1 openai.api_key = 'sk-...' NameError: name 'openai' is not defined
@1littlecoder
@1littlecoder Год назад
I think you didn't do pip install openai properly. If you had done that then you didn't import openai
@bhaidar
@bhaidar Год назад
@@1littlecoder I followed the sample code you provided. I installed openai, then added the key. I should import openai first to add the key?
@CoBER-nc3el
@CoBER-nc3el Год назад
Hi there! Thanks for the video, its been very helpful, currently using it in a project im working on. I was wondering if you could tell me if paying for the api key gives faster response times... for chatgpt api? Would appreciate your response. At the moment im using the free trial.
@mihawk1096
@mihawk1096 Год назад
Can i ask how you got the free trail bcs im not able to use my api at all even though its my first time
@danieladam4719
@danieladam4719 Год назад
​@@mihawk1096 OpenAI grants you an amount of 5 dollars when you first sign-up but it seems to expire after a few months. Found out today that my trial expired one month ago.
@OrchidMacro
@OrchidMacro Год назад
That would be nice to add a functionality where you can insert a PDF.
@hitarthdesai0882
@hitarthdesai0882 Год назад
i have the error ssaying "You exceeded your current quota, please check your plan and billing details." and i haven't used it till now?? please let me know
@hitarthdesai0882
@hitarthdesai0882 Год назад
i tried creating a new API key too but gives the same erroe
@SatSTAR0
@SatSTAR0 Год назад
same issue
@PatnaikUC
@PatnaikUC Год назад
Excellent! Please make a Python code with ChatGPT API for robotic applications (Using Raspberry Pi) where the if the user input is any word out of 10 specific words saved, the response generated should be that word only which is then linked to the output. Example- "go left" input by the user. The robot moves left as the response it receives "go left" from ChatGPT through the API key
@tylermichaelbell
@tylermichaelbell Год назад
you may want to look at arduinos for that, but honestly, you could ask chatgpt to write this code and it'll get you 80 percent there. i dont know exactly what your application is for though, seems like chatgpt is an extra step that isnt needed. you could have chatgpt write a simple console application that moves per input.
@Aabdulnour01
@Aabdulnour01 Месяц назад
does this still work?
@PANDURANG99
@PANDURANG99 8 месяцев назад
how to deploy for users?
@TechTips_KishuNeelavara
@TechTips_KishuNeelavara Год назад
API key in freetrail is not working
@uvaisahmad2225
@uvaisahmad2225 Месяц назад
Authentication error: no api key provided🙂
@sharanbabu2001
@sharanbabu2001 Год назад
Cool!
@tomtomfh3639
@tomtomfh3639 Год назад
yes
@theresilientpianist7114
@theresilientpianist7114 Год назад
Showing me rate limit error
@ninasirsi2340
@ninasirsi2340 7 месяцев назад
Where is next video
@debalinaghosh6404
@debalinaghosh6404 Год назад
can you help doing it in java?
@1littlecoder
@1littlecoder Год назад
Why so ?
@debalinaghosh6404
@debalinaghosh6404 Год назад
Hi, actually I have to do everything in java as my supervisors advised and I did in java. I have a question, can we give image inputs (like question in images) using API key of OpenAI@@1littlecoder
@1littlecoder
@1littlecoder Год назад
Hey, You can't give image as an input but there are certain ways you can take image and get a caption. / text out of it and then share it with this
@jdcrunchman999
@jdcrunchman999 4 месяца назад
Your video is blocking the code
@athirashibu6089
@athirashibu6089 Год назад
reply = response["choices"][0]["message"]["content"] TypeError: 'NoneType' object is not subscriptable
@1littlecoder
@1littlecoder Год назад
Was your request successful?
@himadridas8221
@himadridas8221 Год назад
I just hate the word...for beginners
@QWERTY-gp8fd
@QWERTY-gp8fd Год назад
why. everybody has to start somewhere. Perfection doesn't happen right away
@ibrahimnadeem1064
@ibrahimnadeem1064 8 месяцев назад
I've tried numerous times this code each n every thing, but still showing an error
@priyankjetani1508
@priyankjetani1508 Год назад
In the second method can we ask for a related question? likewise, if we ask the first Q. "who is the best chess player?" and the second Q. "he was lost any matches?
@syedbabarali1
@syedbabarali1 Год назад
Thank you very nice way to guide! Could you assist me in creating a knowledge base and consuming the API in the C# language?
@1littlecoder
@1littlecoder Год назад
I think you should try this - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hYcKPzXh4D8.html
@sameerzahid3544
@sameerzahid3544 Год назад
Great work! Waiting for the tutorial about Gradio and ChatGPT.
Далее
Beatrise (пародия) Stromae - Alors on danse
00:44
Avaz Oxun - Yangisidan bor
14:29
Просмотров 285 тыс.
How ChatGPT Built My App in Minutes 🤯
8:28
Просмотров 2,5 млн
How I Made AI Assistants Do My Work For Me: CrewAI
19:21
Use OpenAI's API for Free
7:36
Просмотров 44 тыс.