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

  Рет қаралды 157,185

1littlecoder

1littlecoder

Күн бұрын

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...

Пікірлер: 163
@1littlecoder
@1littlecoder 8 ай бұрын
🚨BUY with 34% Discount on my new Generative AI Course - bit.ly/3HQXsQd 🎉Coupon Code - LETSGO 🎉
@MN-yz7bp
@MN-yz7bp 4 ай бұрын
Great teacher. This is the best explanation for newbies that I've seen.
@1littlecoder
@1littlecoder 4 ай бұрын
Glad it was helpful!
@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?
@icontentacademy
@icontentacademy Жыл бұрын
You always put out some of the best content out on KZbin. Thanks for sharing your knowledge of AI with the community!
@iangouvea9671
@iangouvea9671 7 ай бұрын
Nem todo Indiano, mas sempre um Indiano. Obrigado amigo, você é um amigo.
@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 :)
@JunboKoh
@JunboKoh Жыл бұрын
Great tutorial for ChatGPT api. I really enjoy watching for your kind and clear teaching:)
@1littlecoder
@1littlecoder Жыл бұрын
Thank you ver much!
@anshuman6623
@anshuman6623 7 ай бұрын
Great video! Covered all the points it sought out to cover. Thumbs up!
@neofuturist
@neofuturist Жыл бұрын
Commenting before even watching the video because I want to thank you for all your effort!!
@1littlecoder
@1littlecoder Жыл бұрын
Thank you too!
@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.
@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?
@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
@jurgenihlau4052
@jurgenihlau4052 3 ай бұрын
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!
@naveenkumar-ik8bx
@naveenkumar-ik8bx 8 күн бұрын
Very useful information. Thank you❤
@1littlecoder
@1littlecoder 8 күн бұрын
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.
@satishverma-c1c
@satishverma-c1c 14 күн бұрын
appreciate your efforts
@mariasueabiera8684
@mariasueabiera8684 8 ай бұрын
Awesome tutorial especially for beginners
@1littlecoder
@1littlecoder 8 ай бұрын
Glad it was helpful!
@rahasyabharat4894
@rahasyabharat4894 8 ай бұрын
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
@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.
@raidedcluster
@raidedcluster Жыл бұрын
Man I love your work. Thank you.
@1littlecoder
@1littlecoder Жыл бұрын
I really appreciate that :) Thanks for commenting!
@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
@ompathak3384
@ompathak3384 8 ай бұрын
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 11 ай бұрын
you have some credit to do your works, now you need to recharge.
@billythebiest_9404
@billythebiest_9404 8 ай бұрын
i have the same error but when i look into my openai account I still have credits.
@ujjwalsrivastava4581
@ujjwalsrivastava4581 6 ай бұрын
Same error guys if anyone got the solution please tell me
@lazycoder112
@lazycoder112 5 ай бұрын
If you still have credits prob because the request needs more credit then you have especially doing request with gpt 4
@ansar2137
@ansar2137 2 ай бұрын
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..
@markfrancisbeltran4619
@markfrancisbeltran4619 11 ай бұрын
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.
@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
@Analyse_US
@Analyse_US Жыл бұрын
Excellent tutorial as usual...super up to date content.
@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 ?
@jnealeuk
@jnealeuk Жыл бұрын
How easy/hard (!) is it to embed these chatbots into a website? Thank you for your work!!
@Leyverse
@Leyverse Жыл бұрын
Thank you so much, can you teach us how to integrate with whatsapp and telegram?
@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.
@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?
@SONUKOL1
@SONUKOL1 Жыл бұрын
Very knowledgeable content
@1littlecoder
@1littlecoder Жыл бұрын
Thank you
@Travestyalpha
@Travestyalpha Жыл бұрын
Thank you. Very clear explanation.
@1littlecoder
@1littlecoder Жыл бұрын
You are very welcome!
@sameerzahid3544
@sameerzahid3544 Жыл бұрын
Great work! Waiting for the tutorial about Gradio and ChatGPT.
@95249192
@95249192 Жыл бұрын
If possible, how to set up with gradio ?
@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?
@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?
@khushiagarwal7907
@khushiagarwal7907 Ай бұрын
uch a clear explanation!
@HelenJackson-pq4nm
@HelenJackson-pq4nm Жыл бұрын
Really clear explanation, thanks a lot
@highsobriety3491
@highsobriety3491 Жыл бұрын
Great teacher brother.
@CARLOSFROMNY
@CARLOSFROMNY Жыл бұрын
thanks for your contribution, you the best!!
@1littlecoder
@1littlecoder Жыл бұрын
My pleasure!
@MuhammadYasir-uc9xt
@MuhammadYasir-uc9xt 5 ай бұрын
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.
@pratyushbhatt1712
@pratyushbhatt1712 10 ай бұрын
How does the second method maintains the context like the first method was maintaining?
@outsidemix3626
@outsidemix3626 Жыл бұрын
Thank you! Incredibly detailed and clear.
@zappy9880
@zappy9880 Жыл бұрын
Isn't the API paid? I can't get it without entering card info. how'd you get it?
@lyricsdepicted5628
@lyricsdepicted5628 Жыл бұрын
Looks like for fine-tuning you can't make use of the 10x cheaper endpoint even though the model is the same.
@bhaidar
@bhaidar Жыл бұрын
Another question, where would you store the "messages" if you were doing a Web App?
@1littlecoder
@1littlecoder Жыл бұрын
Maybe a temporary json
@tyler8902
@tyler8902 Жыл бұрын
Fantastic tutorial!
@machinesmakemusic
@machinesmakemusic Жыл бұрын
Please make a video with method 1, but with more settings like temperature ! I would be so happy.
@roguephilosopher2465
@roguephilosopher2465 10 ай бұрын
Very helpful!
@1littlecoder
@1littlecoder 10 ай бұрын
Glad it was helpful!
@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 6 ай бұрын
​@@1littlecoderit is still not working please tell the solution
@maftar5
@maftar5 4 ай бұрын
How do you add context with the api endpoint?
@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.
@F.D.S
@F.D.S Жыл бұрын
Great!! Thank you!
@lyricsdepicted5628
@lyricsdepicted5628 Жыл бұрын
Now with control over temperature, you could repeat your hullicination querries with temperature of 0 and compare :)
@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 - kzbin.info/www/bejne/norGfIOwjc1nepo
@yogaday4835
@yogaday4835 Жыл бұрын
thanks for the tutorial !!!
@Damnedindenial
@Damnedindenial 2 ай бұрын
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 2 ай бұрын
In a normal IDE you need to use with your API key
@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.
@shreyashavaldar2076
@shreyashavaldar2076 7 ай бұрын
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.
@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 11 ай бұрын
It's not free; you have to pay
@alintambunaloko
@alintambunaloko Жыл бұрын
How to using the model in webApp like using flask
@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.
@rodo2220
@rodo2220 5 ай бұрын
great video
@dalisongwira1424
@dalisongwira1424 Жыл бұрын
wow you know how to explain
@1littlecoder
@1littlecoder Жыл бұрын
Thank you
@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():
@OrchidMacro
@OrchidMacro Жыл бұрын
That would be nice to add a functionality where you can insert a PDF.
@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?
@TimothyCarney-kk7kw
@TimothyCarney-kk7kw Жыл бұрын
Thanks!
@DjDiversant
@DjDiversant Жыл бұрын
Thank you!
@sambokhetwal
@sambokhetwal 8 ай бұрын
Can we link chat got api with facebook graph api?
@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 6 ай бұрын
my code doesn't work can you help me i copied your code but doesn’t work it
@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
@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?
@sharanbabu2001
@sharanbabu2001 Жыл бұрын
Cool!
@PANDURANG99
@PANDURANG99 9 ай бұрын
how to deploy for users?
@Aabdulnour01
@Aabdulnour01 2 ай бұрын
does this still work?
@jasvinderkumar430
@jasvinderkumar430 2 ай бұрын
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 2 ай бұрын
you need to make sure you have got the credits / money in your account, see the daily spend limit as well
@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
@TechTips_KishuNeelavara
@TechTips_KishuNeelavara Жыл бұрын
API key in freetrail is not working
@uvaisahmad2225
@uvaisahmad2225 2 ай бұрын
Authentication error: no api key provided🙂
@ninasirsi2340
@ninasirsi2340 8 ай бұрын
Where is next video
@tomtomfh3639
@tomtomfh3639 Жыл бұрын
yes
@theresilientpianist7114
@theresilientpianist7114 Жыл бұрын
Showing me rate limit error
@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
@jdcrunchman999
@jdcrunchman999 5 ай бұрын
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 9 ай бұрын
I've tried numerous times this code each n every thing, but still showing an error
How to integrate ChatGPT API with Google Docs - AI Content Writer
12:32
Gemini AI API with Python Latest Tutorial
4:30
United Top Tech
Рет қаралды 35 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 86 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 31 МЛН
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 81 МЛН
怎么能插队呢!#火影忍者 #佐助 #家庭
00:12
火影忍者一家
Рет қаралды 16 МЛН
The OpenAI (Python) API | Introduction & Example Code
23:46
Shaw Talebi
Рет қаралды 36 М.
How I Would Learn Python FAST in 2024 (if I could start over)
12:19
Thu Vu data analytics
Рет қаралды 434 М.
Build Anything With ChatGPT API, Here’s How
12:11
David Ondrej
Рет қаралды 88 М.
Create a LOCAL Python AI Chatbot In Minutes Using Ollama
13:17
Tech With Tim
Рет қаралды 81 М.
I Tried Every AI Coding Assistant
24:50
Conner Ardman
Рет қаралды 827 М.
I Didn’t Believe that AI is the Future of Coding. I Was Right.
6:55
Sabine Hossenfelder
Рет қаралды 442 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 86 МЛН