You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out the [Native A2A Support samples](https://github.com/strands-agents/samples/tree/main/03-integrations/Native-A2A-Support) for complete, ready-to-run client, server and tool implementations.
26
+
24
27
## Installation
25
28
26
29
To use A2A functionality with Strands, install the package with the A2A extra:
@@ -67,12 +70,16 @@ a2a_server.serve()
67
70
The `A2AServer` constructor accepts several configuration options:
68
71
69
72
-`agent`: The Strands Agent to wrap with A2A compatibility
70
-
-`host`: Hostname or IP address to bind to (default: "0.0.0.0")
73
+
-`host`: Hostname or IP address to bind to (default: "127.0.0.1")
71
74
-`port`: Port to bind to (default: 9000)
72
75
-`version`: Version of the agent (default: "0.0.1")
73
76
-`skills`: Custom list of agent skills (default: auto-generated from tools)
74
77
-`http_url`: Public HTTP URL where this agent will be accessible (optional, enables path-based mounting)
75
78
-`serve_at_root`: Forces server to serve at root path regardless of http_url path (default: False)
79
+
-`task_store`: Custom task storage implementation (defaults to InMemoryTaskStore)
Custom implementations must follow these interfaces:
145
+
146
+
-`task_store`: Must implement `TaskStore` interface from `a2a.server.tasks`
147
+
-`queue_manager`: Must implement `QueueManager` interface from `a2a.server.events`
148
+
-`push_config_store`: Must implement `PushNotificationConfigStore` interface from `a2a.server.tasks`
149
+
-`push_sender`: Must implement `PushNotificationSender` interface from `a2a.server.tasks`
150
+
103
151
#### Path-Based Mounting for Containerized Deployments
104
152
105
153
The `A2AServer` supports automatic path-based mounting for deployment scenarios involving load balancers or reverse proxies. This allows you to deploy agents behind load balancers with different path prefixes.
@@ -135,6 +183,7 @@ This flexibility allows you to:
135
183
- Add custom middleware
136
184
- Implement additional API endpoints
137
185
- Deploy agents behind load balancers with different path prefixes
186
+
- Configure custom task storage and event handling components
138
187
139
188
## A2A Client Examples
140
189
@@ -145,42 +194,58 @@ Here's how to create a client that communicates with an A2A server synchronously
145
194
```python
146
195
import asyncio
147
196
import logging
148
-
from typing import Any
149
197
from uuid import uuid4
198
+
150
199
import httpx
151
-
from a2a.client import A2ACardResolver, A2AClient
152
-
from a2a.types importMessageSendParams, SendMessageRequest
200
+
from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
201
+
from a2a.types importMessage, Part, Role, TextPart
153
202
154
203
logging.basicConfig(level=logging.INFO)
155
204
logger = logging.getLogger(__name__)
156
205
157
206
DEFAULT_TIMEOUT=300# set request timeout to 5 minutes
0 commit comments