Calling frontend function after function call/tool invocation #1197
Unanswered
arielweinberger
asked this question in
Help
Replies: 1 comment
-
Also running into this. It feels slightly awkward at the moment. For further context my usecase involves running some functions, that live in a client react context. It would seem plausible that the ai rsc render function could return a client function, however, any kind of callback inside the client component will run into re-rendering/mounting issues... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI! I followed the tutorial for Generative UI and am able to return a component to be rendered after a tool call.
I was wondering if there's any built in way, or a recipe/technique to signal in the response that a UI function should be called instead.
For example, the tool has determined that a table row needs to be deleted (
delete_table_row
tool). I want to know about it in my UI and call a function set in my frontend app to actually delete it.Other than doing funky stuff with
aiState
, any ideas?What I'm doing now, is rendering a client component that then calls other functions in
useEffect()
. Funky but it works.Beta Was this translation helpful? Give feedback.
All reactions