setToolResponse
Set the structured form of the response, separating what the tool did from what the model should do next. It replaces any string response, and the response becomes an object with up to two keys:
Splitting them keeps the model from reading a status line aloud, and keeps the
instruction from being mistaken for data. For a single string, use
setResponse().
You can also set the structured form when you create the result:
new FunctionResult({ tool_result: '...', tool_prompt: '...' }).
Parameters
toolResult
What the tool did or found: facts for the model to reason from, such as
"payment declined" or "3 seats left". Omit it when there is nothing to
report beyond the instruction.
toolPrompt
What the model should do next, such as "Tell the caller how many seats are left.". Omit it for a facts-only result.
Returns
FunctionResult — this, for chaining.