Сan I receive tool calls and give tool responses directly in browser? This is needed to display a form. (just displaying the form (setDisplayContactForm(true) and "ok, the form is displayed, please fill it" as the next sentence)
s
Shubham Bajaj
05/02/2025, 9:36 AM
ccing: @Kings_big💫
k
Kings_big💫
05/02/2025, 10:31 AM
Yes, you can handle tool calls in the browser to display a form like setDisplayContactForm(true) and send a tool response like “Ok, the form is displayed, please fill it” back to the assistant.
к
козак
05/02/2025, 12:11 PM
How can I do that ?
k
Kings_big💫
05/02/2025, 12:27 PM
Define a custom tool like displayContactForm in the assistant config, handle the tool call in your frontend like (setDisplayContactForm(true)), and respond with sendToolResponse to confirm the action.
Kings_big💫
05/02/2025, 12:28 PM
https://youtu.be/rc4PlH9BRbA?si=bli9ewgt61sByuzO▾
к
козак
05/02/2025, 5:22 PM
But how do I implement the sendToolResponse?
k
Kings_big💫
05/02/2025, 8:50 PM
Define a custom tool in your assistant, handle tool call POST requests on your server, and respond with a JSON result the assistant can use in the conversation.