Pydantic AITranslation site

November 25, 2026release 33 0 0

An open-source framework for building Python agents that supports typed output, tool invocation, and manual approval.

Language:
en
Collection time:
2026-11-25
Pydantic AIPydantic AI

Pydantic AI Official Website

Pydantic AI is a Python agent framework developed by the Pydantic team; the code is written in MIT License. It is suitable for teams that already develop backends in Python and wish to integrate models into work order processing, document processing, or data validation workflows. The code is free to use, though selected model services and deployment resources may be subject to additional charges. The framework supports integration with multiple model services; when switching models, you should still verify that capabilities such as structured output and tool invocation are compatible.

With structured output, how does the business logic integrate with it?

Taking work order routing as an example, define “Category, Urgency, and Missing Information” as a PyDantic data model, and then encapsulate the knowledge articles available for querying as typed Python tools. The framework validates the output and the parameters passed to the tools based on these definitions, allowing the backend to determine the next step directly based on specific fields, rather than having to infer priorities from free-form text. While validation can detect mismatches in types or enumerations, the accuracy of the facts contained in the work order still requires verification using source data, business rules, and test samples.

v2.73.0 Update: Separation of Delegation Tasks and Approval Actions

Released on November 24 v2.73.0 Supports explicit opening Child Agent Call Forwarding: In Harness's SubAgents start using forward_deferred_calls=True Afterward, the child agent’s pending calls can be handed over to the parent caller for processing, with the decision to resume from the original history upon return. For example, allowing an assistant to prepare a customer notification does not automatically approve its sending; the approval interface can present the recipients and the content to be sent separately for human verification.

This option is turned off by default and cannot currently be used with task_control Or run continuously and use as needed. By default, pending confirmation states are saved within the same instance of the same process; cross-process recovery requires configuring shared storage. A pending confirmation state can be restored at most once, and this does not replace the duplicate prevention processing of the external sending interface.

Let's start by testing it with a sample work order.

  1. In a Python virtual environment, pressInstallation Guidemounting pydantic-ai, configure a model that supports the required functions. When a subagent is needed, proceed as follows: Harness DocumentationInstall the corresponding package.
  2. Define the work order data model as output_type, First, implement a read-only function that returns simulated records. Prepare three types of work orders—normal, missing fields, and undeterminable—and verify that both the structure and the fact checks meet expectations.
  3. Add another simulation tool that requires approval. No entries should be written to the simulation outbox before approval or when a request is rejected; one entry should be written after approval. Approval records must at least include the operator, action parameters, and decision time to facilitate verification of which call was actually approved. Before connecting to the live channel, verify the handling of timeouts, duplicate submissions, and situations where an action has been executed but no acknowledgment has been received.

How do I choose among similar tools?

artifact More suitable Key Points to Consider During Onboarding
Pydantic AI The Python project already has a data model, and I want to start by connecting the output and tool parameters for validation. Approval and handover of sub-agents must be explicitly enabled; for cross-process operations, a storage mechanism for the "pending approval" status must be designed.
LangGraph The process has branches and checkpoints, and I want to organize pauses and resumptions by node. Approval resumption relies on checkpoints and thread IDs; side effects are handled according to the "rerun by node" rule.
OpenAI Agents SDK Prioritize the use of its agent and tool interfaces; top-level or nested tool approvals must be handled uniformly. Using serializable RunState Handle suspension and resumption, and clarify the respective responsibilities of the call-level and ongoing approval processes

If your current challenge is that “the model provides an answer, but you can’t trust the business code to handle it,” you can start by using Pydantic AI to standardize the output structure. Once you’ve established a workflow that includes human verification, you can then decide whether you need more complex workflow orchestration and recovery mechanisms.

data statistics

Related Navigation

No comments

none
No comments...