pydantic_compat
pydantic_compat
¶
Low-level Pydantic annotation compatibility helpers.
Functions:
| Name | Description |
|---|---|
unwrap_optional_annotation |
Unwrap |
nested_model_type |
Return the nested model type when an annotation has one compatible model. |
unwrap_optional_annotation(annotation)
¶
Unwrap Annotated and a union with one non-None member.
Source code in src/nemo_safe_synthesizer/configurator/pydantic_compat.py
nested_model_type(annotation, expected_base)
¶
Return the nested model type when an annotation has one compatible model.