OpenAI Assistant API Tutorial With Code Examples

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

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

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

    This was probably one of the BEST explanations on OpenAI Assistant API.

  • @nathankasa6220
    @nathankasa6220 Год назад +8

    I never really comment on videos but just wanted to say you do a great job at explaining things and keeping it stupid simple. On top of that the extra time put into the editing to make it visually easier to comprehend. And the source file included in the description. 🙌

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

      Hey Nathan! Thank you so much for saying that! I really appreciate it because I've been putting a lot of work into these videos.
      I have a lot more content coming out for you guys!

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

      I can tell! This is the type of content I was thinking to make if nobody else did because it’s always content consisting of code heavy videos without real life examples or anything actually done in the whole video.
      Sometimes it’s like “what could’ve been done better” if views don’t blow up. But trust, this video was perfect. I think I followed a little while ago based off one of your other videos, probably because you explain things well. And now this one popped up on my feed when I opened the app.
      Keep at it 🙌

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

    BANGIN'!

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

      Thank you so much! I really appreciate the donation! This made my day! If you have any other recommendations for future videos you’d like to see, I’d love to hear them!

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

    Really cool video. Kudos for building a UI to visualise the process. People underestimate the amount of work that goes into videos like this.
    Keep it up bud.

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

      Thanks Leon! and so true! I have a small team helping me out to make it more manageable.
      I have some more videos coming out for you guys soon!

  • @dhrubajyotirakshit
    @dhrubajyotirakshit 11 месяцев назад +1

    Dude..Of all the AI videos that I have read till now, this one is probably one of the best. I know it is focused on Assistance, and u killed it. So, straight forward and well explained...

    • @bhancock_ai
      @bhancock_ai  11 месяцев назад

      Thank you so much Dhrubajyoti! I really appreciate that!

    • @dhrubajyotirakshit
      @dhrubajyotirakshit 11 месяцев назад

      @@bhancock_ai Now you have got a responsibility to create the video on Function calling and other tools...Waiting Waiting....

  • @rccnw
    @rccnw 11 месяцев назад

    I love how fast the narration is. I often bump up playback speed in settings. No need this time :) great tutorial, thanks.

  • @macsinvan
    @macsinvan 4 месяца назад +1

    Congratulations, what a creative way to demo the capabilities

  • @ZRowton
    @ZRowton 7 месяцев назад +3

    phenomenal guide. absolutely one of the best explanations ive found.

  • @MuhammadAmir-fj8yu
    @MuhammadAmir-fj8yu 2 месяца назад

    Short, precise, and to-the-point video. Thanks!

  • @krasisl
    @krasisl 7 месяцев назад +9

    You didn't cover the most important topic : "function calling"

  • @gabriel.jansen
    @gabriel.jansen 2 месяца назад

    Thank you very much Brandon, thanks to your video I was able to implement it in the language I work with (ASP Classic)

  • @thekiddace2620
    @thekiddace2620 5 месяцев назад +1

    Subbed. I needed this. You did great at explaining it in simple terms and the visual UI to go along was the icing on the cake! Can you cover the differences with the v2 Assistant API if you havent done that yet?

    • @bhancock_ai
      @bhancock_ai  5 месяцев назад +1

      It's on the todo list! I think I will be able to get to this in early september!

    • @thekiddace2620
      @thekiddace2620 5 месяцев назад

      @@bhancock_ai Dope! Can't wait

  • @omgasmurf111
    @omgasmurf111 7 месяцев назад +2

    Very neat, I would love to see you use functions with the assistants as well tho! 👍

  • @sahilkhan-dt2ln
    @sahilkhan-dt2ln 5 месяцев назад

    Amazing, did amazing job. Best video. Keep shining

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

    Great explantion. Thanks a bunch. I've tried to get the source code by filling in the form with my first name and e-mail address but have had no luck in getting access. I am in Portugal; may that be an issue?

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

      Hey Pedro! I just checked out ConvertKit and it says the the email was delivered to you at 1:06 PM EST. Maybe it’s in your spam or something? If not, shoot me a DM on X @bhancock_ai and I can shoot you the links manually!

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

    AMAZING WAY OF EXPLAIN IT! THANK YOU VERY MUCH!

  • @jeansebastiencormier6008
    @jeansebastiencormier6008 6 месяцев назад +1

    Great video. Nicely explained. Thanks

  • @pequod4557
    @pequod4557 3 месяца назад

    Will passing threads drain my openAI creds faster since it would be using more tokens as the conversation grows? Or does it truncate up to a certain depth?

  • @fonseca_ygor
    @fonseca_ygor 2 месяца назад

    To use the same assistant for multiple clients, should I attach and detach the custom client files for each thread? Ou should a create an assistant for it client, even if they will be the same?

  • @omarhabash8355
    @omarhabash8355 22 дня назад

    How do you handle polling for run completion? also - good work

  • @osaman.abuomar5811
    @osaman.abuomar5811 5 месяцев назад +1

    Thanks for this awesome explanation

  • @devikamujgule6888
    @devikamujgule6888 6 месяцев назад

    this super great! would you also make one with streaming options

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

    I also found out that it's necessary to have credits to use GPT-4, because when I clicked the 'create' button, it did nothing, and it only started working after I added credits to my account.

  • @maxidigital
    @maxidigital 11 месяцев назад +1

    Excellent explanation

  • @osagiezogie
    @osagiezogie 8 месяцев назад

    This is an awesome tutorial!! Thanks so much.

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

    Can you make a new one for the one that was recently released with Vector Storage?

  • @prestigelock
    @prestigelock Час назад

    I keep getting this error. OpenAIError: The OPENAI_API_KEY environment variable is missing or empty; either provide it or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }). Can you please let me know where you store the API key. I have an .env file in the root folder, OPENAI_API_KEY=sk-xxxxxx and identical file in the ap folder. This is on a windows PC with VS Code.

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

    Thanks alot indeed for the video! I am eagerly waiting for the new videos you kindly promised

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

      Thanks! I've had to take a quick break but I will start churning out more videos this week! Anything in particular that you'd like to see more of?

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

    great video - one think I was hoping to find out though was more info around actions. The custom GPT actions seem a lot more intuitive with supplying a path and auth token. The assistant actions seem a bit more confusing and less documentation and discussion around them. Info or a video about those would be amamazing. I think a lot of people are making custom gpts and then find out out you cant call those through the API.

  • @jaskaransingh4704
    @jaskaransingh4704 6 месяцев назад

    Best open ai api explaination video

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

    Thank you, Brandon!!!! This information is priceless!!!!! I could not find where the website that you created is located, was that something there was a link for?

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

      Thank you 😁 and the source code link in the description will direct you to the code for the website. Please let me know if you have any other issues!

  • @imcarto
    @imcarto 8 месяцев назад

    This is super clear, thankyou so much!

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

    Im trying to do this for my expressJs server, when I create the createRun function, it's saying thread_Id not found, is it supposed to be stored somewhere? I am making API calls to each function and passing it via an API client like insomnia but I cannot find the thread_Id anywhere.

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

    Hey Brandon .. Thanks for this. I entered my info but didn't receive the source? Is the source to the tool you were using. It looks like the perfect tool for me as I'm not a coder, but have created a very sophisticated assistant and now want to create a chatbot to us it. Hope you're tool will help. Let me know how to get it, or re-enter my info. thx

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

      Hey Mike! When you head over to my website brandonhancock.io/ you should be able to enter in your email address and then it will automatically send you an email with links to the source code. If it is still giving you trouble, please shoot me a DM!

  • @drewsky-oz
    @drewsky-oz Год назад +1

    Brandon, you are so helpful and clear. Thank you. Quick question: using the Tesla example you shared, can the assistant respond utilising both the file and the openai LLM as source mixing content for the response?

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

      Great questions! So all you have to do is adjust the instructions you provide to the assistant and instruct it to provide a hybrid response, 50% from the file & 50% from general knowledge within the LLM. Please let me know if you have any other questions! Happy to help!

  • @sameershahbaz1707
    @sameershahbaz1707 25 дней назад

    can i do this in .net core API?

  • @forhappy4286
    @forhappy4286 8 месяцев назад

    Hi where is the homepage link?

  • @ollieq5259
    @ollieq5259 11 месяцев назад +1

    If I'm coding an app with multiple different users who can all individually interact with this bot (which has the same instruction for each user), would I use an assistant per user, or the same "master" assistant for all users?

    • @bhancock_ai
      @bhancock_ai  11 месяцев назад

      Great question! You would have one master assistant. However, you would create an individual thread for each user. If you want to see this in action, I definitely recommend checking out this full stack tutorial I released a few weeks ago!
      ruclips.net/video/b1S04PFjIOY/видео.html
      Hope that helps!

    • @ollieq5259
      @ollieq5259 11 месяцев назад

      @@bhancock_ai With this architecture is it possible to have multiple threads per user, whereby each subsequent thread is aware of the context of all previous threads (for that user)? Basically I'm thinking of an app where a user can individually talk to the AI robot (master assistant), but has a chat log per day.
      Intuitively this means a thread per day, but when a user starts a new chat for a new day (and so a new thread is created), the AI robot they're talking to has to be aware of all previous messages sent on previous days in the other threads? Is this possible?
      So basically what I'm asking is, is it possible to create a new thread with an assistant, whereby the assistant responding in this new thread is responding based off context from a set of other previous threads?

  • @SJT-jb9gz
    @SJT-jb9gz Год назад

    great video, Thanks Brandon. Just one question: we passed user entered question to message object, and triggered a Run with assistant_id and thread_id. If this Rum was completed, how do I get assistant's response? Is there any code like this: response.choices[0].message.content ?

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

      Great question! You actually have to go back and refetch the thread once the run completes successfully.
      It would be nice if the run had that final generated message for us but they OpenAI is more focused on separating out the logic to make it super scalable for us.
      I hope that helps! Let me know if you have any other questions!

    • @SJT-jb9gz
      @SJT-jb9gz 11 месяцев назад

      @@bhancock_ai Thanks mate. I have worked out the solution, see sample code below:
      run = openai.beta.threads.runs.retrieve(
      thread_id = threadID,
      run_id = runID
      )

      thread_messages = openai.beta.threads.messages.list(threadID)
      for msg in thread_messages.data:
      return JsonResponse({"message": msg.content[0].text.value})

  • @loCal-sh2if
    @loCal-sh2if 9 месяцев назад

    I don't understand...I cannot seem to Assistant File "List" or "create" with your project. it uploads because I can see it in the "Storage" section of platform openai. For whatever reason I keep getting Error creating assistant file: TypeError: Cannot read properties of undefined (reading 'id')

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

      There has been update to assistant API lately. Check if your Open one has v2

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

    PYTHON...any comments regarding doing this on Python? I mean I know I can do the translation from Node JS ...

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

      Great question! The reason I'm not the biggest fan of doing web projects in Python is because they are more difficult to deploy for others to use.
      For example, if you make a NextJS project like I did in the tutorial, you can easily deploy the project to Vercel so that thousands of people can use your project instantly.
      Please let me know if you have any other questions! Happy to help!

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

    love you Brandon 💕 w8ing for uR next videos . I am interested to learn Ai so I think you are best option for me

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

      Thanks Mr umer! I have a lot more videos coming out soon!

  • @sonny5497
    @sonny5497 8 месяцев назад

    thanks! this was very helpful

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

    thanks for sharing great knowledge sir, can we have a video about new OpenAI assistant api implementation using php

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

      I'm not really a PHP guy but I think ChatGPT 4 could help you convert the code in the video into PHP code for you!

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

    Thanks a lot, this is amazing

  • @DamCipolat
    @DamCipolat 11 месяцев назад

    Excelent!" greath video thanks for sharing

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

    Thank you. You are my hero

  • @owaisjavaid8110
    @owaisjavaid8110 11 месяцев назад

    Well, having said that i don't have any prior knowledge of how does this new open ai (API) world is connects, works, I can say now I have an idea in some case after watching this.
    So, Can you create one more video which can explain a unit and average cost to perform all of these functions?, take any business that needs this assistant and they want to implement this, but they don't have any ideas of how does the pricing model works, and if they do so, they maybe don't know how to optimized it.
    It will be very helpful if you crate any short video that give use an overview of pricing too.
    TIA.

    • @bhancock_ai
      @bhancock_ai  11 месяцев назад

      Hey Owais! Great question! If I were you, I'd checkout this page here:
      openai.com/pricing
      The short answer to your question is that OpenAI is going to charge your everything.
      Every time you use ChatGPT 4, it costs you a few pennies.When you use the code interpreter, it costs a few more pennies. When you use the retrieval functionality, it costs a few more pennies.

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

    Many thanks!

  • @Samuel-zx9dw
    @Samuel-zx9dw 11 месяцев назад

    Hi is using the assitant API free?

    • @bhancock_ai
      @bhancock_ai  11 месяцев назад

      You can use the Assistant for free but you can only make a few request per hour. If you are going to create a project or do a lot of testing, you'll probably want to upgrade out of the free tier.

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

    You sound just like Bucky of the new Boston

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

    thankyou

  • @AbhinavKumar-tx5er
    @AbhinavKumar-tx5er 7 месяцев назад

    What is the need of Assistant. Can't we create our own code. I am not using assistant. What is the use of code interpreter over here