I’m working on a chat interface where some tools trigger UI widget displays which don’t have a sensible tool_result
. However, the API requires that each tool_call
must have a corresponding tool_result
message.
Use Case:
In our chat interface, the LLM may trigger a tool to render a UI widget without needing any logical result to continue the conversation. Here’s an example:
Example:
User: "What is the next trip I have coming up?"
Model: “displayTrip({ tripId: 1 })"
In this case, the tool is used purely for rendering, and there’s no meaningful tool_result
to return.
Current Workaround:
Our current workaround is to return a placeholder tool_result
, such as a result of "rendered"
. While this works, it’s not super great as it requires understanding this API requirement, then code work to interleave these fake responses with your normal code flow for the chatting.
Request for Enhancement:
Would it be possible to provide an option—perhaps in the tool’s schema—to mark certain tools as not requiring a tool_result
? This would streamline the DX for use cases where tools don’t have a result.
Just some feedback! Cheers