Replies: 1 comment
-
Seems like the tools job is to actually display the form, not submit the form. I'd swap the tools purpose to be something like Then, you can immediately return a success ToolInvocation. If you need the chat thread to be aware of the data the form is submitting, you can add the form data to the thread with append when the user submits the displayed form. |
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
-
I have a few client tools I want to invoke, which renders a component with a form, action or button the user needs to interact with. The tools work fine if the user completes the component and I run the
addToolResult
function.However, if the user decides not to complete the task, e.g. if the AI ran the wrong tool, or they just changed their mind on what task they want to do, if they try to chat with the AI without completing the tool it throws an error:
How can I allow tools to be invoked without requiring a result?
I have tried adding a result either in the tool
execute
function, or when the component renders. But in both cases, the AI starts blabbering in the chat claiming the task is done, which I don't want. The AI shouldn't respond unless the user completes the tool.I'm also okay if there's a solution that makes the AI not respond at all. As long as the chat can be continued without the tool having submitted a result yet.
It's a bad user experience that they must complete the tool before being able to interact with the chat again.
Beta Was this translation helpful? Give feedback.
All reactions