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

Method json_schema

src/agents/agent_output.py:130–134  ·  view source on GitHub ↗

The JSON schema of the output type.

(self)

Source from the content-addressed store, hash-verified

128 return self._strict_json_schema
129
130 def json_schema(self) -> dict[str, Any]:
131 """The JSON schema of the output type."""
132 if self.is_plain_text():
133 raise UserError("Output type is plain text, so no JSON schema is available")
134 return self._output_schema
135
136 def validate_json(self, json_str: str) -> Any:
137 """Validate a JSON string against the output type. Returns the validated object, or raises

Calls 2

is_plain_textMethod · 0.95
UserErrorClass · 0.85