Use OpenAI's ChatGPT in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

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

  • @IzUrBoiKK
    @IzUrBoiKK ปีที่แล้ว +32

    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!

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

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

  • @ricardo.alves.campos
    @ricardo.alves.campos ปีที่แล้ว +1

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

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

    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

  • @scotthjackson5651
    @scotthjackson5651 8 หลายเดือนก่อน +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

  • @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

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

    Your channel is so underrated!!!

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

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

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

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

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

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

    Thanks brother, true OG , watched many of your vids

  • @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

  • @bloodywolftr
    @bloodywolftr ปีที่แล้ว +4

    Thank you very much.Great content as always.

  • @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':"

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

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

  • @MuhammadYasir-uc9xt
    @MuhammadYasir-uc9xt 6 หลายเดือนก่อน

    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.

  • @gergohorvath2538
    @gergohorvath2538 ปีที่แล้ว +4

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

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

      and expensive

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

      What you suggest to use? Other technologies from another companies? Just curious

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

    Why not provide the code you have used?

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

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

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

    hey, does it need billing

  • @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?

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

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

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

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

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

    I'm waiting for it . Thx brother ❤❤

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

    Man, this video was awesome thank you!

  • @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

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

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

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

    Thanks - great demo 😀

  • @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()

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

    can you pass files to chatgpt this way?

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

    is not working anymore

  • @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

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

    Very nice.
    Thank you

  • @mikilmku1554
    @mikilmku1554 3 หลายเดือนก่อน +2

    This tutorial is deprecated

  • @TrinhVanTien-o1z
    @TrinhVanTien-o1z 10 หลายเดือนก่อน

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

  • @chooyanghwee3525
    @chooyanghwee3525 5 หลายเดือนก่อน +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

  • @FushigiMigi
    @FushigiMigi 5 หลายเดือนก่อน +4

    outdated now

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

    Love ❤

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

    Cool!

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

    🎉

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

    good video

  • @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 9 หลายเดือนก่อน

      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.

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

    Thx_.

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

    👍🙏👍🙏👍

  • @piotrmazgaj
    @piotrmazgaj 21 วันที่ผ่านมา

    As always I am one year late...

    • @NeuralNine
      @NeuralNine  18 วันที่ผ่านมา

      Better late than never!