ChatGPT API in Python - Complete Tutorial for Beginners

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

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

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

    🔥 Get my FREE ChatGPT Cheat Sheet: frankandrade.ck.page/08c94cf1c1

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

    Very helpful. Especially assistant rule to save history. This is the most needed feature. Many thanks

  • @anksmoney
    @anksmoney Год назад +9

    Such a great video, super clear explanations as well. Could you do a video on how to train gpt on custom data sets soon?

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

    I am new to this and was looking for tuts like this one to boost my confidence. Thanks

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

    Awesome video! The only video that explains what I was looking for! Thank you!

  • @chadconley9641
    @chadconley9641 Год назад +6

    Awesome tut. Thank you. Have you got any vids, or could you show us how to have chatGPT work from a provided context? For example, a repository of PDFs, like instruction manuals / procedures?

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

    I was looking for something like this for soo long......Dudde, you're awesome...... you explained it so clearly.. definitely gonna make something using this infor

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

    I'd be interested in a similar video to write a program that uses ChatGPT API to generate code and then execute it. Maybe generate unit tests or other validation to cross check it? Catch errors and then ask ChatGPT to debug its generated code?

  • @123arskas
    @123arskas Год назад +3

    Great content as always

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

    super clear explanations thank you ❤

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

    Does using assistant add to the amount of tokens used per interaction and response? Is it resending past messages to maintain context?
    Thank you for the video by the way. Very informative.

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

    Amzaing video! Thank you

  • @AP-hv5dh
    @AP-hv5dh Год назад +1

    Great work Frank! Thank you! Did you share the notebook somewhere ?

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

      Hi. I just added the link to my GitHub repo. Thanks for letting me know!

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

    Thanks for the insightful video, much appreciate. However, I have a question. Can we create a specific product ML using ChatGPT?

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

    How to make a chatbot that interacts with potential customers on my website? I am a solar consultant and want the chat to assess, qualify and occasionally close my customers.

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

      You can do this by fine tuning the model on your own custom data and build the bot.

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

      ​@@Xohrabcan you tell me how to do that?

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

    Great video! Like others, do you think you can create a video and/or write a Medium article on how to train GPT on custom data (documentation)? Love to learn more on this topic. Thanks in advance!

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

    Some changes are needed for this code to run properly as of 1-02-2024:
    The code below is modified one.
    ' ' '
    import os
    from openai import OpenAI
    client = OpenAI(api_key = "key")
    while True:
    content = input("User: ")
    messages.append({"role": "user", "content": content})
    completion = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=messages
    )
    chat_response = completion.choices[0].message.content
    print(f'ChatGPT: {chat_response}')
    messages.append({"role": "assistant", "content": chat_response})
    ' ' '

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

    Good stuff!!

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

    Hi. Does the 40messages/3hours limit apply in Python API?

  • @1mrnewton
    @1mrnewton Год назад

    This is great!

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

    I have a quick question, In the assistant mode, how can we create an assistant that we can come back and continue the chat later on? Can we write the responses in the file ? If I close the notebook i presume the assistant is gone?

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

    Awesome.. Keep it up.

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

    What's the most elegant solution to prevent the accumulated messages from eventually exceeding the max token limit in your final example?
    In my testing with the web version of chatgpt it seems like it "forgets" very old Assistant outputs before it forgets user inputs. I was able to ask chatGPT what was the first thing I asked and it was correct but it would make an educated guess as to what it said that far back. I was able to just scroll up and double check.

  • @thunder-v8h
    @thunder-v8h Год назад

    Can you compare the api and pro version in terms of value such as pricing, speed, etc? Thanks

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

    Wow! I'm very beginner to Python. I wonder if you could suggest if I could do this under my Telegram Bot? I tried some but I face errors. :/

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

    And thanks for this informative video!

  • @EdmondMalepane-n8q
    @EdmondMalepane-n8q Год назад

    since this is for chatgtp 3.5 can I do the same for chatgtp 4?

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

    Hi, recently I've created account with gpt4, however I didn't get any response, I got an error "You exceeded your current quota, please check your plan and billing details."

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

    can it remember previous chats/questions?

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

    A great video

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

    i used it 0 times and it said that i exceed my current quota

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

    I am getting error 429 - You exceeded your current quota, please check your plan and billing details

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

    What can actually be done with the ChatGPT API in Python?

  • @JuanCarlos-ff2rh
    @JuanCarlos-ff2rh Год назад

    I got an error=>module 'openai' has no attribute 'ChatCompletion'. Why?

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

      You are likely using an old version of openai try to uninstall then reinstall

  • @M.A.HProduction
    @M.A.HProduction Год назад

    How to install it?How to get Jupyter? ???

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

    is this whisper api?

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

      No this is gpt-3.5-turbo, it is different to whisper api

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

      What is difference between GPT-3.5-turbo and whisper?

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

    Is this api paid or free ?

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

    "messages=messages" is not good practice

  • @7elegrama
    @7elegrama Год назад

    i don't understand a thing :(

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

    good morning, great video. getting an error on the api key, it claims it doesnt exist...