OpenAI Assistants API - Course for Beginners
HTML-код
- Опубликовано: 29 май 2024
- Learn how to use the OpenAI's Assistants API to build powerful AI assistants. In this course, we'll explore how to leverage the Assistants API by OpenAI to create dynamic, intelligent web apps using Streamlit.
What we'll cover:
1️⃣ Function Calling with the API: Learn to seamlessly integrate the Assistants API into your applications, enabling advanced AI functionalities right at your fingertips.
2️⃣ Knowledge Retrieval: Discover how to use the API to extract information, answer questions, and make your applications smarter and more responsive.
3️⃣ Code Interpreter Capabilities: Dive into the API's ability to interpret and generate code, a game-changer for automating tasks and enhancing your app's capabilities.
4️⃣ LLM Fundamentals: Gain a solid understanding of Large Language Models (LLMs) and how they form the backbone of OpenAI's Assistants API. This module demystifies the technology and provides a foundation for advanced application development.
The course features a series of hands-on projects and real-world examples to apply what you've learned. By the end of our session, you'll have the skills and confidence to build your own intelligent web apps using Streamlit and OpenAI's Assistants API.
⭐️ Code ⭐️
Personal trainer: github.com/pdichone/vincibits...
Personal trainer: github.com/pdichone/vincibits...
Study-Buddy: github.com/pdichone/vincibits...
✏️ Created by @vincibits
Twitter (X): @buildappswithme
⭐️ Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:01:02) What’s This Course About - What Will You Learn?
⌨️ (0:01:33) Pre-requisites
⌨️ (0:02:44) Python and Dev tools Set up
⌨️ (0:04:22) VS Code Installation
⌨️ (0:05:31) OpenAI Account - Generate an API Key
⌨️ (0:07:53) What is the Assistants API & Benefits - Comparison Between the Chat Completion API and the Assistants API
⌨️ (0:18:16) Assistants API Building Blocks
⌨️ (0:24:04) Creating an Assistants API - Manually (Personal Trainer)
⌨️ (0:38:20) Creating an Assistants API - In Code (Personal Trainer)
⌨️ (1:04:15) Build a News Summarizer Introduction: Function Calling - A Streamlit Application
⌨️ (1:25:39) Create an AssistantsManager Class For our News Summarizer
⌨️ (2:10:46) Using the AssistantManager Class to Create an Assistant and run it as a Streamlit App
⌨️ (2:28:23) Knowledge Bases Retrieval Tools - How it Works & Introduction to Embeddings
⌨️ (2:35:25) Build a Study Buddy Streamlit Application
⌨️ (3:22:24) Run the Study Buddy Streamlit Application and Test
⌨️ (3:29:27) Wrap up and Final Considerations.
🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news
Thank you so much for watching, Everone. I hope you find this course valuable and if you have any question don’t hesitate to reach out to me :) again, thank you for the opportunity 🎉
Love your style. Subscribed. Waiting for more quality videos.
@@noNullMoments Thank you so much for your support. It means the world to me... :)
Discord server was the early birds? 😀@@vincibits
Without having the API
subscription can we able to do the python code
@@joyaljose3666 you have to have the API subscription, however, if you open an account (for the first time) you'll have a few Free credits that you can use :)
This dude's voice is so soothing I might learn this lesson in my sleep.
Hahh.. Is that a good thing? I mean I want you to learn, and not to fall asleep :)
Also liked it. Soft and clear. It's a good thing for sure.
for real, it feels like I'm being taught by Kendrick Lamar
@@rolandcucicea6006 lol! I hope that's a good thing?!
@@vincibits, To me I feel like you teaching me like sitting next to me. 😄
I am casually watching this course, and I like the teacher. I am casually considering trying to follow along. I appreciate the relaxed speed of the course. I have seen some other hotshot young RUclipsrs, talking about Assistants API, but they are so fast, so I don't understand anything. This teacher's speed is just right for me :)
Thank you!!
Paulo was the first to do Flutter Courses. Love to see he’s still making great videos.
Thank you so much for your kind words :)
Randomly came across this tutorial and the instructor has such a calming voice and so so easy to grasp the lesson. This is something I haven’t even considered learning before and I am so focused on the subject that I’m excited to give it a try. Thank you!!
Great instructor, calm and methodical. Thank you 🙏
Mr.bo this gentleman is an excellent teacher take care of him
Smooth, masterful, and timely walk-though of the OpenAI Assistants API. Very clear. Much more pragmatic than reading the docs. Fantastic job!
i was just saying the exact opposite to myself 😅
Anyway, thank authors for the effort and for the ideas included 😌
@@kalamatej You don't like the course? I am just curious :)
This was really excellent! For the study buddy, I think things are different now since the code doesn't work, so I converted the related functions to work like it does in the openai documentation for file searching. Works great!
Thanks so much!
I just finished this course and I must say I thoroughly enjoyed it! The content was well-explained and beginner-friendly. I would be really excited to see more videos on this topic in the future. Please continue with the great work, and I'm looking forward to the next videos!
Thank you so. much!
Amazing Teacher, Very detailed Tutorial.
Thank you so much! I really appreciate you!
Thanks a lot for this tutorial. I've learned a lot from this.
2:14:48 I wonder why we need to create the assistant everytime users click the button? This creates a lot of assistant in the OpenAI account. Should we just create it one time when the app is built?
Thanks for this tutorial, this solves my tasks for this sprint.
Paulo is great. I did one of his courses on another plataform. Happy to see him here
Thank you so much for your kind work! I am humbled!
Thank you for your kind words. It means a lot!
i watched the first 10 minutes but i'm still confused regarding what assistant api actually does, i even asked chatgpt but it doesn't know either.. is it just chatgpt api or i can use this to teach the chat's api to learn only my specific dataset and answer questions regarding that data without answering other topics? thanks! p.s. i've subscribed to your youtube channel btw, i saw few interesting python projects there i hope you keep it up and not give up after a year or. so like most youtubers@@vincibits
Thank you so much for this tutorial!! Very helpful
Oh my god finally 😭I've been waiting for this
Great content! Unlike speedy, marketer, shallow content that is often seen, this man provides in depth, nicely paced, original content. 👏👏
Thank you so much! I really appreciate it!
thank you so much for this video. saved us all a ton of time. the api from the application is generating inconsistent responses and behaves as if the files don't event exist. However, from the playground, it works as expected.
Thank you so much!
Thank you very much. Easy to follow. I'll try it in NodeJS ❤
Thank you!
I was looking for this many weeks, most of the other information is out of date and code is not working. Thank you so much! if you can make another video about how to connect this to simple webinterface - would be great!
Mr paulo really your style is excellent and that was very helpfull,hope to see more frequently in this channel,hope mr bo will accept
Thank you so much!
Love Paulo! Always a pleasure to see him.
Thank you so much! It means a lot to me. Thank you!
Thank you so much!
Great Course!
watched from Brazil
As always Steve Jobs giving great advice thanks steve.
This course is very nice and useful for us thanks all of that
Thank you! I am glad you find it helpful!
Paulo 's flutter course was good. I took it in udemy.
Thank you!
Please share the slides / presentation for notes. Thanks 🙏
Thank you for such a indepth tutorial and it has help me alot and I think you have alot to offer.You can really provide alot of value if you just brush up a little in your teaching skills as I am totally lost sometimes on which part I am coding when your writing a monolith and only seeing the final result in the end. I dont know which part is broken or which part does what. Again I dont mean this to come in a bad way.
Very useful, Thank you Paulo
Thank you!
Thank you so much.
This is what i need 🎉
Great course, thank you for making available this high quality content 😃
Thanks
Thank you for the tutorial, it's truly awesome. I need to find time to thoroughly review it. I
have a question: I'm currently looking to analyze simulated data from interviews between psychologists and clients. Each interview is about 20,000 tokens long, and I want to summarize the Q&A content to create a case report for each client.
However, loading all the data at once is a significant challenge. I've considered dividing the data into batches and feeding it to the assistant for processing, but this often leads to incoherent outputs, as if the assistant is hallucinating.
My current plan is to split the data into multiple files, then gradually submit these to the assistant to generate summaries, and finally integrate these into a comprehensive case report.
The issue is that my current programming skills are limited to simple interactions-submitting a question and receiving an answer. Although I can use a for loop to process batches of data for summaries, these seem to be treated as separate conversations without shared context, which means the AI might not remember past interactions.
How can I program it so that my prompts are processed in a single thread, similar to how the assistant interface maintains context throughout a conversation?
Thank you for your help.
Great content, thanks! Do you have a preference when building a RAG app to work with the OpenAI Assistants API, Llama Index, or Langchain?
thanks alot for the awesome tutorial, very informative and easy to follow. I have a question, if i send a copy of the session history "Thread" at each API call, is the thread content 'tokens' calculated in my usage again each time?
How did you get intellisense on the openai parameters (enums, etc) in VS Code?
Which extension? (there are dozens, but I like what I'm seeing on your video)
Fantastic job Paulo!
Thank you so much!
In the Study Buddy you need to fix upload_to_openai so that the file actually gets a name when uploaded:
def upload_to_openai(filepath):
with open(filepath, "rb") as file:
response = client.files.create(file=(os.path.basename(filepath), file),
purpose="assistants")
return response.id
Correct.
thanks very much,
Thanks a million. i had nothing working until you provided this. very kind of you!!!
it really gets to me that error prevented the assistant from working and only you mentioned it. im lucky i saw your comment and connected the problem to the code,. not familiar with python i would have never figured that out. i cant thank you enough. made all the difference.
i have a big question for you: do you think my sql tables with extensive business calculation knowledge examples can be read in and recognized as the models for building any workflow? organized by access, functions and sequence, this methodology can define any business process. if an assistant can read in my proven formulas that reside in 15 sql tables and let users select from them and build new ones anything can be defined, matched and executed.
Amazing tutorial! One question about the cost. Is cheaper to create a new thread for each message or it's the same we use the same thread for each messages ? How to calculate cost of usage ?
same question I have
This is a wonderful video @vincibits
This may be premature since I haven’t tried it yet, but I’ve been doing a lot of work so I’m not token hogging and this assistants API feels like it may eat up tokens. I’ll benchmark each for comparison. The convo history compression alone would be something I’d rather managed in a thread, but if it’s using up tokens, it’s gonna be expensive
awesome video!
thanks a million for this content
Paulo, wonderful course, and thank you. Is the OpenAI Assistant python class code you demonstrated available anywhere? I looked at the links provided (two were the same) and didn't see anything regarding the class development. Again, thank you so much for your time.
Love this video! By the way, is there the code of function calling provided? I do not find it in the profile.
Plz tell me which version of dell laptop is required for OpenAI project
Thank you RUclips for 2x speed 😅
Thanks!
This is a goldmine
This was excellent. Do you do consultations as well? Thanks.
Great job. It would be great if you can teach us how to implement stream responses when it release for tge Asistant api
Will do!
Please do a short follow up with the streaming responses 😊😊😊
Its awesome.
thanks for sharing great knowledge sir, can we have assistant api implementation in php
Is there a reason that we have to wait for the run to complete? I see that OpenAI allows streaming - client.beta.threads.runs.stream
Now see the thing is, they have mentioned multiple forms of pricing in OpenAI, it's confusing, if you could help. You see, if wer'e using assistants api with 4 or 4.5 turbo models, also fine tuning a bit(if this means training our assistant to some extent), then they are going to charge separately on the three fronts they mentioned there? model + assistant api(session thing) + fine tuning($8/M tokens or so)?
Voice!!! ❤
nice. so assistance api is something which is doing what langchain does??
I used assistants api a week after it released. I'm just a small text file it was super slow I'm saying 10 seconds for a simple question. It's a really unoptimized rag system.
@vincibits
Thank you very much for your explanations.
I can't find the link to get code about News Summarizer.
Could-you publish it again?
would assistant API follow the same response with custom GPT if we give them both the same instruction?
What are the benefits of using this over say the custom GPT’s?
Using someone else's configuration versus making your own. More power and more control to you at the expense of having to do the work...
But you make your own Custom GPT's anyway
Can I create a single PDF chatbot assistant and use it for multiple users or I have to create a new assistant for each user ? I am talking about android application.
As a knowledge base can’t you just get it to retrieve large files and then the chat gpt will incorporate it into its answer without all the coding?
Can you tell me what kind of computer or laptop you are using? I am 47 yrs old and starting my life over. I need a new career. I was hoping to develop skills using A.I. so I can get out of my horrific predicament. Please any advice would be great. Great video by the way!🤙
why didn't you get directly with google colab? No need to install coder or python libraries as is all in one. Makes sense ora do you see any issue in using google colab?
in the function call, how can we connect to the database?
❤ yes I a great 👍
I think there is a little mistake in the video description. The personal trainer github repo shows up twice and the newsSummarizer is missing!
Good but perhaps a bit slow? Speed x10
sorry im new OAI asssistant API..i have already had 'credentials' from my custom GPT in GPT store. how can i connect it to my separate app with assistant API? not recreating the instruction on assistant API but just connect it to custom GPT in GPT store that i have already created earlier
where will we get these notes ?? plz help
Interesting how about 70% of the video just shows things you can already do with the normal chat completions API (function calling), but with way less overhead and cost. Anyway, good video 👍
Dude I just fall in love with you ❤❤
(58:58) why the response when call assistant was so slow ? Do u have a solution or something explain that ?
Does anyone face very slow api calls? I even tried with latest model '4o' but I'm getting many failures and in case of success, it could take up to 10 seconds or more to get a response.
Why I cant see is no save button, when I am creating assistant?
thanks for the video, but I a getting this error:"TypeError: OpenAI.__init__() takes 1 positional argument but 2 were given"
❤❤❤
hi where you supply the 3 links for your course code, there is an error the 2nd project link, the first persona-trainer code is repeated so i have been trying to type in every word as you say it and its very hard to comprehend at the same time. could you please fix that link to go to NEWS-SUMMERIZER code instead?
Yes, I can't find the news summarizer code as well @vincibits
Does this cover how to create images with assistants
15:12 BULGARIA mantioned !
wow
I would like to ask how to activate, (source myenv/bin/activate), I am stuck here, I am a windows user and I followed the steps you instructed but I am stuck at this early hahahaha, could you instruct me?
can we build RAG system here
I am getting this error in personal trainer project plss tell me how to resolve this--> raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable and this error also--> File "C:\Users\ASUS\OneDrive\Desktop\New folder (3)\main.py", line 24, in
thread = client.beta.threads.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Threads.create() got an unexpected keyword argument 'message'
This isn't possible without credit card info, right? Even the $5 credits on the new account aren't a lot?
could you please upload news summarizer code
does anyone know that gpt 4 subscription which costs 20 dollar per month allow access to openai assitants api toekns or not ?
No it doesn't. Open AI's api and chatgpt plus are different things which doesn't correlate. Got OpenAI's billing section and just add no more than $10 to start working with an api.
@@mentalpump so it's like 10 dollars per month for the assistants api?
@@daaimrehman717 No. 10 dollars is just a thresholding price which I personally suggested. You can have whatever. And your balabce will deduct as you use api after that from that balace you hold ie 10 dollars or whatever.
I have created a assitance ID asst_..... but I am still failing to build a simple php file that tests it via curl. any one who can help?
Charley your voice be more than sleeping tablets..😉
Can i use gpt 3 for assistance api for free?
yes 100%
First comment
Who thought that Open AI was intelligent? God help anyone who has to go through this to get it to do something useful.
Holy crap, an extra day in Paris is $12.9K??
though isnt it paid?
Yes still it's
why does bro look like steve jobs
в одной рекламе ии ассистент напоминал пациенту принимать таблетки. сейчас вряд ли любой ии ассистент имеет право советовать информацию медицинского характера
its a good tutorial but its for open ai assistants v1
OpenAI ASMR API
sorry your python codding is confusion
He repeatedly misspells "assist" as "assis". I don't know what he is getting at, but it's unprofessional and also borderline offensive.
Your free to leaves if you don't like it buddy🤣🤣