OpenAI Assistant Function Calling Tutorial For Beginners (App With Source Code Included)

  Рет қаралды 7,661

codewithbrandon

codewithbrandon

Күн бұрын

Welcome to this OpenAI Assistant API Function Calling tutorial. If you're interested in AI and web development, this video is for you.
Source Code:
brandonhancock.io/openai-func...
Resources:
- platform.openai.com/docs/assi...
- platform.openai.com/docs/assi...
- platform.openai.com/docs/guid...
- finnhub.io/docs/api/stock-sym...
Timestamps
00:00 Introduction
00:30 What is function calling + Use Cases
02:05 Quick Assistant Crash Course
04:51 Assistant Run Life Cycles
08:34 High Level Code Overview
10:04 Assistants - Code Deep Dive
15:52 Threads - Code Deep Dive
17:56 Messages - Code Deep Dive
22:44 Runs - Code Deep Dive
26:40 Function Calling [IMPORTANT]
33:34 Code Recap
34:51 Outro

Пікірлер: 26
@beetz12
@beetz12 24 күн бұрын
Thanks for the fantastic tutorial Brandon. I watched 5 other videos to learn function calling and this was hands down the best explanation! And I appreciate you providing the code for testing your assistant. If I hadn't come across your video, I would have written one myself. You saved me at least 5+ hours!
@Thatswhatshesaidnumberone
@Thatswhatshesaidnumberone 3 ай бұрын
A big thank you for the great tutorial, and excellent working code.
@bhancock_ai
@bhancock_ai 3 ай бұрын
Hey Rushy! The next full stack video I'm going to work on will have some stateful processing and event-driven architecture so I think you'll really like it! Soon, I will be releasing more info about the next full stack tutorial I'm making for you guys!
@romanbolshiyanov
@romanbolshiyanov 6 күн бұрын
i thinks it is a bast ai channel, thanks
@maximusmadman
@maximusmadman Ай бұрын
Excellent Tutorial
@owaisjavaid8110
@owaisjavaid8110 3 ай бұрын
Really appreciate the effort you put into the box so anyone can find out the what they are looking inside if the box. Can you add more details of the usage and pricing related stuff so we can have an eagle eye overview as well, and we can actually make it useful for any business solution.
@bhancock_ai
@bhancock_ai 3 ай бұрын
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.
@RoniBliss
@RoniBliss 4 ай бұрын
The concept I don't understand yet is, I get the coding part, but say I have a [ search_web ] Python code, where would I host that code so the Assistant can call it? Then let's say I have the code hosted, and I go over to the OpenAI assistants dashboard > under functions say I have a function with Name: [ search_web ] (3:28 in your video)and I hit the test button. How does the Assistant know where my hosted Python code is? There is no endpoint set up there? Im so confused on this part. Its the last piece of the puzzle for me. Your help would be so greatly appreciated!
@carloseduardolandeiraribei5302
@carloseduardolandeiraribei5302 2 ай бұрын
Thanks for this, just one question, what if the message is too long and exceeds URI length limit when setting a message to a thread?
@Aaron-md2eo
@Aaron-md2eo 4 күн бұрын
Great tutorial! Would you (or anyone else) have an idea how to handle sequential function calls where the 2nd function call requires the results of the first one? For example, if you integrate an assistant with a calendar API and you tell it to delete your 2 o'clock appointment. It would first need to list your events (function call 1) and then delete the event (function call 2) with the event ID retrieved from the first call.
@codewitheric8800
@codewitheric8800 2 сағат бұрын
i need this too, did you find any solutions?
@mingchi21
@mingchi21 2 ай бұрын
Very good explanation, I have a question, can the API remember the context? For example: User=>Hey what is the price of tesla? Resp=>The price is ... User=>How about Apple? Resp=>The price is ... User=>Google? Resp=>The price is ...
@normanhome7017
@normanhome7017 2 ай бұрын
Hi Brandon a big thanks for the video I have same questions similar to one of the comments which you did not answer can you please answer it thanks. The following is the question Can the API remember the context? For example: User=>Hey what is the price of tesla? Resp=>The price is ... User=>How about Apple? Resp=>The price is ... User=>Google? Resp=>The price is ...
@AlphasoundSchool
@AlphasoundSchool 4 ай бұрын
Thanks for your content bro! I wonder if there is a way to create the assistant using server actions instead of api?
@bhancock_ai
@bhancock_ai 4 ай бұрын
Hmmmm great question! You should definitely be able to create the assistant using only server actions. I think this article will show you how to start using server functions instead of the api calls in the video: auth0.com/blog/amp/using-nextjs-server-actions-to-call-external-apis/
@AlphasoundSchool
@AlphasoundSchool 4 ай бұрын
@@bhancock_ai Thank you! I will check it out 😄
@pkundr
@pkundr 3 ай бұрын
Hey, thanks for this great tutorial! One question I have is why do we need to pass the stock data back to the assistant? In your example, the objective is to show the user the stock prices he requested. Once the Assistant sends us the stock tickers, we can already do so by calling the finance API. Why is it necessary to inform the Assistant about the prices?
@bhancock_ai
@bhancock_ai 3 ай бұрын
Great question Phillip! This confused me too at first. The reason we need to pass back the stock prices to the Assistant is because we want to complete our `runs`. If we didn't pass back the results to our run, the run would eventually time out because they waited on us too long to give them the information they needed to complete. Here's what the OpenAI docs say about the requires_action state: When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. If you want to check out the full webpage, you can see it here: platform.openai.com/docs/api-reference/runs/submitToolOutputs I hope that helps!
@JonathanPohlner
@JonathanPohlner 5 ай бұрын
do I need to clear cookies? how do I get the new code if I already got the code from a previous video?
@bhancock_ai
@bhancock_ai 5 ай бұрын
Hey! I just shot you an email with more info!
@Ourworldbyade
@Ourworldbyade 4 ай бұрын
I signed up for your code resource but it's not sending me the email. Thanks!
@bhancock_ai
@bhancock_ai 4 ай бұрын
Hey! I apologize that it didn't get sent to you. Could you please check your spam folder because I know a few people have experienced that issue in the past. If it's not there, could you DM me your email on X or email me at brandon@brandonhancock.io and I'll be sure to get it over to you!
@eliskucevic340
@eliskucevic340 Ай бұрын
Why cant you just share the source code? Why do i have to sign up for it? Enough with the email farming.
@DevNieriDantas
@DevNieriDantas 2 күн бұрын
ingrato
@clamhammer2463
@clamhammer2463 3 ай бұрын
Once I saw next.js I stopped watching. Not everything should be made with react/next etc...
@DevNieriDantas
@DevNieriDantas 2 күн бұрын
pense fora da caixa e replique pro seu cenário!!! voce não é o sol, o mundo nao gira ao seu redor
Looking Into a REAL Codebase - Beyond the Basics
10:12
Tech With Tim
Рет қаралды 23 М.
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,4 МЛН
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 10 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 20 МЛН
OpenAI Assistant API Tutorial With Code Examples
21:52
codewithbrandon
Рет қаралды 17 М.
CrewAI Tutorial: Complete Crash Course for Beginners
1:05:43
codewithbrandon
Рет қаралды 133 М.
Cody: the AI assistant that actually knows your codebase
10:07
Aaron Francis
Рет қаралды 17 М.
This VS Code AI Coding Assistant Is A Game Changer!
14:27
codeSTACKr
Рет қаралды 127 М.
LangGraph + CrewAI: Crash Course for Beginners [Source Code Included]
53:34
GPT function calling in a nutshell
15:36
Henrik Kniberg
Рет қаралды 34 М.
How I Made AI Assistants Do My Work For Me: CrewAI
19:21
Maya Akim
Рет қаралды 686 М.
Expert AI Developer Explains NEW OpenAI Assistants API v2 Release
30:38
How To Connect Local LLMs to CrewAI [Ollama, Llama2, Mistral]
25:07
codewithbrandon
Рет қаралды 55 М.
How much charging is in your phone right now? 📱➡️ 🔋VS 🪫
0:11
ПК с Авито за 3000р
0:58
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,5 МЛН
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 23 МЛН
Куда пропал 3D Touch? #apple #iphone
0:51
Не шарю!
Рет қаралды 666 М.
👎Главный МИНУС планшета Apple🍏
0:29
Demin's Lounge
Рет қаралды 492 М.