Pydantic
A Python library that defines data shapes as classes with type hints and validates data against them.
In more detail
Provider SDKs accept Pydantic models to generate the JSON Schema for structured outputs and tool inputs, and parse replies back into typed objects. Validation still matters: the model can return a well-typed but wrong value.
Related terms
- JSON Schema — A standard vocabulary for describing the allowed shape of JSON data: which fields exist, their types, which are required and what values are allowed.
- structured output — Model output that must match a given schema, usually JSON Schema, either by asking in the prompt or by a provider feature that constrains decoding.
Taught in
- Working With AI Coding Assistants — AI Engineering: LLM Apps, RAG & Agents