Define the schema, pass the input, get a validated object back.
Use a fast, low-cost model like gemini-3.5-flash for high-volume extraction.
The hard part is getting missing fields as null instead of a hallucinated value.
Nested objects
Lists of sub-objects work the same way. Define the inner model and reference it.
Pass output_schema=Meeting and the agent returns a Meeting with a populated action_items list.
Per-field confidence
When downstream needs to route uncertain fields to a human, wrap each value in a confidence carrier.
OpenAI strict structured output rejects a description on a field whose type is itself a referenced model. Keep Field(..., description=...) off fields typed as a sub-model; put the explanation in a comment or the instructions instead.
Any modality, same pattern
The only thing that changes per modality is the input argument and the model. See Multimodal inputs for the input plumbing.
image_extraction_to_vectordb extends extraction with an embed-and-store step: describe each image into a typed object, flatten it to a searchable string, embed it, and store it in LanceDb for similarity search. See the cookbook.
Next steps
Developer Resources