Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 710 Bytes

File metadata and controls

24 lines (14 loc) · 710 Bytes

Information about whales — an example of streamed structured response validation.

Demonstrates:

This script streams structured responses about whales, validates the data and displays it as a dynamic table using rich as the data is received.

Running the Example

With dependencies installed and environment variables set, run:

python/uv-run -m pydantic_ai_examples.stream_whales

Should give an output like this:

{{ video('53dd5e7664c20ae90ed90ae42f606bf3', 25) }}

Example Code

snippet {path="/examples/pydantic_ai_examples/stream_whales.py"}