adcp 2.7.0__py3-none-any.whl → 2.9.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 +7 -4
- adcp/__main__.py +31 -3
- adcp/client.py +200 -0
- adcp/protocols/a2a.py +12 -0
- adcp/protocols/base.py +15 -0
- adcp/protocols/mcp.py +12 -0
- adcp/types/__init__.py +461 -31
- adcp/types/_generated.py +37 -38
- adcp/types/aliases.py +251 -46
- adcp/types/generated_poc/activate_signal_request.py +3 -3
- adcp/types/generated_poc/activate_signal_response.py +2 -2
- adcp/types/generated_poc/asset_content_type.py +23 -0
- adcp/types/generated_poc/brand_manifest.py +8 -8
- adcp/types/generated_poc/create_media_buy_response.py +16 -21
- adcp/types/generated_poc/deployment.py +6 -6
- adcp/types/generated_poc/destination.py +4 -4
- adcp/types/generated_poc/format.py +5 -30
- adcp/types/generated_poc/format_category.py +17 -0
- adcp/types/generated_poc/get_signals_request.py +4 -4
- adcp/types/generated_poc/get_signals_response.py +2 -2
- adcp/types/generated_poc/list_creative_formats_request.py +4 -22
- adcp/types/generated_poc/update_media_buy_response.py +15 -22
- adcp/types/stable.py +268 -7
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/METADATA +172 -1
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/RECORD +29 -28
- adcp/types/generated_poc/asset_type.py +0 -100
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/WHEEL +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/entry_points.txt +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/licenses/LICENSE +0 -0
- {adcp-2.7.0.dist-info → adcp-2.9.0.dist-info}/top_level.txt +0 -0
adcp/types/stable.py
CHANGED
|
@@ -22,15 +22,35 @@ Schema Evolution:
|
|
|
22
22
|
from __future__ import annotations
|
|
23
23
|
|
|
24
24
|
from adcp.types._generated import (
|
|
25
|
+
Action,
|
|
25
26
|
# Core request/response types
|
|
26
27
|
ActivateSignalRequest,
|
|
27
28
|
ActivateSignalResponse,
|
|
29
|
+
AggregatedTotals,
|
|
28
30
|
# Assets
|
|
31
|
+
Asset,
|
|
32
|
+
AssetContentType, # New from PR #222: consolidated asset content types
|
|
33
|
+
AssetSelectors,
|
|
34
|
+
AssetsRequired,
|
|
35
|
+
AssignedPackage,
|
|
36
|
+
Assignments,
|
|
29
37
|
AudioAsset,
|
|
38
|
+
Authentication,
|
|
39
|
+
AuthorizedAgents,
|
|
40
|
+
AuthorizedSalesAgents,
|
|
41
|
+
AvailableMetric,
|
|
42
|
+
AvailableReportingFrequency,
|
|
30
43
|
# Core domain types
|
|
31
44
|
BrandManifest, # Clean single type after upstream schema fix
|
|
32
45
|
BuildCreativeRequest,
|
|
33
46
|
BuildCreativeResponse,
|
|
47
|
+
ByPackageItem,
|
|
48
|
+
Capability,
|
|
49
|
+
CatalogType,
|
|
50
|
+
CoBranding,
|
|
51
|
+
Colors,
|
|
52
|
+
Contact,
|
|
53
|
+
Country,
|
|
34
54
|
# Pricing options
|
|
35
55
|
CpcPricingOption,
|
|
36
56
|
CpcvPricingOption,
|
|
@@ -41,45 +61,141 @@ from adcp.types._generated import (
|
|
|
41
61
|
CreateMediaBuyRequest,
|
|
42
62
|
CreateMediaBuyResponse,
|
|
43
63
|
Creative,
|
|
64
|
+
CreativeAgent,
|
|
65
|
+
CreativeAsset,
|
|
66
|
+
CreativeAssignment,
|
|
44
67
|
CreativeManifest,
|
|
68
|
+
CreativePolicy,
|
|
45
69
|
# Enums and constants
|
|
46
70
|
CreativeStatus,
|
|
47
71
|
CssAsset,
|
|
72
|
+
DaastVersion,
|
|
73
|
+
DailyBreakdownItem,
|
|
74
|
+
DeliverTo,
|
|
75
|
+
DeliveryMeasurement,
|
|
76
|
+
DeliveryMetrics,
|
|
77
|
+
DeliveryType,
|
|
78
|
+
Details,
|
|
79
|
+
Direction,
|
|
80
|
+
Disclaimer,
|
|
81
|
+
Domain,
|
|
82
|
+
DomainBreakdown,
|
|
83
|
+
DoohMetrics,
|
|
84
|
+
Embedding,
|
|
48
85
|
Error,
|
|
86
|
+
FeedbackSource,
|
|
87
|
+
FeedFormat,
|
|
88
|
+
FieldModel,
|
|
89
|
+
Filters,
|
|
49
90
|
FlatRatePricingOption,
|
|
91
|
+
Fonts,
|
|
50
92
|
Format,
|
|
93
|
+
FormatCard,
|
|
94
|
+
FormatCardDetailed,
|
|
95
|
+
FormatCategory, # New from PR #222: format categories (display, video, native, etc.)
|
|
51
96
|
FormatId,
|
|
97
|
+
FormatType,
|
|
98
|
+
FrequencyCap,
|
|
99
|
+
FrequencyCapScope,
|
|
100
|
+
GeoCountryAnyOfItem,
|
|
52
101
|
GetMediaBuyDeliveryRequest,
|
|
53
102
|
GetMediaBuyDeliveryResponse,
|
|
54
103
|
GetProductsRequest,
|
|
55
104
|
GetProductsResponse,
|
|
56
105
|
GetSignalsRequest,
|
|
57
106
|
GetSignalsResponse,
|
|
107
|
+
HistoryItem,
|
|
58
108
|
HtmlAsset,
|
|
109
|
+
Identifier,
|
|
59
110
|
ImageAsset,
|
|
111
|
+
Input,
|
|
60
112
|
JavascriptAsset,
|
|
113
|
+
LandingPage,
|
|
61
114
|
ListAuthorizedPropertiesRequest,
|
|
62
115
|
ListAuthorizedPropertiesResponse,
|
|
63
116
|
ListCreativeFormatsRequest,
|
|
64
117
|
ListCreativeFormatsResponse,
|
|
65
118
|
ListCreativesRequest,
|
|
66
119
|
ListCreativesResponse,
|
|
120
|
+
Logo,
|
|
67
121
|
MarkdownAsset,
|
|
122
|
+
MarkdownFlavor,
|
|
123
|
+
Measurement,
|
|
124
|
+
MeasurementPeriod,
|
|
68
125
|
MediaBuy,
|
|
126
|
+
MediaBuyDelivery,
|
|
69
127
|
MediaBuyStatus,
|
|
128
|
+
Metadata,
|
|
129
|
+
Method,
|
|
130
|
+
MetricType,
|
|
131
|
+
ModuleType,
|
|
132
|
+
NotificationType,
|
|
133
|
+
Offering,
|
|
134
|
+
OutputFormat,
|
|
135
|
+
Pacing,
|
|
70
136
|
PackageRequest,
|
|
137
|
+
Packages,
|
|
71
138
|
PackageStatus,
|
|
139
|
+
Pagination,
|
|
140
|
+
Parameters,
|
|
141
|
+
Performance,
|
|
142
|
+
PerformanceFeedback,
|
|
143
|
+
Placement,
|
|
144
|
+
Preview,
|
|
72
145
|
PreviewCreativeRequest,
|
|
73
146
|
PreviewCreativeResponse,
|
|
147
|
+
PreviewRender,
|
|
74
148
|
PriceGuidance,
|
|
149
|
+
Pricing,
|
|
75
150
|
PricingModel,
|
|
151
|
+
PrimaryCountry,
|
|
76
152
|
Product,
|
|
153
|
+
ProductCard,
|
|
154
|
+
ProductCardDetailed,
|
|
155
|
+
ProductCatalog,
|
|
156
|
+
Progress,
|
|
157
|
+
PromotedOfferings,
|
|
158
|
+
PromotedProducts,
|
|
77
159
|
Property,
|
|
160
|
+
PropertyIdentifierTypes,
|
|
161
|
+
PropertyType,
|
|
162
|
+
ProtocolEnvelope,
|
|
163
|
+
ProtocolResponse,
|
|
78
164
|
ProvidePerformanceFeedbackRequest,
|
|
79
165
|
ProvidePerformanceFeedbackResponse,
|
|
166
|
+
PublisherDomain,
|
|
167
|
+
PublisherIdentifierTypes,
|
|
80
168
|
PushNotificationConfig,
|
|
169
|
+
QuartileData,
|
|
170
|
+
QuerySummary,
|
|
171
|
+
Render,
|
|
172
|
+
ReportingCapabilities,
|
|
173
|
+
ReportingFrequency,
|
|
174
|
+
ReportingPeriod,
|
|
175
|
+
ReportingWebhook,
|
|
176
|
+
Request,
|
|
177
|
+
RequestedMetric,
|
|
178
|
+
Response,
|
|
179
|
+
ResponseType,
|
|
180
|
+
Responsive,
|
|
181
|
+
Results,
|
|
182
|
+
Scheme,
|
|
183
|
+
Security,
|
|
184
|
+
Signal,
|
|
185
|
+
SignalType,
|
|
186
|
+
Sort,
|
|
187
|
+
SortApplied,
|
|
188
|
+
StandardFormatIds,
|
|
189
|
+
Status,
|
|
190
|
+
StatusFilter,
|
|
191
|
+
StatusFilterEnum,
|
|
192
|
+
StatusSummary,
|
|
81
193
|
SyncCreativesRequest,
|
|
82
194
|
SyncCreativesResponse,
|
|
195
|
+
Tag,
|
|
196
|
+
Tags,
|
|
197
|
+
TargetingOverlay,
|
|
198
|
+
Task,
|
|
83
199
|
TasksGetRequest,
|
|
84
200
|
TasksGetResponse,
|
|
85
201
|
TasksListRequest,
|
|
@@ -87,19 +203,29 @@ from adcp.types._generated import (
|
|
|
87
203
|
TaskStatus,
|
|
88
204
|
TaskType,
|
|
89
205
|
TextAsset,
|
|
206
|
+
Totals,
|
|
207
|
+
TrackingEvent,
|
|
208
|
+
Type,
|
|
209
|
+
Unit,
|
|
210
|
+
UpdateFrequency,
|
|
90
211
|
UpdateMediaBuyRequest,
|
|
91
212
|
UpdateMediaBuyResponse,
|
|
92
213
|
UrlAsset,
|
|
214
|
+
UrlType,
|
|
215
|
+
ValidationMode,
|
|
216
|
+
VastVersion,
|
|
93
217
|
VcpmAuctionPricingOption,
|
|
94
218
|
VcpmFixedRatePricingOption,
|
|
219
|
+
VenueBreakdownItem,
|
|
95
220
|
VideoAsset,
|
|
221
|
+
ViewThreshold,
|
|
96
222
|
WebhookAsset,
|
|
97
223
|
WebhookPayload,
|
|
98
224
|
)
|
|
99
|
-
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
|
|
225
|
+
from adcp.types._generated import (
|
|
226
|
+
# PR #223 unified responses, no more collision
|
|
227
|
+
_PackageFromPackage as Package,
|
|
228
|
+
)
|
|
103
229
|
|
|
104
230
|
# Note: BrandManifest is currently split into BrandManifest1/2 due to upstream schema
|
|
105
231
|
# using anyOf incorrectly. This will be fixed upstream to create a single BrandManifest type.
|
|
@@ -108,51 +234,128 @@ from adcp.types._generated import _PackageFromPackage as Package
|
|
|
108
234
|
# Note: BrandManifest is now a single clean type
|
|
109
235
|
# Re-export BrandManifest directly (no alias needed)
|
|
110
236
|
|
|
237
|
+
# Backward compatibility notes:
|
|
238
|
+
# - AssetType is maintained as an alias to AssetContentType for backward compatibility
|
|
239
|
+
# - Will be removed in 3.0.0
|
|
240
|
+
# - Package collision resolved by PR #223 (unified responses)
|
|
241
|
+
|
|
111
242
|
# Re-export all stable types
|
|
112
243
|
__all__ = [
|
|
113
244
|
# Request/Response types
|
|
114
245
|
"ActivateSignalRequest",
|
|
115
246
|
"ActivateSignalResponse",
|
|
247
|
+
"Action",
|
|
248
|
+
"AggregatedTotals",
|
|
116
249
|
"BuildCreativeRequest",
|
|
117
250
|
"BuildCreativeResponse",
|
|
251
|
+
"ByPackageItem",
|
|
118
252
|
"CreateMediaBuyRequest",
|
|
119
253
|
"CreateMediaBuyResponse",
|
|
254
|
+
"DailyBreakdownItem",
|
|
255
|
+
"Details",
|
|
256
|
+
"Domain",
|
|
257
|
+
"DomainBreakdown",
|
|
120
258
|
"GetMediaBuyDeliveryRequest",
|
|
121
259
|
"GetMediaBuyDeliveryResponse",
|
|
122
260
|
"GetProductsRequest",
|
|
123
261
|
"GetProductsResponse",
|
|
124
262
|
"GetSignalsRequest",
|
|
125
263
|
"GetSignalsResponse",
|
|
264
|
+
"HistoryItem",
|
|
126
265
|
"ListAuthorizedPropertiesRequest",
|
|
127
266
|
"ListAuthorizedPropertiesResponse",
|
|
128
267
|
"ListCreativeFormatsRequest",
|
|
129
268
|
"ListCreativeFormatsResponse",
|
|
130
269
|
"ListCreativesRequest",
|
|
131
270
|
"ListCreativesResponse",
|
|
271
|
+
"MediaBuyDelivery",
|
|
132
272
|
"PreviewCreativeRequest",
|
|
133
273
|
"PreviewCreativeResponse",
|
|
274
|
+
"Progress",
|
|
275
|
+
"ProtocolEnvelope",
|
|
276
|
+
"ProtocolResponse",
|
|
134
277
|
"ProvidePerformanceFeedbackRequest",
|
|
135
278
|
"ProvidePerformanceFeedbackResponse",
|
|
279
|
+
"QuerySummary",
|
|
280
|
+
"SortApplied",
|
|
281
|
+
"StatusSummary",
|
|
136
282
|
"SyncCreativesRequest",
|
|
137
283
|
"SyncCreativesResponse",
|
|
284
|
+
"Task",
|
|
138
285
|
"TasksGetRequest",
|
|
139
286
|
"TasksGetResponse",
|
|
140
287
|
"TasksListRequest",
|
|
141
288
|
"TasksListResponse",
|
|
289
|
+
"Totals",
|
|
142
290
|
"UpdateMediaBuyRequest",
|
|
143
291
|
"UpdateMediaBuyResponse",
|
|
144
292
|
# Domain types
|
|
145
|
-
"
|
|
293
|
+
"Asset",
|
|
294
|
+
"AssetSelectors",
|
|
295
|
+
"AssetContentType", # New canonical name from PR #222
|
|
296
|
+
"AssetType", # Deprecated alias for AssetContentType
|
|
297
|
+
"FormatCategory", # New from PR #222
|
|
298
|
+
"AssetsRequired",
|
|
299
|
+
"AssignedPackage",
|
|
300
|
+
"Assignments",
|
|
301
|
+
"BrandManifest",
|
|
302
|
+
"Capability",
|
|
303
|
+
"CoBranding",
|
|
304
|
+
"Colors",
|
|
305
|
+
"Contact",
|
|
146
306
|
"Creative",
|
|
307
|
+
"CreativeAgent",
|
|
308
|
+
"CreativeAsset",
|
|
309
|
+
"CreativeAssignment",
|
|
147
310
|
"CreativeManifest",
|
|
311
|
+
"CreativePolicy",
|
|
312
|
+
"DeliveryMeasurement",
|
|
313
|
+
"DeliveryMetrics",
|
|
314
|
+
"Disclaimer",
|
|
315
|
+
"DoohMetrics",
|
|
316
|
+
"Embedding",
|
|
148
317
|
"Error",
|
|
318
|
+
"FeedFormat",
|
|
319
|
+
"Filters",
|
|
320
|
+
"Fonts",
|
|
149
321
|
"Format",
|
|
322
|
+
"FormatCard",
|
|
323
|
+
"FormatCardDetailed",
|
|
150
324
|
"FormatId",
|
|
325
|
+
"Identifier",
|
|
326
|
+
"Input",
|
|
327
|
+
"LandingPage",
|
|
328
|
+
"Logo",
|
|
151
329
|
"MediaBuy",
|
|
330
|
+
"Metadata",
|
|
331
|
+
"Offering",
|
|
152
332
|
"Package",
|
|
153
333
|
"PackageRequest",
|
|
334
|
+
"Packages",
|
|
335
|
+
"Parameters",
|
|
336
|
+
"Performance",
|
|
337
|
+
"PerformanceFeedback",
|
|
338
|
+
"Placement",
|
|
339
|
+
"Preview",
|
|
340
|
+
"PreviewRender",
|
|
341
|
+
"Pricing",
|
|
154
342
|
"Product",
|
|
343
|
+
"ProductCard",
|
|
344
|
+
"ProductCardDetailed",
|
|
345
|
+
"ProductCatalog",
|
|
346
|
+
"PromotedOfferings",
|
|
347
|
+
"PromotedProducts",
|
|
155
348
|
"Property",
|
|
349
|
+
"QuartileData",
|
|
350
|
+
"Render",
|
|
351
|
+
"Request",
|
|
352
|
+
"Response",
|
|
353
|
+
"Results",
|
|
354
|
+
"Signal",
|
|
355
|
+
"Tag",
|
|
356
|
+
"Tags",
|
|
357
|
+
"TargetingOverlay",
|
|
358
|
+
"VenueBreakdownItem",
|
|
156
359
|
# Pricing-related types
|
|
157
360
|
"CpcPricingOption",
|
|
158
361
|
"CpcvPricingOption",
|
|
@@ -164,15 +367,70 @@ __all__ = [
|
|
|
164
367
|
"PriceGuidance",
|
|
165
368
|
"VcpmAuctionPricingOption",
|
|
166
369
|
"VcpmFixedRatePricingOption",
|
|
167
|
-
# Status enums
|
|
370
|
+
# Status enums & simple types
|
|
371
|
+
"CatalogType",
|
|
372
|
+
"Country",
|
|
168
373
|
"CreativeStatus",
|
|
374
|
+
"DaastVersion",
|
|
375
|
+
"DeliverTo",
|
|
376
|
+
"DeliveryType",
|
|
377
|
+
"Direction",
|
|
378
|
+
"FeedbackSource",
|
|
379
|
+
"FieldModel",
|
|
380
|
+
"FormatType",
|
|
381
|
+
"FrequencyCap",
|
|
382
|
+
"FrequencyCapScope",
|
|
383
|
+
"GeoCountryAnyOfItem",
|
|
384
|
+
"MarkdownFlavor",
|
|
385
|
+
"Measurement",
|
|
386
|
+
"MeasurementPeriod",
|
|
169
387
|
"MediaBuyStatus",
|
|
388
|
+
"Method",
|
|
389
|
+
"MetricType",
|
|
390
|
+
"ModuleType",
|
|
391
|
+
"NotificationType",
|
|
392
|
+
"OutputFormat",
|
|
393
|
+
"Pacing",
|
|
170
394
|
"PackageStatus",
|
|
395
|
+
"Pagination",
|
|
171
396
|
"PricingModel",
|
|
397
|
+
"PrimaryCountry",
|
|
398
|
+
"PropertyIdentifierTypes",
|
|
399
|
+
"PropertyType",
|
|
400
|
+
"PublisherDomain",
|
|
401
|
+
"PublisherIdentifierTypes",
|
|
402
|
+
"ResponseType",
|
|
403
|
+
"Responsive",
|
|
404
|
+
"SignalType",
|
|
405
|
+
"Sort",
|
|
406
|
+
"StandardFormatIds",
|
|
407
|
+
"Status",
|
|
408
|
+
"StatusFilter",
|
|
409
|
+
"StatusFilterEnum",
|
|
172
410
|
"TaskStatus",
|
|
173
411
|
"TaskType",
|
|
174
|
-
|
|
412
|
+
"TrackingEvent",
|
|
413
|
+
"Type",
|
|
414
|
+
"Unit",
|
|
415
|
+
"UpdateFrequency",
|
|
416
|
+
"UrlType",
|
|
417
|
+
"ValidationMode",
|
|
418
|
+
"VastVersion",
|
|
419
|
+
"ViewThreshold",
|
|
420
|
+
# Configuration & infrastructure types
|
|
421
|
+
"Authentication",
|
|
422
|
+
"AuthorizedAgents",
|
|
423
|
+
"AuthorizedSalesAgents",
|
|
424
|
+
"AvailableMetric",
|
|
425
|
+
"AvailableReportingFrequency",
|
|
175
426
|
"PushNotificationConfig",
|
|
427
|
+
"ReportingCapabilities",
|
|
428
|
+
"ReportingFrequency",
|
|
429
|
+
"ReportingPeriod",
|
|
430
|
+
"ReportingWebhook",
|
|
431
|
+
"RequestedMetric",
|
|
432
|
+
"Scheme",
|
|
433
|
+
"Security",
|
|
176
434
|
# Assets
|
|
177
435
|
"AudioAsset",
|
|
178
436
|
"CssAsset",
|
|
@@ -186,3 +444,6 @@ __all__ = [
|
|
|
186
444
|
"WebhookAsset",
|
|
187
445
|
"WebhookPayload",
|
|
188
446
|
]
|
|
447
|
+
|
|
448
|
+
# Deprecated aliases for backward compatibility - will be removed in 3.0.0
|
|
449
|
+
AssetType = AssetContentType # Use AssetContentType instead
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adcp
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.9.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
|
|
@@ -507,12 +507,183 @@ All AdCP tools with full type safety:
|
|
|
507
507
|
- `list_creatives()` - List creative assets
|
|
508
508
|
- `get_media_buy_delivery()` - Get delivery performance
|
|
509
509
|
|
|
510
|
+
**Creative Management:**
|
|
511
|
+
- `preview_creative()` - Preview creative before building
|
|
512
|
+
- `build_creative()` - Generate production-ready creative assets
|
|
513
|
+
|
|
510
514
|
**Audience & Targeting:**
|
|
511
515
|
- `list_authorized_properties()` - Get authorized properties
|
|
512
516
|
- `get_signals()` - Get audience signals
|
|
513
517
|
- `activate_signal()` - Activate audience signals
|
|
514
518
|
- `provide_performance_feedback()` - Send performance feedback
|
|
515
519
|
|
|
520
|
+
## Workflow Examples
|
|
521
|
+
|
|
522
|
+
### Complete Media Buy Workflow
|
|
523
|
+
|
|
524
|
+
A typical media buy workflow involves discovering products, creating the buy, and managing creatives:
|
|
525
|
+
|
|
526
|
+
```python
|
|
527
|
+
from adcp import ADCPClient, AgentConfig, GetProductsRequest, CreateMediaBuyRequest
|
|
528
|
+
from adcp import BrandManifest, PublisherPropertiesAll
|
|
529
|
+
|
|
530
|
+
# 1. Connect to agent
|
|
531
|
+
config = AgentConfig(id="sales_agent", agent_uri="https://...", protocol="mcp")
|
|
532
|
+
async with ADCPClient(config) as client:
|
|
533
|
+
|
|
534
|
+
# 2. Discover available products
|
|
535
|
+
products_result = await client.get_products(
|
|
536
|
+
GetProductsRequest(brief="Premium video inventory for coffee brand")
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
if products_result.success:
|
|
540
|
+
product = products_result.data.products[0]
|
|
541
|
+
print(f"Found product: {product.name}")
|
|
542
|
+
|
|
543
|
+
# 3. Create media buy reservation
|
|
544
|
+
media_buy_result = await client.create_media_buy(
|
|
545
|
+
CreateMediaBuyRequest(
|
|
546
|
+
brand_manifest=BrandManifest(
|
|
547
|
+
name="Coffee Co",
|
|
548
|
+
brand_url="https://coffeeco.com",
|
|
549
|
+
logo_url="https://coffeeco.com/logo.png",
|
|
550
|
+
# ... additional brand details
|
|
551
|
+
),
|
|
552
|
+
packages=[{
|
|
553
|
+
"package_id": product.packages[0].package_id,
|
|
554
|
+
"quantity": 1000000 # impressions
|
|
555
|
+
}],
|
|
556
|
+
publisher_properties=PublisherPropertiesAll(
|
|
557
|
+
selection_type="all" # Target all authorized properties
|
|
558
|
+
)
|
|
559
|
+
)
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
if media_buy_result.success:
|
|
563
|
+
media_buy_id = media_buy_result.data.media_buy_id
|
|
564
|
+
print(f"✅ Media buy created: {media_buy_id}")
|
|
565
|
+
|
|
566
|
+
# 4. Update media buy if needed
|
|
567
|
+
from adcp import UpdateMediaBuyPackagesRequest
|
|
568
|
+
|
|
569
|
+
update_result = await client.update_media_buy(
|
|
570
|
+
UpdateMediaBuyPackagesRequest(
|
|
571
|
+
media_buy_id=media_buy_id,
|
|
572
|
+
packages=[{
|
|
573
|
+
"package_id": product.packages[0].package_id,
|
|
574
|
+
"quantity": 1500000 # Increase budget
|
|
575
|
+
}]
|
|
576
|
+
)
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
if update_result.success:
|
|
580
|
+
print("✅ Media buy updated")
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Complete Creative Workflow
|
|
584
|
+
|
|
585
|
+
Build and deliver production-ready creatives:
|
|
586
|
+
|
|
587
|
+
```python
|
|
588
|
+
from adcp import ADCPClient, AgentConfig
|
|
589
|
+
from adcp import PreviewCreativeFormatRequest, BuildCreativeRequest
|
|
590
|
+
from adcp import CreativeManifest, PlatformDeployment
|
|
591
|
+
|
|
592
|
+
# 1. Connect to creative agent
|
|
593
|
+
config = AgentConfig(id="creative_agent", agent_uri="https://...", protocol="mcp")
|
|
594
|
+
async with ADCPClient(config) as client:
|
|
595
|
+
|
|
596
|
+
# 2. List available formats
|
|
597
|
+
formats_result = await client.list_creative_formats()
|
|
598
|
+
|
|
599
|
+
if formats_result.success:
|
|
600
|
+
format_id = formats_result.data.formats[0].format_id
|
|
601
|
+
print(f"Using format: {format_id.id}")
|
|
602
|
+
|
|
603
|
+
# 3. Preview creative (test before building)
|
|
604
|
+
preview_result = await client.preview_creative(
|
|
605
|
+
PreviewCreativeFormatRequest(
|
|
606
|
+
target_format_id=format_id.id,
|
|
607
|
+
inputs={
|
|
608
|
+
"headline": "Fresh Coffee Daily",
|
|
609
|
+
"cta": "Order Now"
|
|
610
|
+
},
|
|
611
|
+
output_format="url" # Get preview URL
|
|
612
|
+
)
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
if preview_result.success:
|
|
616
|
+
preview_url = preview_result.data.renders[0].url
|
|
617
|
+
print(f"Preview at: {preview_url}")
|
|
618
|
+
|
|
619
|
+
# 4. Build production creative
|
|
620
|
+
build_result = await client.build_creative(
|
|
621
|
+
BuildCreativeRequest(
|
|
622
|
+
manifest=CreativeManifest(
|
|
623
|
+
format_id=format_id,
|
|
624
|
+
brand_url="https://coffeeco.com",
|
|
625
|
+
# ... creative content
|
|
626
|
+
),
|
|
627
|
+
target_format_id=format_id.id,
|
|
628
|
+
deployment=PlatformDeployment(
|
|
629
|
+
type="platform",
|
|
630
|
+
platform_id="google_admanager"
|
|
631
|
+
)
|
|
632
|
+
)
|
|
633
|
+
)
|
|
634
|
+
|
|
635
|
+
if build_result.success:
|
|
636
|
+
vast_url = build_result.data.assets[0].url
|
|
637
|
+
print(f"✅ Creative ready: {vast_url}")
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### Integrated Workflow: Media Buy + Creatives
|
|
641
|
+
|
|
642
|
+
Combine both workflows for a complete campaign setup:
|
|
643
|
+
|
|
644
|
+
```python
|
|
645
|
+
from adcp import ADCPMultiAgentClient, AgentConfig
|
|
646
|
+
from adcp import GetProductsRequest, CreateMediaBuyRequest, BuildCreativeRequest
|
|
647
|
+
|
|
648
|
+
# Connect to both sales and creative agents
|
|
649
|
+
async with ADCPMultiAgentClient(
|
|
650
|
+
agents=[
|
|
651
|
+
AgentConfig(id="sales", agent_uri="https://sales-agent.com", protocol="mcp"),
|
|
652
|
+
AgentConfig(id="creative", agent_uri="https://creative-agent.com", protocol="mcp"),
|
|
653
|
+
]
|
|
654
|
+
) as client:
|
|
655
|
+
|
|
656
|
+
# 1. Get products from sales agent
|
|
657
|
+
sales_agent = client.agent("sales")
|
|
658
|
+
products = await sales_agent.simple.get_products(
|
|
659
|
+
brief="Premium video inventory"
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
# 2. Get creative formats from creative agent
|
|
663
|
+
creative_agent = client.agent("creative")
|
|
664
|
+
formats = await creative_agent.simple.list_creative_formats()
|
|
665
|
+
|
|
666
|
+
# 3. Build creative asset
|
|
667
|
+
creative_result = await creative_agent.build_creative(
|
|
668
|
+
BuildCreativeRequest(
|
|
669
|
+
manifest=creative_manifest,
|
|
670
|
+
target_format_id=formats.formats[0].format_id.id
|
|
671
|
+
)
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
# 4. Create media buy with creative
|
|
675
|
+
media_buy_result = await sales_agent.create_media_buy(
|
|
676
|
+
CreateMediaBuyRequest(
|
|
677
|
+
brand_manifest=brand_manifest,
|
|
678
|
+
packages=[{"package_id": products.products[0].packages[0].package_id}],
|
|
679
|
+
publisher_properties=publisher_properties,
|
|
680
|
+
creative_urls=[creative_result.data.assets[0].url]
|
|
681
|
+
)
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
print(f"✅ Campaign live: {media_buy_result.data.media_buy_id}")
|
|
685
|
+
```
|
|
686
|
+
|
|
516
687
|
## Property Discovery (AdCP v2.2.0)
|
|
517
688
|
|
|
518
689
|
Build agent registries by discovering properties agents can sell:
|