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

Function parse_obj

src/openai/_compat.py:80–84  ·  view source on GitHub ↗
(model: type[_ModelT], value: object)

Source from the content-addressed store, hash-verified

78
79# renamed methods / properties
80def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
81 if PYDANTIC_V1:
82 return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
83 else:
84 return model.model_validate(value)
85
86
87def field_is_required(field: FieldInfo) -> bool:

Callers 4

test_iso8601_datetimeFunction · 0.90
test_deprecated_aliasFunction · 0.90
validate_typeFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_iso8601_datetimeFunction · 0.72
test_deprecated_aliasFunction · 0.72