TypedDicts ↗
noOriginal Documentation
title: TypedDict Support in Instructor - Dictionary Validation description: Use Python TypedDict for type-safe dictionary structures with Instructor. Validate dictionary schemas without Pydantic models for lightweight structured outputs.
We also support typed dicts.
from typing_extensions import TypedDict
import instructor
class User(TypedDict):
name: str
age: int
client = instructor.from_provider("openai/gpt-4.1-mini")
response = client.create(
response_model=User,
messages=[
{
"role": "user",
"content": "Timothy is a man from New York who is turning 32 this year",
}
],
)Link last verified
June 7, 2026.
View original ↗
Source: Instructor Docs
Link last verified: 2026-03-04