Learn how to trace Pydantic AI agents with Openlayer
Pydantic AI is a Python framework for building
production-ready applications powered by generative AI. Created by the
team behind Pydantic, it offers type-safe agents with structured outputs,
built-in dependency injection, and native support for leading LLM providers
like OpenAI, Anthropic, and Gemini.This guide shows how to trace Pydantic AI agents with Openlayer.
Once instrumentation is set up, you can run your Agents as usual.
Trace data will be automatically captured and exported to Openlayer, where
you can begin testing and analyzing it.For example:
Copy
Ask AI
from pydantic_ai import Agentagent = Agent('openai:gpt-4o')result = await agent.run('What is the capital of France?')