diff --git a/src/agents/agent_output.py b/src/agents/agent_output.py index ee14956e3..a2e5f2d10 100644 --- a/src/agents/agent_output.py +++ b/src/agents/agent_output.py @@ -114,9 +114,9 @@ def __init__(self, output_type: type[Any], strict_json_schema: bool = True): self._output_schema = ensure_strict_json_schema(self._output_schema) except UserError as e: raise UserError( - "Strict JSON schema is enabled, but the output type is not valid. " - "Either make the output type strict, or pass output_schema_strict=False to " - "your Agent()" + "Strict JSON schema is enabled, but the output type is not valid. " + "Either use a dataclass, Pydantic model, or TypedDict, " + "or wrap your type with AgentOutputSchema(your_type, strict_json_schema=False)" ) from e def is_plain_text(self) -> bool: