Current collected state Current
Observed since 20 Oct, 16:28 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Agent to Agent Protocol Specification Python models
Python models for Google's Agent-to-Agent (A2A) Protocol specification. This package provides both Pydantic and dataclass model implementations, enabling type-safe communication between agents.
Maintained by the team at Legion AI.
pip install a2a-protocol
from a2a_protocol.pydantic_v2 import Message, Part, TextPart, Role
# Create a simple message
message = Message(
role=Role.user,
parts=[
Part(root=TextPart(
type="text",
text="Hello, agent!",
metadata={"source": "user_interface"}
))
],
metadata={"session_id": "12345"}
)
from a2a_protocol.dataclass import Message, TextPart, Role
# Create a simple message using dataclasses
message = Message(
role=Role.user,
parts=[
TextPart(
type="text",
text="Hello, agent!",
metadata={"source": "user_interface"}
)
],
metadata={"session_id": "12345"}
)
TextPart: For text-based messagesFilePart: For file attachmentsDataPart: For structured dataTask: Represents a task with its status, history, and artifactsTaskStatus: Current state of a task (working, completed, failed, etc.)TaskState: Enum of possible task statesJSONRPCRequest: Standard request formatJSONRPCResponse: Standard response formatSendTaskRequest, GetTaskRequest, CancelTaskRequest: Specific request types┌──────────────┐ ┌──────────────┐
│ │ │ │
│ Agent A │◄──────────►│ Agent B │
│ │ A2A │ │
└──────────────┘ Protocol └──────────────┘
│ ▲
│ │
│ ┌──────────┐ │
└────────►│ Tasks │◄──────┘
│ │
└──────────┘
The A2A protocol enables agents to:
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 17 Apr 2025 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 16:28 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:5d46adee7a6bffd7a80b348d439a17fc7d77fcc97eb535c44c2a114434800e1c