MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / parse_obj

Function parse_obj

src/anthropic/_compat.py:75–79  ·  view source on GitHub ↗
(model: type[_ModelT], value: object)

Source from the content-addressed store, hash-verified

73
74# renamed methods / properties
75def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
76 if PYDANTIC_V1:
77 return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
78 else:
79 return model.model_validate(value)
80
81
82def 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