# Pydantic AI evals

Pydantic AI is an open-source Python framework for building agents, from the team behind the
Pydantic validation library. An agent is a typed loop. Tools are plain Python functions whose
signatures become the tool schema, tool arguments are validated before your code runs, and a run
returns the output type you declared. When validation fails, the error goes back to the model so
it can retry. The point is that a malformed tool call or answer is caught at that boundary
instead of flowing into your code. Dependencies reach tools through a typed run context, which
makes it easy to swap a real database for a fake one in a test, and switching model providers is
a change to one string.

Tracing is plain OpenTelemetry. The instrumentation emits standard spans for model calls and tool
calls, and any OTLP backend can receive them, so the traces don't have to go to the framework
owner's own product.

Evaluation lives in Pydantic Evals, a separate package that can test any Python function, not
only Pydantic AI agents. A dataset holds cases, and each case has inputs, an optional expected
output, and metadata. Evaluators score each result, either with code or with a model acting as a
judge. Running a task against every case in a dataset is an experiment, and it returns a report
you can compare across versions. Span-based evaluators read the OpenTelemetry trace of a run, so
a check can assert which tools were called and in what order, not only what the final output was.
Those checks see only what the instrumentation recorded, so a step that emits no span can't be
asserted on.

---

Source: https://tessary.ai/answers/pydantic-ai-evals
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
