| repair_tool_call | R Documentation |
Attempts to repair a failed tool call. This implements a multi-layer repair strategy inspired by Opencode's experimental_repairToolCall:
Try to fix tool name case issues (e.g., "GetWeather" -> "get_weather")
If repair fails, route to an "invalid" tool for graceful handling
repair_tool_call(tool_call, tools, error_message = NULL)
tool_call |
A list with name, arguments, and optionally id. |
tools |
A list of available Tool objects. |
error_message |
Optional error message from the failed call. |
A repaired tool call list, or an "invalid" tool call if unrepairable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.