How to use the OpenAI API in Python

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

КОМЕНТАРІ • 15

  • @masumasi
    @masumasi 5 місяців тому +1

    Nice! This is a cool example. Can you show us a small app that can transcribe audio files?

    • @KieCodes
      @KieCodes  5 місяців тому +2

      Thank you. I will put it on my list, but I also used the Whisper API for transcription in my Open AI Assistents video if you want to look into another example.

    • @masumasi
      @masumasi 5 місяців тому +1

      @@KieCodes Ah yes. I will check it out. Thanks!

  • @Rollie_1010
    @Rollie_1010 20 днів тому

    Hey man! I saw you replied to a comment made a few weeks ago so I have hope you'll answer this lol: when I type response = client.chat.completions.create( it gives me an error that says AttributeError: 'str' object has no attribute 'chat' No clue whats wrong. I've tried to find the answer everywhere!

    • @KieCodes
      @KieCodes  17 днів тому

      It means client is a string and not a client object as it is supposed to be.

  • @hsin-yusu9094
    @hsin-yusu9094 Місяць тому

    hi, I'm new, just have a little dumb question, what is "stream_to_file()" function doing here?
    is it used to reduce the waiting time of the audio response?

    • @KieCodes
      @KieCodes  Місяць тому +1

      Hey. There are no stupid questions. This is used to save the audio to a file to play it afterwards. The play function i use uses a file.

    • @hsin-yusu9094
      @hsin-yusu9094 Місяць тому

      @@KieCodes tysm, I'm a bit misunderstanding the official documentation.

  • @Liquidmsn64
    @Liquidmsn64 5 місяців тому

    When I type in the "response = client.chat.completions.create( model="gpt-3.5-turbo"," Its giving me a rate limit error. how can I get around this?

    • @KieCodes
      @KieCodes  5 місяців тому

      This happens if you are sending to many requests. Check your account on platform.openai.com there should be a list of all the rate limits you have and how much you have already used. There is also a way to ask openai to increase your rate limit.

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

    can anyone please guide me where can i explore the entire documentation in openai github? The readme file seems insufficient and incomplete or maybe i just find it difficult to follow.

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

      hey. you find the full documentation here: platform.openai.com/docs/api-reference/introduction
      On there you can switch the examples for all endpoints to python as well.

  • @heartbeatz34
    @heartbeatz34 5 місяців тому

    How to generate text to ai image using python

    • @KieCodes
      @KieCodes  5 місяців тому

      Hey. Thats the part of generating the image using dalle. What is your question?

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

    pretty average tutorial