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

preview_player
Показать описание
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:

Resources:

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
Рекомендации по теме
Комментарии
Автор

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!

beetz
Автор

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.

owaisjavaid
Автор

Good one 🎉 Shouldn't you have emphasized the need for tool/functions description to match a full/part of the assistant's instruction?

pluscrazy
Автор

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 ...

mingchi
Автор

Awesome content man! Have any tutorials allowing us to do this from functions from within open ai assistants directly out to sources and back, removing the need for these manual inputs? Example, Open AI, with ability to call to Dumpling AI and web scrape vs call to a native API?

MikeEnsor-suro
Автор

This was an absolutely awesome explanation and just what I was looking for! Any plans for something with Vercel AI SDK to build generative UI? Started exploring the useAssistant hook they have and seems pretty awesome so far.

captainchaos
Автор

i thinks it is a bast ai channel, thanks

romanbolshiyanov
Автор

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 ...

normanhome
Автор

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!

RoniBliss
Автор

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?

pkundr
Автор

Hey, I don't get when the getStockInfo function is called, is it during the ai assistant creation ? And how do we pass on arguments to the function ? I'm a bit confused ^^

romainbacque
Автор

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?

carloseduardolandeiraribei
Автор

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.

Aaron-mdeo
Автор

Hi I am developing ai agent and using function calling.
After getting data from api to by function.
LLM need to do series of steps on function call response data but llm is only doing first manipulation step
Can you help on this issue. Using gpt 4 model

siddheshwarpandhare
Автор

Thanks for your content bro! I wonder if there is a way to create the assistant using server actions instead of api?

AlphasoundSchool
Автор

😂😂😂 When people just give the sec code I really feel like I have to subescribe and leave a star

marcioandre
Автор

do I need to clear cookies? how do I get the new code if I already got the code from a previous video?

JonathanPohlner
Автор

I signed up for your code resource but it's not sending me the email. Thanks!

Ourworldbyade
Автор

Why cant you just share the source code? Why do i have to sign up for it? Enough with the email farming.

eliskucevic
Автор

Once I saw next.js I stopped watching. Not everything should be made with react/next etc...

clamhammer