Skip to navigation

result

View as MarkdownOpen in Claude

Return the FunctionResult the model gets when this refusal is raised: its tool_result and tool_prompt as the response.

Returns

FunctionResult — The refusal’s result.

Example

from signalwire import ToolRefusal
refusal = ToolRefusal("place_order was not run: tea is out of stock.",
"Tell the caller, and offer coffee.")
print(refusal.result().to_dict())
# {'response': {'tool_result': 'place_order was not run: tea is out of stock.',
# 'tool_prompt': 'Tell the caller, and offer coffee.'}}