Our docs got a refresh! Check out the new content and improved navigation. For detailed API reference see our Python SDK docs and TypeScript SDK.
Description
PercivalIntegrations

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