AI Agent2Agent
A Python library for Agent-to-Agent communication.
Installation
pip install ai_agent2agent
Usage
Client
from agent2agent import A2AClient, A2ACardResolver
# Initialize client
client = A2AClient(url="https://your-agent-endpoint.com", api_key="your-api-key")
# Example: Send a task to an agent
response = client.send_task(
message={
"role": "user",
"parts": [{"type": "text", "text": "Hello, Agent!"}]
}
)
# Print the task ID
print(f"Task ID: {response.id}")
Server
from agent2agent import A2AServer, InMemoryTaskManager
# Initialize server with an in-memory task manager
task_manager = InMemoryTaskManager()
server = A2AServer(task_manager=task_manager)
# Register handler for tasks
@server.handle_task
async def handle_task(task):
# Process the task
return {
"role": "agent",
"parts": [{"type": "text", "text": "Task completed!"}]
}
# Run the server (depends on your web framework)
Features
- Client-server architecture for agent communication
- Support for various message types (text, files, data)
- Task management with different states
- In-memory caching
- Push notification support
License
MIT
Release files for ai-agent2agent 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ai_agent2agent-0.1.1.tar.gz | 12.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_agent2agent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.6 kB
Release files / ai_agent2agent-0.1.1.tar.gz
| Download URL | ai_agent2agent-0.1.1.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71f049b58a382a08b11a0cb201b5d71c546abf84eef24a875f7a21f96e6c5d4a
|
|
BLAKE2b-256 checksum How to use checksums |
057f03d742e3f00409c86d4fc9d061871983c4c93635741b4ef86051b07a5bb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / ai_agent2agent-0.1.1-py3-none-any.whl
| Download URL | ai_agent2agent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70c52c2b3f89cfd02e97b20e0c1ee69266e989ecf7051f5b6b97050ad5295dff
|
|
BLAKE2b-256 checksum How to use checksums |
ad6f667d6f2016509639c31ff4d0e994dce6964e979d27499657aff12ea3a84e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|