Our Python SDK got smarter. We developed a Typscript SDK too. We are updating our SDK code blocks. Python SDKhere.Typscript SDKhere.
Description
Percival

Pydantic Integration

Colab Notebook

Weather Agent

This example shows how to:

  1. Install the required libraries (including the pre-release of Patronus 0.1.4rc1).
  2. Create two pydantic_ai agents (a weather tool agent and a manager agent).
  3. Trace execution with Patronus, OpenTelemetry threading, and asyncio instrumentors.
# Install requirements – threading and asyncio instrumentations are necessary if
# you plan to spawn threads or run agents asynchronously.
 
pip install -qqq pydantic_ai \
               opentelemetry-instrumentation-threading \
               opentelemetry-instrumentation-asyncio \
               patronus

Export your OPENAI_API_KEY (or configure pydantic_ai with another provider) before running this script.

On this page