Store internal failure formatter config for tool wrappers and runtime fallbacks.
(
function_tool: FunctionTool,
failure_error_function: ToolErrorFunction | None | object = _UNSET_FAILURE_ERROR_FUNCTION,
)
| 1630 | |
| 1631 | |
| 1632 | def set_function_tool_failure_error_function( |
| 1633 | function_tool: FunctionTool, |
| 1634 | failure_error_function: ToolErrorFunction | None | object = _UNSET_FAILURE_ERROR_FUNCTION, |
| 1635 | ) -> FunctionTool: |
| 1636 | """Store internal failure formatter config for tool wrappers and runtime fallbacks.""" |
| 1637 | function_tool._use_default_failure_error_function = ( |
| 1638 | failure_error_function is _UNSET_FAILURE_ERROR_FUNCTION |
| 1639 | ) |
| 1640 | function_tool._failure_error_function = ( |
| 1641 | None |
| 1642 | if failure_error_function is _UNSET_FAILURE_ERROR_FUNCTION |
| 1643 | else cast(ToolErrorFunction | None, failure_error_function) |
| 1644 | ) |
| 1645 | return function_tool |
| 1646 | |
| 1647 | |
| 1648 | def resolve_function_tool_failure_error_function( |
no outgoing calls
no test coverage detected