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

Function model_json

src/openai/_compat.py:128–131  ·  view source on GitHub ↗
(model: pydantic.BaseModel, *, indent: int | None = None)

Source from the content-addressed store, hash-verified

126
127
128def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
129 if PYDANTIC_V1:
130 return model.json(indent=indent) # type: ignore
131 return model.model_dump_json(indent=indent)
132
133
134class _ModelDumpKwargs(TypedDict, total=False):

Callers 1

test_iso8601_datetimeFunction · 0.90

Calls 2

model_dump_jsonMethod · 0.80
jsonMethod · 0.45

Tested by 1

test_iso8601_datetimeFunction · 0.72