Get structured outputs from your tasks.
result_type
, you can ensure that tasks return exactly the data structure you need.
list[Literal]
, list[Enum]
, or Marvin’s shorthand double-list syntax:
field_validator
model_validator
Annotated
to provide additional context about the expected result:
field_validator
) to validate a type so that the validation is baked into the type itself, you can use pydantic
’s functional validators: