Repository navigation
Releases: Adstract-AI/adstract-library
Release list
v1.0.1 — First Stable Release
This is the current stable release of the Adstract AI Python SDK.
The SDK API is stable and production-ready. Version 1.0.1 includes the
stable 1.0.0 surface together with the latest acknowledgment response model
and backend-aligned exception handling.
What's new in v1.0.1
Structured acknowledgment responses
Successful acknowledge and acknowledge_async calls now return an
AdAckResponse object with:
ad_ack_idstatussuccess
Acknowledgment status now reflects the finalized backend contract:
ok→ acknowledgment completed successfullyno_ad_used→ acknowledgment completed successfully, but the final LLM response did not use the adrecoverable_error→ acknowledgment was accepted, but Adstract encountered a recoverable backend-side issue during follow-up processing
Acknowledgment-specific exception types
Known acknowledgment failures now map to dedicated SDK exceptions:
AdResponseNotFoundErrorUnsuccessfulAdResponseErrorDuplicateAcknowledgmentError
This makes acknowledgment error handling explicit instead of treating these
cases as generic unexpected responses.
Backend-aligned HTTP error mapping
Enhancement and acknowledgment methods now match the current backend behavior
for:
- bad API key format
- missing or invalid API key
- revoked API key
- inactive platform or publisher state
- duplicate ad requests
- duplicate acknowledgments
- unsuccessful acknowledgment targets
Included from v1.0.0
Optional targeting context
Pass an OptionalContext to request_ad / request_ad_async to provide
additional signals for ad targeting: country, region, city, ASN, age, and
gender. All fields are optional and validated.
Status-based enhancement error types
The enhancement response status field maps to specific error classes:
PromptRejectedError— prompt was not suitable for ad injectionNoFillError— prompt was suitable but no ad inventory was available
Both are subclasses of AdEnhancementError.
Cleaner API naming
AdRequestContext.x_forwarded_for→user_ipAdResponse.prompt→enhanced_promptanalyse_and_report/analyse_and_report_async→acknowledge/acknowledge_async
Breaking changes carried into the stable API
From v0.4.0
AdRequestContext.x_forwarded_forrenamed touser_ipAdResponse.promptrenamed toenhanced_promptanalyse_and_reportrenamed toacknowledgeanalyse_and_report_asyncrenamed toacknowledge_async
From v0.3.x
AdRequestConfigurationrenamed toAdRequestContextrequest_ad_or_defaultrenamed torequest_adrequest_ad_or_default_asyncrenamed torequest_ad_asyncrequest_ad,request_ad_async,acknowledge, andacknowledge_async
now raise exceptions by default — setraise_exception=Falsefor
graceful fallback behavior- Analytics, compliance, and metadata processing moved to the backend, and
the related SDK-side model classes were removed
Install
pip install adstractai==1.0.1Adstract AI Python SDK v0.3.0
Adstract SDK 0.3.0 (2026-02-18)
This release introduces a major API simplification and backend-driven analytics/compliance model.
It includes multiple breaking changes to request/response shapes and method naming/default behavior.
Breaking changes
- Removed
Conversationclass from request flow. EnhancementResultnow returnssession_id: strinstead ofconversation: Conversation.- Renamed
AdRequestConfigurationtoAdRequestContext. AdRequestContextis now sent as a wrapped object with:session_iduser_agentx_forwarded_for
- Added
RequestConfigurationclass to wrapwrapping_type. AdRequestnow sends structured objects:request_context(AdRequestContext)diagnostics(Diagnostics)request_configuration(RequestConfiguration)
- Removed metadata/analytics/compliance-related models from SDK payload construction:
ClientMetadataMetadataAnalyticsComplianceErrorTrackingExternalMetadata
AdAckpayload simplified to:ad_response_idllm_responsediagnostics
- Removed
AepiData. AdResponsesimplified to:ad_request_idad_response_idsuccessexecution_time_msprompt(optional)product_name(optional)
- Removed fields from
AdResponse:aepitracking_urltracking_identifiersponsored_label
- Renamed methods:
request_ad_or_default->request_adrequest_ad_or_default_async->request_ad_async
- Default behavior changes:
request_ad/request_ad_asyncnow useraise_exception=Trueby default.analyse_and_report/analyse_and_report_asyncnow useraise_exception=Trueby default.- Set
raise_exception=Falsefor graceful/fallback-style behavior.
Migration notes
- Replace all usages of
AdRequestConfigurationwithAdRequestContext. - Update code expecting
EnhancementResult.conversationto useEnhancementResult.session_id. - Update method calls to
request_ad/request_ad_async. - Review error-handling flow due to new default
raise_exception=True.
Adstract AI Python SDK v0.2.0
Adstract AI Python SDK v0.2.0
This release stabilizes the pre-release line (v0.0.1 to v0.0.12) into v0.2.0.
Breaking changes
AdRequestConfigurationnow requiressession_id.- Passing a
conversationobject in request config is no longer supported. - Conversation data is now generated internally from
session_id(includingmessage_id).
Added
- Configurable API base URL support.
- Expanded
AdResponsemetadata and wrapping support. - Analysis pipeline for ad-injected responses.
- Reporting flow that still reports ad acknowledgments when analysis fails.
Changed
- Request flow refactored and simplified.
- Session/conversation handling unified around
session_id. - SDK/package version updated to
0.2.0.
Removed
- Non-default request helper methods replaced by the unified flow.
Fixed
- Required-parameter validation and error behavior improvements.