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

Method default

src/openai/_utils/_json.py:30–35  ·  view source on GitHub ↗
(self, o: Any)

Source from the content-addressed store, hash-verified

28class _CustomEncoder(json.JSONEncoder):
29 @override
30 def default(self, o: Any) -> Any:
31 if isinstance(o, datetime):
32 return o.isoformat()
33 if isinstance(o, pydantic.BaseModel):
34 return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
35 return super().default(o)

Callers

nothing calls this directly

Calls 1

model_dumpFunction · 0.85

Tested by

no test coverage detected