MCPcopy
hub / github.com/openai/openai-python / model_parse_json

Function model_parse_json

src/openai/_compat.py:175–178  ·  view source on GitHub ↗
(model: type[_ModelT], data: str | bytes)

Source from the content-addressed store, hash-verified

173
174
175def model_parse_json(model: type[_ModelT], data: str | bytes) -> _ModelT:
176 if PYDANTIC_V1:
177 return model.parse_raw(data) # pyright: ignore[reportDeprecated]
178 return model.model_validate_json(data)
179
180
181def model_json_schema(model: type[_ModelT]) -> dict[str, Any]:

Callers 4

_parse_contentFunction · 0.85
parse_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected