vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
10k stars 1.48k forks source link

Assistant Hook: Add client side function handling and other events #868

Open johannbuscail opened 10 months ago

johannbuscail commented 10 months ago

Feature Description

Add events on the useAssistant hook, just like the useChat hook.

https://sdk.vercel.ai/docs/api-reference/use-chat onResponse onError onFinish

But most importantly, making the assistant hook actually useful is the onFunctionCall event. This is a MAJOR and really really important event as it allows the assistant to interact with the client side.

https://sdk.vercel.ai/docs/guides/providers/openai-functions#handling-function-calls-on-the-client

nico-herrera commented 3 months ago

bumping this, need it badly. If anyone has found a solution or workaround please let me know!

hgrias commented 2 months ago

bump