Skip to content

feat: add PydanticAIAgentRunner for type-safe network integration#278

Open
Raghavan-04 wants to merge 1 commit intoopenagents-org:developfrom
Raghavan-04:develop
Open

feat: add PydanticAIAgentRunner for type-safe network integration#278
Raghavan-04 wants to merge 1 commit intoopenagents-org:developfrom
Raghavan-04:develop

Conversation

@Raghavan-04
Copy link

@Raghavan-04 Raghavan-04 commented Jan 30, 2026

Description

This PR introduces the PydanticAIAgentRunner, enabling PydanticAI agents to seamlessly connect to the OpenAgents network.

Following the architectural pattern of the existing LangChainAgentRunner, this implementation provides a robust wrapper that allows PydanticAI's type-safe agents to function as first-class citizens within the network. By leveraging PydanticAI, we ensure that agent interactions remain strictly typed and validated, reducing runtime errors across the network.

Capabilities

  • Event Processing: Allows agents to receive and process asynchronous network events.
  • Network Tool Integration: Enables PydanticAI agents to utilize tools provided by the OpenAgents network dynamically.
  • Type-Safe Responses: Guarantees that structured data returned to the network conforms to predefined Pydantic models.

Key Changes

  • New Agent Runner: Created src/openagents/agents/pydantic_ai_agent.py to house the core runner logic.
  • Message Mapping: Implemented high-fidelity mapping from OpenAgents internal message formats to PydanticAI ModelMessage structures.
  • Dynamic Tooling: Added support for registering network-level tools within the PydanticAI run loop, ensuring agents can interact with the environment effectively.

Testing Performed

  • Verified message mapping consistency.
  • Tested basic tool calling via the OpenAgents network protocol.
  • Validated output schema adherence using Pydantic models.

@vercel
Copy link

vercel bot commented Jan 30, 2026

Someone is attempting to deploy a commit to the Raphael's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant