How to use the ChatGPT API with Python!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มี.ค. 2023
  • Get notified of the free Python course on the home page at www.coursesfromnick.com
    Sign up for the Full Stack course here and use TH-cam50 to get 50% off:
    www.coursesfromnick.com/bundl...
    Code: github.com/nicknochnack/ChatG...
    Hopefully you enjoyed this video.
    💼 Find AWESOME ML Jobs: www.jobsfromnick.com
    Oh, and don't forget to connect with me!
    LinkedIn: bit.ly/324Epgo
    Facebook: bit.ly/3mB1sZD
    GitHub: bit.ly/3mDJllD
    Patreon: bit.ly/2OCn3UW
    Join the Discussion on Discord: bit.ly/3dQiZsV
    Happy coding!
    Nick
    P.s. Let me know how you go and drop a comment if you need a hand!
    #machinelearning #python #datascience
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @generichuman_
    @generichuman_ ปีที่แล้ว +139

    One thing that's nice to add is streaming, so that the words show up as they are being generated. This avoids the longer wait times for lengthy responses. Also, I've noticed that openai is still working out the kinks with their api's and some days you'll get a pretty high failure rate and have to retry a response. With streaming, you can set a reasonable timeout to try again ( usually if the first word hasn't arrived within 3 seconds, it's going to fail and hang indefinitely). If you don't have streaming, you have to wait as long as your longest possible response to retry which could be more than 10 seconds in some cases. Getting into the minutiae a little bit, but just some things I've discovered in my travels.

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

      Hi there! Can you tell me how to add streaming as you said above?!

    • @Ultimate-pb8hl
      @Ultimate-pb8hl ปีที่แล้ว +1

      does this include getting responses like "permissions denied"?

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

      Awesome!

  • @KSATica
    @KSATica ปีที่แล้ว +58

    ChatGPT has been AMAZING the experience for me was priceless

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

    You re a lifesaver, I’ll be using it for my school project thanks 🙌

  • @hiTocopter
    @hiTocopter 2 หลายเดือนก่อน +6

    What do you mean recently? The API has been available for years...

  • @n-0-1
    @n-0-1 ปีที่แล้ว +27

    I'm scraping all of the chat and teams log data from my company and training gpt with it. I will build a UI for my team members so that our private technical business questions that are asked frequently can be answered quickly.

    • @borntodoit8744
      @borntodoit8744 4 หลายเดือนก่อน +1

      I wish you would add more data..
      how u implemented
      usecase: training using private data for private AI requires an instance of a model
      workflow: prompt + private data >chatbot >model (GPT LLM) >completion
      unless u have a local instance of model (GPT LLM) then your data is still going to the internet (to OpenAi 's GPT instance)...
      feb2024: your post is 10 months old (2023) I don't think running local model instances (llama, Gemini, GPT) were available to download & install locally

  • @Fghhhg8883
    @Fghhhg8883 ปีที่แล้ว +69

    Thank's for letting us know that openAI have released API for chatGPT. I wonder how many of my students already have a account

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

      Anytime @Yrgen! Got some plans to do more content around it!

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

      Turnitin will catch the content generated by AI.

  • @eliedabelly3804
    @eliedabelly3804 ปีที่แล้ว +13

    I love how these videos - so short and direct it makes it so much simpler to follow thank you 🙏

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

      Is called dumbing it down for the masses.
      everyone thinks they are an expert till they hit a basic problem...

  • @Eric-demonic_saint
    @Eric-demonic_saint ปีที่แล้ว +1

    Awesome 😎 Thank you for sharing with us❤

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

    Thank's for that. Can you make a video on explainability in ML models, I want to know why and how the models work.

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

      You got it!

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

      Can you make a video on explainability in ML models such as visualisation techniques in CNN and more

  • @ozgurgulerx
    @ozgurgulerx ปีที่แล้ว +10

    Hey Nicolas, enjoying your content! You are an inspiration! Just curious which final cut effect plugins you use? They make videos quiet enjoyable.

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

      No plugins anymore, I do all the special effects in Adobe After Effects. Occasionally I use DeepGlow but all the custom stuff you see here is from AE

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

    Damn 😅 Gotta work out better placement for the keyboard cam.

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

      Also, lmk if any of you are coming to the forum I mentioned on LinkedIn! Would love to grab coffee with y'all!!

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

      i dont get the .ChatCompletion method
      i get .completion

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

    I’ve been doing a lot of cool stuff with the API. It’s incredibly easy to implement and find new ways to work with other libraries

    • @BigBoss-sm9xj
      @BigBoss-sm9xj ปีที่แล้ว

      Do you think it's worth the price?

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

      @@BigBoss-sm9xj a better question to ask, does it pay for itself and the answer is yes.

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

    Can you share how to get just the output, and not the rest of the object?

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

    how much the pricing?

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

    Nice, thanks.

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

    Any full screen video for this please... Or any other source for this...

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

    How does the results compaire to use gui connected to API or using the web app or in browser

  • @big_bits
    @big_bits ปีที่แล้ว +7

    How does this work with continuity between messages?

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

      You need to store it, you can store it temporarily in a list and that way you can maintain continuity

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

    Thanks mate 🤍

  • @MG-ih6po
    @MG-ih6po ปีที่แล้ว

    for the content, to make it more dynamic, have the user supply the prompt as a command line argument.

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

      is a programmatic example to show the open api
      not to show a scripting example for other usecases

  • @user-ll3xd5dy3f
    @user-ll3xd5dy3f 8 หลายเดือนก่อน

    What dependencies do I have to install before running this code?

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

    Hey nic can you do a stock market (of your choice) data analysis

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

    So I've made a tkinter app that had a prompt box and returns in a canvas with a save as need to clean it up need to learn to style more

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

    What is the benefit of using this instead of the default chat gpt webiste?

  • @izaanmohammed3589
    @izaanmohammed3589 7 หลายเดือนก่อน +1

    Do we need a chatgpt acount

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

    How many such requests can be made? Is there some limits in your plus subscription?

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

    It's using GPT3.5 turbo, how do you use GPT4 instead?

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

    what is the purpose of asking chatgpt questions in vscode

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

    Nice vlog ❣️Kannayya while seeing in mobile be like Enti nenu intha cute ga vunna 😊😅

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

    I'd like to see a simple example with PHP. I tried a month ago it never worked

  • @jenniarlet13
    @jenniarlet13 6 หลายเดือนก่อน +2

    How can I feed it data to build a custom trained model ?

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

      That's a good question!

  • @ahmedmeftah731
    @ahmedmeftah731 ปีที่แล้ว +11

    you can litterly make an ai app that just runs chatgpt

    • @ahmedmeftah731
      @ahmedmeftah731 9 หลายเดือนก่อน +1

      @noobody. no no, I mean an interface that works via ChatGPT-API

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

    is this script working without openai api key?

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

    Would have to pay tho?

  • @JassyMon-wn4eh
    @JassyMon-wn4eh 5 หลายเดือนก่อน

    Can you pls do the same for llama 2

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

    Wait, I think this is actually pretty useful... * looks at Alexa echo dot * hehehehehe

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

      For those who didn't get it, I want to try to make an Alexa skill which let's you communicate with chat gpt through Alexa

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

    Is there a way to use ChatGPT 4 on this?

  • @manav-khadka
    @manav-khadka ปีที่แล้ว

    hey nicholas please made video on kaggle

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

    Can I make chatgpt helps me in prediction and classification with me model and links it with opencv
    I mean can I let the mission for chatgpt

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

    Awesome ❤👍💪👏😄

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

    I am trying to install openai to my file in visual studio code but its not working what do i do

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

    Is it free to use open ai APIs?

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

    Website or app name??

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

    How about image detection for onscreen images and algo? 😅😂

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

    AWESOME

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

      Cheers Omar!

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

      Bro! I wanna learn Reinforcement Learning, are your old videos still working? I heard that the libraries changed and the code doesn’t work from the comments.

  • @miname.1802
    @miname.1802 ปีที่แล้ว +2

    this scares me a lot Nick

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

    Will it give me the gpt4 answers?

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

    This good content

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

    Nice one Nicholas. One question, there's the same max characters in the output as in the web version? In this format of video seems longer.

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

      What's the limit in the web version? It generated a whole page for me this morning!

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

      @@NicholasRenotte It was like 4k characters. But I guess that now with the paid version it depends of the budget :')

    • @ko-Daegu
      @ko-Daegu ปีที่แล้ว +1

      That’s has to do with the mode 4k token is the gpt4 limit (I heard they will release a 32k token limit )

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

    chatgpt helped me try random generation of api keys until it works and now i have free chatgpt

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

      LOL fr?

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

      @@NicholasRenotte Yea it tries many combinations over and over everytime it returns an error, sometimes it works, sometimes it doesn't. So sorry for whoevers api key was used

  • @josejose-je6xu
    @josejose-je6xu 7 หลายเดือนก่อน

    Cool man

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

    Public API?

  • @Маркос_кокос
    @Маркос_кокос 9 หลายเดือนก่อน +1

    barack obama?!

  • @CoBER-nc3el
    @CoBER-nc3el ปีที่แล้ว

    Hi there. Is it possible you could tell me if paying for the api key gives faster response times... for chatgpt api? Would appreciate your response.

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

      I think you cannot use this without paying, not sure tho

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

    Can we use this to create chatbot? I am a noob to this field. Please answer anyone... 😊

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

    Can you make videos about fine tunning, and semantic search using gpt?🥺

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

    hey Nick, I’ve been trying to build a chatbot using the official API but the engine don’t have memory. Is there a way to have such thing with the official api? Right now i m using the un official chatgpt wrapper but I need to login every time

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

      Hmmm not too sure where the memory issue is? On ChatGPTs side or for your app? I'm doing a walkthrough of how to integrate it into Watson Assistant today. Started working on the Openapi spec yesterday. Should be out soon, I've been getting a ton of questions on it.

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

      @@NicholasRenotte Like: you can use the engine to generate answers as you showed but you can't generate a conversation instance through the API. Or can you? Looking foward for the video!

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

    Nice

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

    Eerie how time and time again that we align our projects lmfao

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

      I posted on LinkedIn about an integration I built with it. I am getting slammmed with work now 😂

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

    hey, im continuously getting this error
    openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details
    even though its a brand new key and i used the old key way back in feb
    can someone please help, thanks :D

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

    it says no moduled name openai

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

    Why would I do this over using the playground

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

    ChatCompletion line is not working properly

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

    Hello. I installed that module but apikey methods not included. This way of codes gives me error. ModuleNotFoundError: No module named 'apikey'
    Do you have any suggestion?

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

      It's a local module he created himself to store his APIKEY I believe.

  • @nikosnikos-fk6ct
    @nikosnikos-fk6ct 11 หลายเดือนก่อน

    were is the dicreption

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

    Do we need to generate a key from the open Ai website?

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

    where's code

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

    I need help

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

    Ты не пробовал из какой нибудь локальной модели которая полностью доступна в общем доступе, сделать чат?

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

      Not yet most of the stuff has been with paid APIs unfortunately. Closest was probably the live stream I did with BLOOM.

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

      @@NicholasRenotte Sorry, I'm from Russia and I meant this. Would you like to use a public local model to create a dialog neural network similar to GPTchat. Are you planning this??

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

    only 5-6 month ago.. it was that recently🤔🤓

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

    it says You exceeded your current quota, please check your plan and billing details
    you are so lucky you got it for free man

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

    BOOOM

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

    Is the API free?

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

    hello me to developer and ı have an question; what is gpt-4 engine name

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

      please help me

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

    Why not just use chatgpt promptline?

  • @HafsaHareem-in4vu
    @HafsaHareem-in4vu ปีที่แล้ว

    Is there any method to take user input as message?

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

      U can create a tkinter and use an Entry

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

      Yeah easily so put this content: input("What is your proompt?")

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

    would you need internet connection before it generates the output or it does it like that

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

    0:00

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

    Bro how to buy api keys in open ai

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

      You can get the free credit and can generate one without buying

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

    "Cannot import name APIKEY from apikey"
    O________O
    I did pip install apikey and it went through, but the code still doesn't run. What gives?

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

    Not working

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

    Is there anyway to get an api for free use for learning ?

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

    There will be a leck of programming job's in the future better start with electrical engineering.

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

      That'll be affected as well, not that much further from programming jobs

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

    You don’t

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

    How to get API key ?

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

    I'm keep getting error that api is invalid or exhausted quota... Is it paid?

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

      It used to be free but it's paid now

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

      @@tusharrao74 that's sad, you know any api / model / lib to make a simple chat bot

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

      I had the same issue. Bit of a bummer it's no longer free.

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

    is this Api is free

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

    Is this the pay to use API?

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

    I would rather use ChatGPT to ask it how to use ChatpGPT APIs 🤭

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

      Sure buddy, if you want the less advanced text-davinci-002 model

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

    This man have Something wrong in his Neck 😢😢😢😢😅

  • @nikosnikos-fk6ct
    @nikosnikos-fk6ct 11 หลายเดือนก่อน

    how to make Minecraft in python import Minecraft run yay

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

    Is this really chat gpt, or is this gpt? Big difference. The one is a fixed price monthly, the other costs credits. Its misleading if its gpt and not chatgpt

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

    Is this free?

  • @aniakaleta101
    @aniakaleta101 9 หลายเดือนก่อน +1

    does this guy get on your nerves or is it just me

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

      nah, gets on my nerves as well

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

    Nowadays they need computers to say absolutely nothing?🤯

  • @lifewithG-bengs
    @lifewithG-bengs ปีที่แล้ว +1

    Is it free or paid?

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

      This one is paid @Ogunkoya! It seems pretty reasonable though $2 per million words.

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

      @@NicholasRenotte how do I start this? And where can I get an API key?

  • @TLM-Nathan
    @TLM-Nathan 10 หลายเดือนก่อน

    I fail to see how this is anything other than pointless. Why waste time writing all that code when you could just go to chatgpt and ask there?
    Can we maybe get a practical use for this?

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

      wtf. This can be used to automatize a lot of processes.

  • @Eddie-gb3bn
    @Eddie-gb3bn 4 หลายเดือนก่อน

    What’s the point of this, why not just use the GUI?

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

    Dont know anything about it

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

    This is not a ChatGPT