Use OpenAI's ChatGPT in Python

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ •

  • @IzUrBoiKK
    @IzUrBoiKK Рік тому +33

    2 years ago, i started learning python through your channel... Now i was searching for tutorials of chatgpt api with but was finding it hard to follow anyone. But is was really easy ans nostalgic for me because of your video. Good luck bro!

  • @veroverobrian
    @veroverobrian Рік тому +6

    Coming as a C/C++/Java dev, learning Python from you is super helpful. I recognize every modality of my known languages, and seeing it in Python is just so nice to learn alongside. Many thanks!

  • @benjialexander5850
    @benjialexander5850 Рік тому +2

    Imagine creating code with chatgpt integrated in the program that could check and trouble shout problems with code that you asked it to create for more refined and better performance, what if it could even come up with program ideas to fix a problem then develop it and even install it onto sum thing like a raspberry pie???? this is an exiting age indeed

  • @aduesh5120
    @aduesh5120 Рік тому +1

    hello pls reply. how do i give the bot a personality like for example i want it to talk like sherlock holmes

  • @tahlmilburn3565
    @tahlmilburn3565 Рік тому +5

    Love your videos. Btw, strip() also remove
    chars so you don't need a separate step.

  • @jesusparacare6654
    @jesusparacare6654 Місяць тому

    Great video, any advice on how to test on an azure openai client, basically your api?

  • @BLACKDREAMIO
    @BLACKDREAMIO Рік тому +2

    what the f i didnt even use the api before its on new gmail account it says i hae exceeded the limit of useasge

  • @rrahll
    @rrahll Рік тому +1

    100 like is mine) thanks man for the helpful video.

  • @ricardo.alves.campos
    @ricardo.alves.campos Рік тому +1

    Short, easy and well explained, congratulations for this video.

  • @MuhammadYasir-uc9xt
    @MuhammadYasir-uc9xt 7 місяців тому

    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.

  • @vyeln
    @vyeln 6 місяців тому

    hey, does it need billing

  • @akhiluniyal9455
    @akhiluniyal9455 Рік тому

    Do we have to subscribe to chat gpt plus ,to access gpt turbo 3.5?

  • @scotthjackson5651
    @scotthjackson5651 9 місяців тому +1

    the code in this video doesn't work with the new version of the python openai library :( the new version changed basically everything shown in this video

  • @giacomoferrari5624
    @giacomoferrari5624 Рік тому

    Thanks brother, true OG , watched many of your vids

  • @BrentonRhysStudio
    @BrentonRhysStudio 3 місяці тому

    Can someone pelase tell me how he has python in that preview? I can only use python in cmd prompt at the moment :(

  • @sahilsagwekar
    @sahilsagwekar Рік тому

    Your channel is so underrated!!!

  • @ajimustapha7943
    @ajimustapha7943 8 місяців тому

    can you pass files to chatgpt this way?

  • @VerticalBase
    @VerticalBase Рік тому +1

    How do I create a chatGPT chatbot with python tkinter?

    • @KubaGacek-oy8uw
      @KubaGacek-oy8uw 10 місяців тому

      gotch YA :
      from openai import OpenAI
      from tkinter import *
      root = Tk()
      root.title("Chat GPT")
      def get_response():
      user_input = message_entry.get()
      API_KEY = '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'
      client = OpenAI(api_key=API_KEY)
      response = client.chat.completions.create(
      model="gpt-3.5-turbo",
      messages=[
      {"role": "user", "content": user_input},
      ]
      )
      text_content = response.choices[0].message.content
      chat_history.insert(END, "
      User: " + user_input)
      chat_history.insert(END, "
      Chat GPT: " + text_content)
      message_entry.delete(0, END)
      chat_history = Text(root)
      chat_history.pack()
      message_entry = Entry(root,width=50)
      message_entry.pack()
      send_button = Button(root, text="Ask", command=get_response, bg="blue", fg="white")
      send_button.pack()
      root.mainloop()

  • @bloodywolftr
    @bloodywolftr Рік тому +4

    Thank you very much.Great content as always.

  • @bill123f2
    @bill123f2 Рік тому

    In my terminal it says that the api key is not in any directory

  • @gergohorvath2538
    @gergohorvath2538 Рік тому +4

    As this example shows It’s too slow to use it for e.g. speech to text conversion

  • @farzinkhaledi4394
    @farzinkhaledi4394 Рік тому +2

    What do you think of the future of the Ai? Do you think it will take over the programmes world or not?
    And is it worth spending time to learn coding ?

    • @Brukrex
      @Brukrex Рік тому +4

      Nobody knows just learn

    • @AK-zz9ok
      @AK-zz9ok Рік тому +1

      The world of programming will definitely undergo significant changes due to AI, but I believe it's still definitely worth learning how to code. After all, we still need people to build the AIs.

  • @snehitvaddi
    @snehitvaddi Рік тому +1

    Why not provide the code you have used?

  • @dmk_weaver
    @dmk_weaver Рік тому +5

    Thanks! I always receive the error message that I exceeded my current quota. I'm sure I didn't. I have just created a new key and have not asked any questions since. Is anybody also experiencing this issue?

    • @julianhank1267
      @julianhank1267 Рік тому

      yes i am also only receiving this message. It has been 3 months since your comment. Did you find a solution?

  • @sushantpawar3703
    @sushantpawar3703 Рік тому +1

    Informational video as usaul. What is name of intro music?

  • @ishratalikhan1231
    @ishratalikhan1231 Рік тому

    Very nice Demo, I wanted to optimize oracle query, could you please suggest some good ideas to do so.

  • @mohammadaqdas7998
    @mohammadaqdas7998 Рік тому +1

    I got an error says that " module 'openai' has no attribute 'ChatCompletion' " Someone please help me!!!!!

    • @JAGuy
      @JAGuy Рік тому

      Did you solve it?

    • @mohammadaqdas7998
      @mohammadaqdas7998 Рік тому +1

      @@JAGuy yes, the problem was i have the old python version, this library requires the latest one.

    • @JAGuy
      @JAGuy Рік тому

      @@mohammadaqdas7998 how exactly do you check to make sure you have the newest version I updated pycharm but I still see the error

  • @D4narchy
    @D4narchy Рік тому

    You can remove a few lines of code for the final example with the walrus operator (i love it): "while (user_message := input()) != 'quit':"

  • @farabihbk
    @farabihbk Рік тому

    I'm waiting for it . Thx brother ❤❤

  • @WondrousHello
    @WondrousHello Рік тому +1

    If you’re providing the entire chat log as context when having a conversation, will all previous messages count towards token usage? Just thinking that every new message becomes increasingly expensive.

    • @bluekeybo
      @bluekeybo Рік тому

      From their website: "Prices are per 1,000 tokens. You can think of tokens as pieces of words, where 1,000 tokens is about 750 words."
      Yes, if you send the history, that counts towards your tokens.

    • @midprogramming
      @midprogramming Рік тому +1

      That's correct. Finding a way to summarize the conversation and passing that in for substituting memory is probably going to be your best bet

  • @MateusMeurer
    @MateusMeurer Рік тому

    Man, this video was awesome thank you!

  • @paulthomas1052
    @paulthomas1052 Рік тому

    Thanks - great demo 😀

  • @mtmanalyst
    @mtmanalyst Рік тому

    Very nice.
    Thank you

  • @TrinhVanTien-o1z
    @TrinhVanTien-o1z 11 місяців тому

    tôi mún đc hướng dẫn file API_KEY tại tôi ko add đc

  • @angelus806
    @angelus806 Рік тому +1

    is not working anymore

  • @chooyanghwee3525
    @chooyanghwee3525 6 місяців тому +1

    Bro mogged me at the start

  • @satishchekuri7664
    @satishchekuri7664 Рік тому

    response['choices'][0]['message']['content'] --please explain this line

    • @jananirajendran1571
      @jananirajendran1571 Рік тому

      {
      "choices": [
      {
      "finish_reason": "stop",
      "index": 0,
      "message": {
      "content": "The 2020 World Series was played in Texas at Globe Life Field in Arlington.",
      "role": "assistant"
      }
      }
      ],
      "created": 1677664795,
      "id": "chatcmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW",
      "model": "gpt-3.5-turbo-0613",
      "object": "chat.completion",
      "usage": {
      "completion_tokens": 17,
      "prompt_tokens": 57,
      "total_tokens": 74
      }
      }
      This is the structure of the response

  • @YogeshKumar-kr1ke
    @YogeshKumar-kr1ke Рік тому

    THANK YOU SOOOOOOOO MUCH

  • @chaselsantos
    @chaselsantos Рік тому

    good video thank you

  • @IronSnipEdits
    @IronSnipEdits 11 місяців тому

    Love ❤

  • @mikilmku1554
    @mikilmku1554 4 місяці тому +2

    This tutorial is deprecated

  • @kernelpanic2927
    @kernelpanic2927 Рік тому

    Cool!

  • @fangaohua
    @fangaohua Рік тому

    good video

  • @FushigiMigi
    @FushigiMigi 5 місяців тому +4

    outdated now

  • @Hazza0001
    @Hazza0001 Рік тому +1

    🎉

  • @piotrmazgaj
    @piotrmazgaj Місяць тому

    As always I am one year late...

  • @eviehartman2895
    @eviehartman2895 Рік тому +1

    New to Python here: Am I the only one who's bothered by the fact that "response" is spelled "respone" in this video? Is that actually how it's supposed to be spelled?

    • @MichaelShingo
      @MichaelShingo Рік тому

      lol you can call it whatever you want, he mispelled it

    • @Imenigmars
      @Imenigmars 10 місяців тому

      He did spell it wrong, but it doesn't matter because he spelled it the same way when he used it again in the print line. If he had spelled it "repone = blah blah", and then done print(response), he would have gotten an error.

  • @ventiladorbueno1846
    @ventiladorbueno1846 Рік тому

    👍🙏👍🙏👍

  • @philtoa334
    @philtoa334 Рік тому

    Thx_.