adcp 2.12.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 +364 -0
- adcp/__main__.py +440 -0
- adcp/adagents.py +642 -0
- adcp/client.py +1057 -0
- adcp/config.py +82 -0
- adcp/exceptions.py +185 -0
- adcp/protocols/__init__.py +9 -0
- adcp/protocols/a2a.py +484 -0
- adcp/protocols/base.py +190 -0
- adcp/protocols/mcp.py +440 -0
- adcp/py.typed +0 -0
- adcp/simple.py +451 -0
- adcp/testing/__init__.py +53 -0
- adcp/testing/test_helpers.py +311 -0
- adcp/types/__init__.py +561 -0
- adcp/types/_generated.py +237 -0
- adcp/types/aliases.py +748 -0
- adcp/types/base.py +26 -0
- adcp/types/core.py +174 -0
- adcp/types/generated_poc/__init__.py +3 -0
- adcp/types/generated_poc/adagents.py +411 -0
- adcp/types/generated_poc/core/__init__.py +3 -0
- adcp/types/generated_poc/core/activation_key.py +30 -0
- adcp/types/generated_poc/core/assets/__init__.py +3 -0
- adcp/types/generated_poc/core/assets/audio_asset.py +26 -0
- adcp/types/generated_poc/core/assets/css_asset.py +20 -0
- adcp/types/generated_poc/core/assets/daast_asset.py +61 -0
- adcp/types/generated_poc/core/assets/html_asset.py +18 -0
- adcp/types/generated_poc/core/assets/image_asset.py +19 -0
- adcp/types/generated_poc/core/assets/javascript_asset.py +23 -0
- adcp/types/generated_poc/core/assets/text_asset.py +20 -0
- adcp/types/generated_poc/core/assets/url_asset.py +28 -0
- adcp/types/generated_poc/core/assets/vast_asset.py +63 -0
- adcp/types/generated_poc/core/assets/video_asset.py +24 -0
- adcp/types/generated_poc/core/assets/webhook_asset.py +53 -0
- adcp/types/generated_poc/core/brand_manifest.py +201 -0
- adcp/types/generated_poc/core/context.py +15 -0
- adcp/types/generated_poc/core/creative_asset.py +102 -0
- adcp/types/generated_poc/core/creative_assignment.py +27 -0
- adcp/types/generated_poc/core/creative_filters.py +86 -0
- adcp/types/generated_poc/core/creative_manifest.py +68 -0
- adcp/types/generated_poc/core/creative_policy.py +28 -0
- adcp/types/generated_poc/core/delivery_metrics.py +111 -0
- adcp/types/generated_poc/core/deployment.py +78 -0
- adcp/types/generated_poc/core/destination.py +43 -0
- adcp/types/generated_poc/core/dimensions.py +18 -0
- adcp/types/generated_poc/core/error.py +29 -0
- adcp/types/generated_poc/core/ext.py +15 -0
- adcp/types/generated_poc/core/format.py +260 -0
- adcp/types/generated_poc/core/format_id.py +50 -0
- adcp/types/generated_poc/core/frequency_cap.py +19 -0
- adcp/types/generated_poc/core/measurement.py +40 -0
- adcp/types/generated_poc/core/media_buy.py +40 -0
- adcp/types/generated_poc/core/package.py +68 -0
- adcp/types/generated_poc/core/performance_feedback.py +78 -0
- adcp/types/generated_poc/core/placement.py +37 -0
- adcp/types/generated_poc/core/product.py +164 -0
- adcp/types/generated_poc/core/product_filters.py +97 -0
- adcp/types/generated_poc/core/promoted_offerings.py +102 -0
- adcp/types/generated_poc/core/promoted_products.py +38 -0
- adcp/types/generated_poc/core/property.py +64 -0
- adcp/types/generated_poc/core/property_id.py +21 -0
- adcp/types/generated_poc/core/property_tag.py +21 -0
- adcp/types/generated_poc/core/protocol_envelope.py +61 -0
- adcp/types/generated_poc/core/publisher_property_selector.py +75 -0
- adcp/types/generated_poc/core/push_notification_config.py +51 -0
- adcp/types/generated_poc/core/reporting_capabilities.py +51 -0
- adcp/types/generated_poc/core/response.py +24 -0
- adcp/types/generated_poc/core/signal_filters.py +29 -0
- adcp/types/generated_poc/core/sub_asset.py +55 -0
- adcp/types/generated_poc/core/targeting.py +53 -0
- adcp/types/generated_poc/core/webhook_payload.py +96 -0
- adcp/types/generated_poc/creative/__init__.py +3 -0
- adcp/types/generated_poc/creative/list_creative_formats_request.py +88 -0
- adcp/types/generated_poc/creative/list_creative_formats_response.py +55 -0
- adcp/types/generated_poc/creative/preview_creative_request.py +153 -0
- adcp/types/generated_poc/creative/preview_creative_response.py +169 -0
- adcp/types/generated_poc/creative/preview_render.py +152 -0
- adcp/types/generated_poc/enums/__init__.py +3 -0
- adcp/types/generated_poc/enums/adcp_domain.py +12 -0
- adcp/types/generated_poc/enums/asset_content_type.py +23 -0
- adcp/types/generated_poc/enums/auth_scheme.py +12 -0
- adcp/types/generated_poc/enums/available_metric.py +19 -0
- adcp/types/generated_poc/enums/channels.py +19 -0
- adcp/types/generated_poc/enums/co_branding_requirement.py +13 -0
- adcp/types/generated_poc/enums/creative_action.py +15 -0
- adcp/types/generated_poc/enums/creative_agent_capability.py +14 -0
- adcp/types/generated_poc/enums/creative_sort_field.py +16 -0
- adcp/types/generated_poc/enums/creative_status.py +14 -0
- adcp/types/generated_poc/enums/daast_tracking_event.py +21 -0
- adcp/types/generated_poc/enums/daast_version.py +12 -0
- adcp/types/generated_poc/enums/delivery_type.py +12 -0
- adcp/types/generated_poc/enums/dimension_unit.py +14 -0
- adcp/types/generated_poc/enums/feed_format.py +13 -0
- adcp/types/generated_poc/enums/feedback_source.py +14 -0
- adcp/types/generated_poc/enums/format_category.py +17 -0
- adcp/types/generated_poc/enums/format_id_parameter.py +12 -0
- adcp/types/generated_poc/enums/frequency_cap_scope.py +16 -0
- adcp/types/generated_poc/enums/history_entry_type.py +12 -0
- adcp/types/generated_poc/enums/http_method.py +12 -0
- adcp/types/generated_poc/enums/identifier_types.py +29 -0
- adcp/types/generated_poc/enums/javascript_module_type.py +13 -0
- adcp/types/generated_poc/enums/landing_page_requirement.py +13 -0
- adcp/types/generated_poc/enums/markdown_flavor.py +12 -0
- adcp/types/generated_poc/enums/media_buy_status.py +14 -0
- adcp/types/generated_poc/enums/metric_type.py +18 -0
- adcp/types/generated_poc/enums/notification_type.py +14 -0
- adcp/types/generated_poc/enums/pacing.py +13 -0
- adcp/types/generated_poc/enums/preview_output_format.py +12 -0
- adcp/types/generated_poc/enums/pricing_model.py +17 -0
- adcp/types/generated_poc/enums/property_type.py +17 -0
- adcp/types/generated_poc/enums/publisher_identifier_types.py +15 -0
- adcp/types/generated_poc/enums/reporting_frequency.py +13 -0
- adcp/types/generated_poc/enums/signal_catalog_type.py +13 -0
- adcp/types/generated_poc/enums/sort_direction.py +12 -0
- adcp/types/generated_poc/enums/standard_format_ids.py +45 -0
- adcp/types/generated_poc/enums/task_status.py +19 -0
- adcp/types/generated_poc/enums/task_type.py +15 -0
- adcp/types/generated_poc/enums/update_frequency.py +14 -0
- adcp/types/generated_poc/enums/url_asset_type.py +13 -0
- adcp/types/generated_poc/enums/validation_mode.py +12 -0
- adcp/types/generated_poc/enums/vast_tracking_event.py +26 -0
- adcp/types/generated_poc/enums/vast_version.py +15 -0
- adcp/types/generated_poc/enums/webhook_response_type.py +14 -0
- adcp/types/generated_poc/enums/webhook_security_method.py +13 -0
- adcp/types/generated_poc/media_buy/__init__.py +3 -0
- adcp/types/generated_poc/media_buy/build_creative_request.py +41 -0
- adcp/types/generated_poc/media_buy/build_creative_response.py +51 -0
- adcp/types/generated_poc/media_buy/create_media_buy_request.py +94 -0
- adcp/types/generated_poc/media_buy/create_media_buy_response.py +56 -0
- adcp/types/generated_poc/media_buy/get_media_buy_delivery_request.py +47 -0
- adcp/types/generated_poc/media_buy/get_media_buy_delivery_response.py +235 -0
- adcp/types/generated_poc/media_buy/get_products_request.py +48 -0
- adcp/types/generated_poc/media_buy/get_products_response.py +28 -0
- adcp/types/generated_poc/media_buy/list_authorized_properties_request.py +38 -0
- adcp/types/generated_poc/media_buy/list_authorized_properties_response.py +84 -0
- adcp/types/generated_poc/media_buy/list_creative_formats_request.py +74 -0
- adcp/types/generated_poc/media_buy/list_creative_formats_response.py +56 -0
- adcp/types/generated_poc/media_buy/list_creatives_request.py +76 -0
- adcp/types/generated_poc/media_buy/list_creatives_response.py +214 -0
- adcp/types/generated_poc/media_buy/package_request.py +63 -0
- adcp/types/generated_poc/media_buy/provide_performance_feedback_request.py +125 -0
- adcp/types/generated_poc/media_buy/provide_performance_feedback_response.py +53 -0
- adcp/types/generated_poc/media_buy/sync_creatives_request.py +63 -0
- adcp/types/generated_poc/media_buy/sync_creatives_response.py +105 -0
- adcp/types/generated_poc/media_buy/update_media_buy_request.py +195 -0
- adcp/types/generated_poc/media_buy/update_media_buy_response.py +55 -0
- adcp/types/generated_poc/pricing_options/__init__.py +3 -0
- adcp/types/generated_poc/pricing_options/cpc_option.py +43 -0
- adcp/types/generated_poc/pricing_options/cpcv_option.py +45 -0
- adcp/types/generated_poc/pricing_options/cpm_auction_option.py +58 -0
- adcp/types/generated_poc/pricing_options/cpm_fixed_option.py +43 -0
- adcp/types/generated_poc/pricing_options/cpp_option.py +64 -0
- adcp/types/generated_poc/pricing_options/cpv_option.py +77 -0
- adcp/types/generated_poc/pricing_options/flat_rate_option.py +93 -0
- adcp/types/generated_poc/pricing_options/vcpm_auction_option.py +61 -0
- adcp/types/generated_poc/pricing_options/vcpm_fixed_option.py +47 -0
- adcp/types/generated_poc/protocols/__init__.py +3 -0
- adcp/types/generated_poc/protocols/adcp_extension.py +37 -0
- adcp/types/generated_poc/signals/__init__.py +3 -0
- adcp/types/generated_poc/signals/activate_signal_request.py +32 -0
- adcp/types/generated_poc/signals/activate_signal_response.py +51 -0
- adcp/types/generated_poc/signals/get_signals_request.py +53 -0
- adcp/types/generated_poc/signals/get_signals_response.py +59 -0
- adcp/utils/__init__.py +7 -0
- adcp/utils/operation_id.py +15 -0
- adcp/utils/preview_cache.py +491 -0
- adcp/utils/response_parser.py +171 -0
- adcp/validation.py +172 -0
- adcp-2.12.0.data/data/ADCP_VERSION +1 -0
- adcp-2.12.0.dist-info/METADATA +992 -0
- adcp-2.12.0.dist-info/RECORD +176 -0
- adcp-2.12.0.dist-info/WHEEL +5 -0
- adcp-2.12.0.dist-info/entry_points.txt +2 -0
- adcp-2.12.0.dist-info/licenses/LICENSE +17 -0
- adcp-2.12.0.dist-info/top_level.txt +1 -0
|
@@ -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)
|