Anyone know how the client can respond to tool cal...
# general-english
s
Anyone know how the client can respond to tool calls? I can't find a good way to do this, and no documentation. It feels like a bug or oversight due to the VAPI team not thinking/caring much about client-side tool calls, so I'm also open to hacky workarounds! For tool calls that are sent to a server URL, it's just a HTTP request that stays open until the server responds. No problem there. But if the tool call is configured to go to the client, it's received as a message event, presumably via a WebRTC data channel. So there's no "request" to keep open and respond to directly, causing VAPI to fail. Async vs synchronous behavior: If the tool is set to async then the client automatically sends back a
tool_call_result
message with result
Success.
which is then passed to the LLM, causing the Assistant to be interrupted and confused. I believe these async result messages should not be sent to the LLM, and this is a bug/oversight. If the tool call is set to synchronous then the client receives the tool call message, but the server immediately regards it as having failed, and a
tool_call_result
message with result
No result returned.
is sent to the LLM. Again, feels like an oversight and I believe the correct behavior would be to wait until the timeout is exceeded. Sending a message from the client with the role
tool_call_result
and correctly-formatted result just gives in an invalid message error. This feels like a straight-up bug. Of course, I can still send the content that the tool call requested to the Assistant as a regular
system
message, but by then the Assistant has already decided it's failed.
4 Views