Triggering Clientside after AI function call with AI SDK
Unanswered
Bahama Mockingbird posted this in #help-forum
Bahama MockingbirdOP
Hey,
I'm currently working with the AI SDK from vercel and im trying to figuring out the best way to trigger clientside events after a function has been executed on the Server Side through the API.
So basically when an OpenAI Function Call is getting handled on the server side and you want to keep the recursive function calls you are returning a chat completion to the client side which disables the functionality for clientside function calling. If you return nothing, the function call can get handled on the client side.
So what I wanna do is practically handle function calls on the server side but also trigger a clientside event. Like a toast notification or reloading some data fetching for example.
Cheers 🙂
I'm currently working with the AI SDK from vercel and im trying to figuring out the best way to trigger clientside events after a function has been executed on the Server Side through the API.
So basically when an OpenAI Function Call is getting handled on the server side and you want to keep the recursive function calls you are returning a chat completion to the client side which disables the functionality for clientside function calling. If you return nothing, the function call can get handled on the client side.
So what I wanna do is practically handle function calls on the server side but also trigger a clientside event. Like a toast notification or reloading some data fetching for example.
Cheers 🙂