Exceptions
RunErrorDetailsdataclass
Data collected from an agent run when an exception occurs.
Source code insrc/agents/exceptions.py
AgentsException
Bases:Exception
Base class for all exceptions in the Agents SDK.
MaxTurnsExceeded
Bases:AgentsException
Exception raised when the maximum number of turns is exceeded.
ModelBehaviorError
Bases:AgentsException
Exception raised when the model does something unexpected, e.g. calling a tool that doesn'texist, or providing malformed JSON.
Source code insrc/agents/exceptions.py
UserError
Bases:AgentsException
Exception raised when the user makes an error using the SDK.
InputGuardrailTripwireTriggered
Bases:AgentsException
Exception raised when a guardrail tripwire is triggered.
Source code insrc/agents/exceptions.py
guardrail_resultinstance-attribute
guardrail_result:InputGuardrailResult=guardrail_result
The result data of the guardrail that was triggered.
OutputGuardrailTripwireTriggered
Bases:AgentsException
Exception raised when a guardrail tripwire is triggered.
Source code insrc/agents/exceptions.py
guardrail_resultinstance-attribute
guardrail_result:OutputGuardrailResult=guardrail_result
The result data of the guardrail that was triggered.