The ChatGPT API Beginners Guide

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

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

  • @warpdotdev
    @warpdotdev  11 หลายเดือนก่อน +4

    Let us know what you want us to build next! 👩‍💻

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

      Ok, the text variable also has to be valid only for the first step, otherwise it gets into a loop.

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

      Ok, I added i=1 ahead of the while loop, then in it an if i==1 then prompt = text, else prompt = input() - the rest is the same.

  • @CodingWithLewis
    @CodingWithLewis 11 หลายเดือนก่อน +4

    1:47 I took that personally 😢😢

  • @murtadha96
    @murtadha96 11 หลายเดือนก่อน +1

    I actually REALLY love Warp AI! I can't recall how many times I've forgotten a Git command or a way to do something and Warp was the easiest way to go

  • @thatguy658
    @thatguy658 6 หลายเดือนก่อน +1

    The latest OpenAI package has breaking changes:
    1)
    import openai
    # Should be:
    from openai import OpenAI
    2)
    openai.api_key = os.getenv("OPENAI_KEY")
    # Should be:
    client = OpenAI(api_key=os.getenv("OPENAI_KEY"))
    3)
    response = openai.ChatCompletion.create()
    # Should be:
    response = client.chat.completions.create()
    4)
    typer.echo(f'ChatGPT: {response["choices"][0]["message"]["content"]}')
    # Should be:
    typer.echo(response.choices[0].message.content)
    # I also had to add this import to fix a bug (for -t):
    from typing import Optional
    # And add this block so the -t text is used as first prompt:
    initial_prompt = text
    while True:
    if initial_prompt != None:
    prompt = initial_prompt
    initial_prompt = None
    else:
    prompt = input("You: ")
    P.S.
    I like your video editing style

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

      This helped me a TON! Thank you for posting. My only addendum would be a #5 that appears on the line just beneath the code you referenced in number 4. I changed the code to messages.append(response.choices[0].message) and the entire thing works perfectly now. Again, HUGE thanks for doing this!!

  • @mrjohn4711
    @mrjohn4711 12 ชั่วโมงที่ผ่านมา

    thx, just what kind of shell terminal is you using - like it?

  • @Tenkaklet
    @Tenkaklet 11 หลายเดือนก่อน +4

    I really enjoy your videos, but could your team consider slower and less "show casey" videos so one can follow? I really love the product you've created but always have a hard time following along. cheers!

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

    Interesting choice of using typer instead of langchain, any particular reason?

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

    can you make update with new verson ? :)

  • @WilliamDye-willdye
    @WilliamDye-willdye 11 หลายเดือนก่อน +1

    I want voice input, output, session recording, and a tie-in to an AI organizer such as Langchain.

    • @warpdotdev
      @warpdotdev  11 หลายเดือนก่อน +1

      We just did a video about that!

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

    If you get this error: "AssertionError: Could not get a command for this Typer instance"
    Passing a name to typer might fix it, like so:
    app = typer.Typer(name="OpenAI Chatbot")

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

    amazing woman!!!!!!!!

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

    cool video)

  • @steve-g5t
    @steve-g5t 10 หลายเดือนก่อน

    you guys should tweet this out too

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

      Good suggestion! twitter.com/warpdotdev/status/1715404831643533776

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

    4:51 is what I was looking for, how to print just the output. Thank you! This definitely was hard to figure out!
    However, I am getting errors when trying to run it: Traceback (most recent call last):
    File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in
    start(fakepyfile,mainpyfile)
    File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
    exec(open(mainpyfile).read(), __main__.__dict__)
    File "", line 20, in
    TypeError: 'ChatCompletionMessage' object is not subscriptable
    [Program finished]

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

    This is installed on Win11 or Linux?

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

    What is the name of the vs code theme?

  • @progamer-df3be
    @progamer-df3be 7 หลายเดือนก่อน

    Can it then be used offline?

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

    This video is assa

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

    Every time a dev uses a Mac a baby panda dies.

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

    👎Thumbs down. Not good. I wanted to like this but there are far too many errors, unexplained/uncovered jumps, etc.