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

Class ModelBehaviorError

src/agents/exceptions.py:66–75  ·  view source on GitHub ↗

Exception raised when the model does something unexpected, e.g. calling a tool that doesn't exist, or providing malformed JSON.

Source from the content-addressed store, hash-verified

64
65
66class ModelBehaviorError(AgentsException):
67 """Exception raised when the model does something unexpected, e.g. calling a tool that doesn't
68 exist, or providing malformed JSON.
69 """
70
71 message: str
72
73 def __init__(self, message: str):
74 self.message = message
75 super().__init__(message)
76
77
78class ModelRefusalError(AgentsException):

Callers 15

_parse_tool_inputFunction · 0.90
_normalize_tool_inputMethod · 0.85
_run_agent_implMethod · 0.85
validate_jsonMethod · 0.85
_on_invoke_tool_implFunction · 0.85
extract_last_contentMethod · 0.85
_invoke_handoffFunction · 0.85
_invoke_handoffFunction · 0.85
invoke_mcp_toolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected