MCPcopy
hub / github.com/openai/openai-agents-python / set_function_tool_failure_error_function

Function set_function_tool_failure_error_function

src/agents/tool.py:1632–1645  ·  view source on GitHub ↗

Store internal failure formatter config for tool wrappers and runtime fallbacks.

(
    function_tool: FunctionTool,
    failure_error_function: ToolErrorFunction | None | object = _UNSET_FAILURE_ERROR_FUNCTION,
)

Source from the content-addressed store, hash-verified

1630
1631
1632def 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
1648def resolve_function_tool_failure_error_function(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected