adcp 1.2.1__py3-none-any.whl → 1.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adcp/__init__.py +24 -1
- adcp/testing/__init__.py +38 -0
- adcp/testing/test_helpers.py +311 -0
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/METADATA +136 -1
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/RECORD +9 -7
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/WHEEL +0 -0
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/entry_points.txt +0 -0
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/licenses/LICENSE +0 -0
- {adcp-1.2.1.dist-info → adcp-1.3.0.dist-info}/top_level.txt +0 -0
adcp/__init__.py
CHANGED
|
@@ -18,6 +18,19 @@ from adcp.exceptions import (
|
|
|
18
18
|
ADCPWebhookError,
|
|
19
19
|
ADCPWebhookSignatureError,
|
|
20
20
|
)
|
|
21
|
+
|
|
22
|
+
# Test helpers
|
|
23
|
+
from adcp.testing import (
|
|
24
|
+
CREATIVE_AGENT_CONFIG,
|
|
25
|
+
TEST_AGENT_A2A_CONFIG,
|
|
26
|
+
TEST_AGENT_MCP_CONFIG,
|
|
27
|
+
TEST_AGENT_TOKEN,
|
|
28
|
+
create_test_agent,
|
|
29
|
+
creative_agent,
|
|
30
|
+
test_agent,
|
|
31
|
+
test_agent_a2a,
|
|
32
|
+
test_agent_client,
|
|
33
|
+
)
|
|
21
34
|
from adcp.types.core import AgentConfig, Protocol, TaskResult, TaskStatus, WebhookMetadata
|
|
22
35
|
from adcp.types.generated import (
|
|
23
36
|
ActivateSignalError,
|
|
@@ -133,7 +146,7 @@ from adcp.types.generated import (
|
|
|
133
146
|
TaskStatus as GeneratedTaskStatus,
|
|
134
147
|
)
|
|
135
148
|
|
|
136
|
-
__version__ = "1.
|
|
149
|
+
__version__ = "1.3.0"
|
|
137
150
|
|
|
138
151
|
__all__ = [
|
|
139
152
|
# Client classes
|
|
@@ -145,6 +158,16 @@ __all__ = [
|
|
|
145
158
|
"TaskResult",
|
|
146
159
|
"TaskStatus",
|
|
147
160
|
"WebhookMetadata",
|
|
161
|
+
# Test helpers
|
|
162
|
+
"test_agent",
|
|
163
|
+
"test_agent_a2a",
|
|
164
|
+
"creative_agent",
|
|
165
|
+
"test_agent_client",
|
|
166
|
+
"create_test_agent",
|
|
167
|
+
"TEST_AGENT_TOKEN",
|
|
168
|
+
"TEST_AGENT_MCP_CONFIG",
|
|
169
|
+
"TEST_AGENT_A2A_CONFIG",
|
|
170
|
+
"CREATIVE_AGENT_CONFIG",
|
|
148
171
|
# Exceptions
|
|
149
172
|
"ADCPError",
|
|
150
173
|
"ADCPConnectionError",
|
adcp/testing/__init__.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Test helpers for AdCP client library.
|
|
2
|
+
|
|
3
|
+
Provides pre-configured test agents for examples and quick testing.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from adcp.testing.test_helpers import (
|
|
9
|
+
CREATIVE_AGENT_CONFIG,
|
|
10
|
+
TEST_AGENT_A2A_CONFIG,
|
|
11
|
+
TEST_AGENT_A2A_NO_AUTH_CONFIG,
|
|
12
|
+
TEST_AGENT_MCP_CONFIG,
|
|
13
|
+
TEST_AGENT_MCP_NO_AUTH_CONFIG,
|
|
14
|
+
TEST_AGENT_TOKEN,
|
|
15
|
+
create_test_agent,
|
|
16
|
+
creative_agent,
|
|
17
|
+
test_agent,
|
|
18
|
+
test_agent_a2a,
|
|
19
|
+
test_agent_a2a_no_auth,
|
|
20
|
+
test_agent_client,
|
|
21
|
+
test_agent_no_auth,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"test_agent",
|
|
26
|
+
"test_agent_a2a",
|
|
27
|
+
"test_agent_no_auth",
|
|
28
|
+
"test_agent_a2a_no_auth",
|
|
29
|
+
"creative_agent",
|
|
30
|
+
"test_agent_client",
|
|
31
|
+
"create_test_agent",
|
|
32
|
+
"TEST_AGENT_TOKEN",
|
|
33
|
+
"TEST_AGENT_MCP_CONFIG",
|
|
34
|
+
"TEST_AGENT_A2A_CONFIG",
|
|
35
|
+
"TEST_AGENT_MCP_NO_AUTH_CONFIG",
|
|
36
|
+
"TEST_AGENT_A2A_NO_AUTH_CONFIG",
|
|
37
|
+
"CREATIVE_AGENT_CONFIG",
|
|
38
|
+
]
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"""Test agent helpers for easy examples and quick testing.
|
|
2
|
+
|
|
3
|
+
These provide pre-configured access to AdCP's public test agent.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
from adcp.client import ADCPClient, ADCPMultiAgentClient
|
|
11
|
+
from adcp.types.core import AgentConfig, Protocol
|
|
12
|
+
|
|
13
|
+
# Public test agent auth token
|
|
14
|
+
# This token is public and rate-limited, for testing/examples only.
|
|
15
|
+
TEST_AGENT_TOKEN = "1v8tAhASaUYYp4odoQ1PnMpdqNaMiTrCRqYo9OJp6IQ"
|
|
16
|
+
|
|
17
|
+
# Public test agent configuration - MCP protocol
|
|
18
|
+
TEST_AGENT_MCP_CONFIG = AgentConfig(
|
|
19
|
+
id="test-agent-mcp",
|
|
20
|
+
agent_uri="https://test-agent.adcontextprotocol.org/mcp/",
|
|
21
|
+
protocol=Protocol.MCP,
|
|
22
|
+
auth_token=TEST_AGENT_TOKEN,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# Public test agent configuration - A2A protocol
|
|
26
|
+
TEST_AGENT_A2A_CONFIG = AgentConfig(
|
|
27
|
+
id="test-agent-a2a",
|
|
28
|
+
agent_uri="https://test-agent.adcontextprotocol.org",
|
|
29
|
+
protocol=Protocol.A2A,
|
|
30
|
+
auth_token=TEST_AGENT_TOKEN,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Public test agent configuration (no auth) - MCP protocol
|
|
34
|
+
TEST_AGENT_MCP_NO_AUTH_CONFIG = AgentConfig(
|
|
35
|
+
id="test-agent-mcp-no-auth",
|
|
36
|
+
agent_uri="https://test-agent.adcontextprotocol.org/mcp/",
|
|
37
|
+
protocol=Protocol.MCP,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Public test agent configuration (no auth) - A2A protocol
|
|
41
|
+
TEST_AGENT_A2A_NO_AUTH_CONFIG = AgentConfig(
|
|
42
|
+
id="test-agent-a2a-no-auth",
|
|
43
|
+
agent_uri="https://test-agent.adcontextprotocol.org",
|
|
44
|
+
protocol=Protocol.A2A,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Reference creative agent configuration - MCP protocol
|
|
48
|
+
# No authentication required for the reference creative agent
|
|
49
|
+
CREATIVE_AGENT_CONFIG = AgentConfig(
|
|
50
|
+
id="creative-agent",
|
|
51
|
+
agent_uri="https://creative.adcontextprotocol.org/mcp",
|
|
52
|
+
protocol=Protocol.MCP,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _create_test_agent_client() -> ADCPClient:
|
|
57
|
+
"""Create pre-configured test agent client using MCP protocol.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
ADCPClient instance configured for the public test agent
|
|
61
|
+
|
|
62
|
+
Note:
|
|
63
|
+
This agent is rate-limited and intended for testing/examples only.
|
|
64
|
+
The auth token is public and may be rotated without notice.
|
|
65
|
+
DO NOT use in production applications.
|
|
66
|
+
"""
|
|
67
|
+
return ADCPClient(TEST_AGENT_MCP_CONFIG)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _create_test_agent_a2a_client() -> ADCPClient:
|
|
71
|
+
"""Create pre-configured test agent client using A2A protocol.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
ADCPClient instance configured for the public test agent
|
|
75
|
+
|
|
76
|
+
Note:
|
|
77
|
+
This agent is rate-limited and intended for testing/examples only.
|
|
78
|
+
The auth token is public and may be rotated without notice.
|
|
79
|
+
DO NOT use in production applications.
|
|
80
|
+
"""
|
|
81
|
+
return ADCPClient(TEST_AGENT_A2A_CONFIG)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _create_test_agent_no_auth_client() -> ADCPClient:
|
|
85
|
+
"""Create pre-configured test agent client (no auth) using MCP protocol.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
ADCPClient instance configured for the public test agent without authentication
|
|
89
|
+
|
|
90
|
+
Note:
|
|
91
|
+
This agent is rate-limited and intended for testing scenarios where no auth is provided.
|
|
92
|
+
Useful for testing behavior differences between authenticated and unauthenticated requests.
|
|
93
|
+
DO NOT use in production applications.
|
|
94
|
+
"""
|
|
95
|
+
return ADCPClient(TEST_AGENT_MCP_NO_AUTH_CONFIG)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _create_test_agent_a2a_no_auth_client() -> ADCPClient:
|
|
99
|
+
"""Create pre-configured test agent client (no auth) using A2A protocol.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
ADCPClient instance configured for the public test agent without authentication
|
|
103
|
+
|
|
104
|
+
Note:
|
|
105
|
+
This agent is rate-limited and intended for testing scenarios where no auth is provided.
|
|
106
|
+
Useful for testing behavior differences between authenticated and unauthenticated requests.
|
|
107
|
+
DO NOT use in production applications.
|
|
108
|
+
"""
|
|
109
|
+
return ADCPClient(TEST_AGENT_A2A_NO_AUTH_CONFIG)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _create_creative_agent_client() -> ADCPClient:
|
|
113
|
+
"""Create pre-configured creative agent client.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
ADCPClient instance configured for the reference creative agent
|
|
117
|
+
|
|
118
|
+
Note:
|
|
119
|
+
The reference creative agent is public and requires no authentication.
|
|
120
|
+
It provides creative preview functionality for testing and examples.
|
|
121
|
+
"""
|
|
122
|
+
return ADCPClient(CREATIVE_AGENT_CONFIG)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _create_test_multi_agent_client() -> ADCPMultiAgentClient:
|
|
126
|
+
"""Create multi-agent client with both test agents configured.
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
ADCPMultiAgentClient with both MCP and A2A test agents
|
|
130
|
+
|
|
131
|
+
Note:
|
|
132
|
+
This client is rate-limited and intended for testing/examples only.
|
|
133
|
+
DO NOT use in production applications.
|
|
134
|
+
"""
|
|
135
|
+
return ADCPMultiAgentClient([TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG])
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
# Pre-configured test agent client using MCP protocol.
|
|
139
|
+
# Ready to use for examples, documentation, and quick testing.
|
|
140
|
+
#
|
|
141
|
+
# Example:
|
|
142
|
+
# ```python
|
|
143
|
+
# from adcp.testing import test_agent
|
|
144
|
+
#
|
|
145
|
+
# # Simple get_products call
|
|
146
|
+
# result = await test_agent.get_products(
|
|
147
|
+
# GetProductsRequest(
|
|
148
|
+
# brief="Coffee subscription service for busy professionals",
|
|
149
|
+
# promoted_offering="Premium monthly coffee deliveries"
|
|
150
|
+
# )
|
|
151
|
+
# )
|
|
152
|
+
#
|
|
153
|
+
# if result.success:
|
|
154
|
+
# print(f"Found {len(result.data.products)} products")
|
|
155
|
+
# ```
|
|
156
|
+
#
|
|
157
|
+
# Note:
|
|
158
|
+
# This agent is rate-limited and intended for testing/examples only.
|
|
159
|
+
# The auth token is public and may be rotated without notice.
|
|
160
|
+
# DO NOT use in production applications.
|
|
161
|
+
test_agent: ADCPClient = _create_test_agent_client()
|
|
162
|
+
|
|
163
|
+
# Pre-configured test agent client using A2A protocol.
|
|
164
|
+
# Identical functionality to test_agent but uses A2A instead of MCP.
|
|
165
|
+
#
|
|
166
|
+
# Example:
|
|
167
|
+
# ```python
|
|
168
|
+
# from adcp.testing import test_agent_a2a
|
|
169
|
+
#
|
|
170
|
+
# result = await test_agent_a2a.get_products(
|
|
171
|
+
# GetProductsRequest(
|
|
172
|
+
# brief="Sustainable fashion brands",
|
|
173
|
+
# promoted_offering="Eco-friendly clothing"
|
|
174
|
+
# )
|
|
175
|
+
# )
|
|
176
|
+
# ```
|
|
177
|
+
#
|
|
178
|
+
# Note:
|
|
179
|
+
# This agent is rate-limited and intended for testing/examples only.
|
|
180
|
+
# The auth token is public and may be rotated without notice.
|
|
181
|
+
# DO NOT use in production applications.
|
|
182
|
+
test_agent_a2a: ADCPClient = _create_test_agent_a2a_client()
|
|
183
|
+
|
|
184
|
+
# Pre-configured test agent client (no auth) using MCP protocol.
|
|
185
|
+
# Useful for testing scenarios where authentication is not provided,
|
|
186
|
+
# such as testing how agents handle unauthenticated requests or
|
|
187
|
+
# comparing behavior between authenticated and unauthenticated calls.
|
|
188
|
+
#
|
|
189
|
+
# Example:
|
|
190
|
+
# ```python
|
|
191
|
+
# from adcp.testing import test_agent_no_auth
|
|
192
|
+
#
|
|
193
|
+
# # Test behavior without authentication
|
|
194
|
+
# result = await test_agent_no_auth.get_products(
|
|
195
|
+
# GetProductsRequest(
|
|
196
|
+
# brief="Coffee subscription service",
|
|
197
|
+
# promoted_offering="Premium monthly coffee"
|
|
198
|
+
# )
|
|
199
|
+
# )
|
|
200
|
+
# ```
|
|
201
|
+
#
|
|
202
|
+
# Note:
|
|
203
|
+
# This agent is rate-limited and intended for testing/examples only.
|
|
204
|
+
# DO NOT use in production applications.
|
|
205
|
+
test_agent_no_auth: ADCPClient = _create_test_agent_no_auth_client()
|
|
206
|
+
|
|
207
|
+
# Pre-configured test agent client (no auth) using A2A protocol.
|
|
208
|
+
# Identical functionality to test_agent_no_auth but uses A2A instead of MCP.
|
|
209
|
+
#
|
|
210
|
+
# Example:
|
|
211
|
+
# ```python
|
|
212
|
+
# from adcp.testing import test_agent_a2a_no_auth
|
|
213
|
+
#
|
|
214
|
+
# # Test A2A behavior without authentication
|
|
215
|
+
# result = await test_agent_a2a_no_auth.get_products(
|
|
216
|
+
# GetProductsRequest(
|
|
217
|
+
# brief="Sustainable fashion brands",
|
|
218
|
+
# promoted_offering="Eco-friendly clothing"
|
|
219
|
+
# )
|
|
220
|
+
# )
|
|
221
|
+
# ```
|
|
222
|
+
#
|
|
223
|
+
# Note:
|
|
224
|
+
# This agent is rate-limited and intended for testing/examples only.
|
|
225
|
+
# DO NOT use in production applications.
|
|
226
|
+
test_agent_a2a_no_auth: ADCPClient = _create_test_agent_a2a_no_auth_client()
|
|
227
|
+
|
|
228
|
+
# Pre-configured reference creative agent.
|
|
229
|
+
# Provides creative preview functionality without authentication.
|
|
230
|
+
#
|
|
231
|
+
# Example:
|
|
232
|
+
# ```python
|
|
233
|
+
# from adcp.testing import creative_agent
|
|
234
|
+
# from adcp.types.generated import PreviewCreativeRequest
|
|
235
|
+
#
|
|
236
|
+
# result = await creative_agent.preview_creative(
|
|
237
|
+
# PreviewCreativeRequest(
|
|
238
|
+
# manifest={
|
|
239
|
+
# "format_id": "banner_300x250",
|
|
240
|
+
# "assets": {...}
|
|
241
|
+
# }
|
|
242
|
+
# )
|
|
243
|
+
# )
|
|
244
|
+
# ```
|
|
245
|
+
#
|
|
246
|
+
# Note:
|
|
247
|
+
# The reference creative agent is public and requires no authentication.
|
|
248
|
+
# Perfect for testing creative rendering and preview functionality.
|
|
249
|
+
creative_agent: ADCPClient = _create_creative_agent_client()
|
|
250
|
+
|
|
251
|
+
# Multi-agent client with both test agents configured.
|
|
252
|
+
# Useful for testing multi-agent patterns and protocol comparisons.
|
|
253
|
+
#
|
|
254
|
+
# Example:
|
|
255
|
+
# ```python
|
|
256
|
+
# from adcp.testing import test_agent_client
|
|
257
|
+
#
|
|
258
|
+
# # Access individual agents
|
|
259
|
+
# mcp_agent = test_agent_client.agent("test-agent-mcp")
|
|
260
|
+
# a2a_agent = test_agent_client.agent("test-agent-a2a")
|
|
261
|
+
#
|
|
262
|
+
# # Use for parallel operations
|
|
263
|
+
# results = await test_agent_client.get_products(
|
|
264
|
+
# GetProductsRequest(
|
|
265
|
+
# brief="Premium coffee brands",
|
|
266
|
+
# promoted_offering="Artisan coffee"
|
|
267
|
+
# )
|
|
268
|
+
# )
|
|
269
|
+
# ```
|
|
270
|
+
#
|
|
271
|
+
# Note:
|
|
272
|
+
# This client is rate-limited and intended for testing/examples only.
|
|
273
|
+
# DO NOT use in production applications.
|
|
274
|
+
test_agent_client: ADCPMultiAgentClient = _create_test_multi_agent_client()
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def create_test_agent(**overrides: Any) -> AgentConfig:
|
|
278
|
+
"""Create a custom test agent configuration.
|
|
279
|
+
|
|
280
|
+
Useful when you need to modify the default test agent setup.
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
**overrides: Keyword arguments to override default config values
|
|
284
|
+
|
|
285
|
+
Returns:
|
|
286
|
+
Complete agent configuration
|
|
287
|
+
|
|
288
|
+
Example:
|
|
289
|
+
```python
|
|
290
|
+
from adcp.testing import create_test_agent
|
|
291
|
+
from adcp.client import ADCPClient
|
|
292
|
+
|
|
293
|
+
# Use default test agent with custom ID
|
|
294
|
+
config = create_test_agent(id="my-test-agent")
|
|
295
|
+
client = ADCPClient(config)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Example:
|
|
299
|
+
```python
|
|
300
|
+
# Use A2A protocol instead of MCP
|
|
301
|
+
from adcp.types.core import Protocol
|
|
302
|
+
|
|
303
|
+
config = create_test_agent(
|
|
304
|
+
protocol=Protocol.A2A,
|
|
305
|
+
agent_uri="https://test-agent.adcontextprotocol.org"
|
|
306
|
+
)
|
|
307
|
+
```
|
|
308
|
+
"""
|
|
309
|
+
base_config = TEST_AGENT_MCP_CONFIG.model_dump()
|
|
310
|
+
base_config.update(overrides)
|
|
311
|
+
return AgentConfig(**base_config)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adcp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Official Python client for the Ad Context Protocol (AdCP)
|
|
5
5
|
Author-email: AdCP Community <maintainers@adcontextprotocol.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -61,8 +61,43 @@ pip install adcp
|
|
|
61
61
|
|
|
62
62
|
> **Note**: This client requires Python 3.10 or later and supports both synchronous and asynchronous workflows.
|
|
63
63
|
|
|
64
|
+
## Quick Start: Test Helpers
|
|
65
|
+
|
|
66
|
+
The fastest way to get started is using the pre-configured test agents:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from adcp.testing import test_agent
|
|
70
|
+
from adcp.types.generated import GetProductsRequest
|
|
71
|
+
|
|
72
|
+
# Zero configuration - just import and use!
|
|
73
|
+
result = await test_agent.get_products(
|
|
74
|
+
GetProductsRequest(
|
|
75
|
+
brief="Coffee subscription service",
|
|
76
|
+
promoted_offering="Premium coffee deliveries"
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
if result.success:
|
|
81
|
+
print(f"Found {len(result.data.products)} products")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Test helpers include:
|
|
85
|
+
- **`test_agent`**: Pre-configured MCP test agent with authentication
|
|
86
|
+
- **`test_agent_a2a`**: Pre-configured A2A test agent with authentication
|
|
87
|
+
- **`test_agent_no_auth`**: Pre-configured MCP test agent WITHOUT authentication
|
|
88
|
+
- **`test_agent_a2a_no_auth`**: Pre-configured A2A test agent WITHOUT authentication
|
|
89
|
+
- **`creative_agent`**: Reference creative agent for preview functionality
|
|
90
|
+
- **`test_agent_client`**: Multi-agent client with both protocols
|
|
91
|
+
- **`create_test_agent()`**: Factory for custom test configurations
|
|
92
|
+
|
|
93
|
+
> **Note**: Test agents are rate-limited and for testing/examples only. DO NOT use in production.
|
|
94
|
+
|
|
95
|
+
See [examples/test_helpers_demo.py](examples/test_helpers_demo.py) for more examples.
|
|
96
|
+
|
|
64
97
|
## Quick Start: Distributed Operations
|
|
65
98
|
|
|
99
|
+
For production use, configure your own agents:
|
|
100
|
+
|
|
66
101
|
```python
|
|
67
102
|
from adcp import ADCPMultiAgentClient, AgentConfig, GetProductsRequest
|
|
68
103
|
|
|
@@ -112,6 +147,66 @@ async with ADCPMultiAgentClient(
|
|
|
112
147
|
|
|
113
148
|
## Features
|
|
114
149
|
|
|
150
|
+
### Test Helpers
|
|
151
|
+
|
|
152
|
+
Pre-configured test agents for instant prototyping and testing:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from adcp.testing import (
|
|
156
|
+
test_agent, test_agent_a2a,
|
|
157
|
+
test_agent_no_auth, test_agent_a2a_no_auth,
|
|
158
|
+
creative_agent, test_agent_client, create_test_agent
|
|
159
|
+
)
|
|
160
|
+
from adcp.types.generated import GetProductsRequest, PreviewCreativeRequest
|
|
161
|
+
|
|
162
|
+
# 1. Single agent with authentication (MCP)
|
|
163
|
+
result = await test_agent.get_products(
|
|
164
|
+
GetProductsRequest(brief="Coffee brands")
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
# 2. Single agent with authentication (A2A)
|
|
168
|
+
result = await test_agent_a2a.get_products(
|
|
169
|
+
GetProductsRequest(brief="Coffee brands")
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# 3. Single agent WITHOUT authentication (MCP)
|
|
173
|
+
# Useful for testing unauthenticated behavior
|
|
174
|
+
result = await test_agent_no_auth.get_products(
|
|
175
|
+
GetProductsRequest(brief="Coffee brands")
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# 4. Single agent WITHOUT authentication (A2A)
|
|
179
|
+
result = await test_agent_a2a_no_auth.get_products(
|
|
180
|
+
GetProductsRequest(brief="Coffee brands")
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# 5. Creative agent (preview functionality, no auth required)
|
|
184
|
+
result = await creative_agent.preview_creative(
|
|
185
|
+
PreviewCreativeRequest(
|
|
186
|
+
manifest={"format_id": "banner_300x250", "assets": {...}}
|
|
187
|
+
)
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
# 6. Multi-agent (parallel execution with both protocols)
|
|
191
|
+
results = await test_agent_client.get_products(
|
|
192
|
+
GetProductsRequest(brief="Coffee brands")
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
# 7. Custom configuration
|
|
196
|
+
from adcp.client import ADCPClient
|
|
197
|
+
config = create_test_agent(id="my-test", timeout=60.0)
|
|
198
|
+
client = ADCPClient(config)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Use cases:**
|
|
202
|
+
- Quick prototyping and experimentation
|
|
203
|
+
- Example code and documentation
|
|
204
|
+
- Integration testing without mock servers
|
|
205
|
+
- Testing authentication behavior (comparing auth vs no-auth results)
|
|
206
|
+
- Learning AdCP concepts
|
|
207
|
+
|
|
208
|
+
**Important:** Test agents are public, rate-limited, and for testing only. Never use in production.
|
|
209
|
+
|
|
115
210
|
### Full Protocol Support
|
|
116
211
|
- **A2A Protocol**: Native support for Agent-to-Agent protocol
|
|
117
212
|
- **MCP Protocol**: Native support for Model Context Protocol
|
|
@@ -377,6 +472,46 @@ uvx adcp --json myagent get_products '{"brief":"TV ads"}'
|
|
|
377
472
|
uvx adcp --debug myagent get_products '{"brief":"TV ads"}'
|
|
378
473
|
```
|
|
379
474
|
|
|
475
|
+
### Using Test Agents from CLI
|
|
476
|
+
|
|
477
|
+
The CLI provides easy access to public test agents without configuration:
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
# Use test agent with authentication (MCP)
|
|
481
|
+
uvx adcp https://test-agent.adcontextprotocol.org/mcp/ \
|
|
482
|
+
--auth 1v8tAhASaUYYp4odoQ1PnMpdqNaMiTrCRqYo9OJp6IQ \
|
|
483
|
+
get_products '{"brief":"Coffee brands"}'
|
|
484
|
+
|
|
485
|
+
# Use test agent WITHOUT authentication (MCP)
|
|
486
|
+
uvx adcp https://test-agent.adcontextprotocol.org/mcp/ \
|
|
487
|
+
get_products '{"brief":"Coffee brands"}'
|
|
488
|
+
|
|
489
|
+
# Use test agent with authentication (A2A)
|
|
490
|
+
uvx adcp --protocol a2a \
|
|
491
|
+
--auth 1v8tAhASaUYYp4odoQ1PnMpdqNaMiTrCRqYo9OJp6IQ \
|
|
492
|
+
https://test-agent.adcontextprotocol.org \
|
|
493
|
+
get_products '{"brief":"Coffee brands"}'
|
|
494
|
+
|
|
495
|
+
# Save test agent for easier access
|
|
496
|
+
uvx adcp --save-auth test-agent https://test-agent.adcontextprotocol.org/mcp/ mcp
|
|
497
|
+
# Enter token when prompted: 1v8tAhASaUYYp4odoQ1PnMpdqNaMiTrCRqYo9OJp6IQ
|
|
498
|
+
|
|
499
|
+
# Now use saved config
|
|
500
|
+
uvx adcp test-agent get_products '{"brief":"Coffee brands"}'
|
|
501
|
+
|
|
502
|
+
# Use creative agent (no auth required)
|
|
503
|
+
uvx adcp https://creative.adcontextprotocol.org/mcp \
|
|
504
|
+
preview_creative @creative_manifest.json
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
**Test Agent Details:**
|
|
508
|
+
- **URL (MCP)**: `https://test-agent.adcontextprotocol.org/mcp/`
|
|
509
|
+
- **URL (A2A)**: `https://test-agent.adcontextprotocol.org`
|
|
510
|
+
- **Auth Token**: `1v8tAhASaUYYp4odoQ1PnMpdqNaMiTrCRqYo9OJp6IQ` (optional, public token)
|
|
511
|
+
- **Rate Limited**: For testing only, not for production
|
|
512
|
+
- **No Auth Mode**: Omit `--auth` flag to test unauthenticated behavior
|
|
513
|
+
```
|
|
514
|
+
|
|
380
515
|
### Configuration Management
|
|
381
516
|
|
|
382
517
|
```bash
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
adcp/__init__.py,sha256=
|
|
1
|
+
adcp/__init__.py,sha256=FRJ5kL682ZQiohuDyzUzwLvrOEUM7Hjy0aavfo4g4gc,6724
|
|
2
2
|
adcp/__main__.py,sha256=Avy_C71rruh2lOuojvuXDj09tkFOaek74nJ-dbx25Sw,12838
|
|
3
3
|
adcp/client.py,sha256=co4tKdkjDrqZltCUPcYwVRr8LQfbBbG-DLjapLjcVuo,28246
|
|
4
4
|
adcp/config.py,sha256=Vsy7ZPOI8G3fB_i5Nk-CHbC7wdasCUWuKlos0fwA0kY,2017
|
|
@@ -7,6 +7,8 @@ adcp/protocols/__init__.py,sha256=6UFwACQ0QadBUzy17wUROHqsJDp8ztPW2jzyl53Zh_g,26
|
|
|
7
7
|
adcp/protocols/a2a.py,sha256=FHgc6G_eU2qD0vH7_RyS1eZvUFSb2j3-EsceoHPi384,12467
|
|
8
8
|
adcp/protocols/base.py,sha256=vBHD23Fzl_CCk_Gy9nvSbBYopcJlYkYyzoz-rhI8wHg,5214
|
|
9
9
|
adcp/protocols/mcp.py,sha256=eIk8snCinZm-ZjdarGVMt5nEYJ4_8POM9Fa5Mkw7xxU,15902
|
|
10
|
+
adcp/testing/__init__.py,sha256=kPsRncZ42g4HpOljVwLrFXm2O28K5NKcPUtvykfYY6M,888
|
|
11
|
+
adcp/testing/test_helpers.py,sha256=4n8fZYy1cVpjZpFW2SxBzpC8fmY-MBFrzY4tIPqe4rQ,10028
|
|
10
12
|
adcp/types/__init__.py,sha256=3E_TJUXqQQFcjmSZZSPLwqBP3s_ijsH2LDeuOU-MP30,402
|
|
11
13
|
adcp/types/core.py,sha256=RXkKCWCXS9BVJTNpe3Opm5O1I_LaQPMUuVwa-ipvS1Q,4839
|
|
12
14
|
adcp/types/generated.py,sha256=Ig4ucbJzKRuHlwYzsqvMF9M3w2KghhQQqsXuOnBqVMM,74993
|
|
@@ -15,9 +17,9 @@ adcp/utils/__init__.py,sha256=uetvSJB19CjQbtwEYZiTnumJG11GsafQmXm5eR3hL7E,153
|
|
|
15
17
|
adcp/utils/operation_id.py,sha256=wQX9Bb5epXzRq23xoeYPTqzu5yLuhshg7lKJZihcM2k,294
|
|
16
18
|
adcp/utils/preview_cache.py,sha256=8_2qs5CgrHv1_WOnD4bs43VWueu-rcZRu5PZMQ_lyuE,17573
|
|
17
19
|
adcp/utils/response_parser.py,sha256=uPk2vIH-RYZmq7y3i8lC4HTMQ3FfKdlgXKTjgJ1955M,6253
|
|
18
|
-
adcp-1.
|
|
19
|
-
adcp-1.
|
|
20
|
-
adcp-1.
|
|
21
|
-
adcp-1.
|
|
22
|
-
adcp-1.
|
|
23
|
-
adcp-1.
|
|
20
|
+
adcp-1.3.0.dist-info/licenses/LICENSE,sha256=PF39NR3Ae8PLgBhg3Uxw6ju7iGVIf8hfv9LRWQdii_U,629
|
|
21
|
+
adcp-1.3.0.dist-info/METADATA,sha256=QQQ8zxzwIelNWUxz-ZBTTgpORHp9RrxT-1BnjFZ5S_o,19097
|
|
22
|
+
adcp-1.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
adcp-1.3.0.dist-info/entry_points.txt,sha256=DQKpcGsJX8DtVI_SGApQ7tNvqUB4zkTLaTAEpFgmi3U,44
|
|
24
|
+
adcp-1.3.0.dist-info/top_level.txt,sha256=T1_NF0GefncFU9v_k56oDwKSJREyCqIM8lAwNZf0EOs,5
|
|
25
|
+
adcp-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|