Skip to main content

Overview

Quraite provides a built-in adapter for Pydantic AI agents. This adapter allows you to integrate Pydantic AI agents with Quraite and run evaluations on them. This adapter uses OpenInference instrumentation to capture the trajectory of the agent.

Prerequisites

  • Agent dependencies: pydantic-ai package, LLM API key (for example, Google Gemini via pydantic_ai.models.google), and any tools you want to use.
  • Quraite dependencies: quraite[pydantic-ai-oi] package.

Define Your Pydantic AI Agent

You create a normal Pydantic AI Agent first, exactly as you would in any Pydantic AI project.

Set up Tracing

Quraite provides a tracing setup helper. For Pydantic AI, pass the Framework.PYDANTIC_AI enum:

Wrap the Pydantic AI Agent

Wrap the agent with the PydanticAIAdapter and pass the tracer_provider to it.

Run the Agent

Once wrapped, you expose the adapter using Quraite’s run_agent helper.

End-to-End Examples