Ads4GPTs Core SDK
Python SDK for integrating with Ads4GPTs, the monetization backbone of the AI Native Internet.
Overview
The Ads4GPTs Core SDK provides the tools to configure your Integration Agent, connecting your AI application to the Ads4GPTs platform. Ad requests are initiated autonomously based on conversational context and user intent, with full support for streaming responses.
Installation
pip install ads4gpts-core
Requirements
- Python 3.11 or higher
- Active Ads4GPTs account with API credentials
Quick Start
1. Configure Environment Variables
export ADS4GPTS_AGENT_URL="https://your-agent-api.com"
export ADS4GPTS_GPT_ID="your-gpt-id"
export ADS4GPTS_API_KEY="your-api-key"
export ADS4GPTS_SSP_ID="your-ssp-id"
2. Basic Usage
from ads4gpts_core import invoke_integration_agent
# First conversation in a session
stream = invoke_integration_agent(
user_input="What are the best noise-cancelling headphones under €200?",
message_history=[],
thread_id="thread_123",
session_id="session_456",
)
# Process streaming response
async for chunk in stream:
print(chunk)
Stream Processing Utilities
Split Stream
Duplicate an async stream into two independent consumers:
from ads4gpts_core import split_stream
async def source_stream():
for i in range(5):
yield i
streams = split_stream(source_stream())
# Both consumers receive all chunks
async for chunk in streams['app_stream']:
print(f"App: {chunk}")
async for chunk in streams['util_stream']:
print(f"Util: {chunk}")
Merge Streams
Process two streams sequentially:
from ads4gpts_core import merge_streams
async def app_stream():
for i in range(3):
yield f"app_{i}"
async def ads_stream():
for i in range(3):
yield f"ads_{i}"
# Outputs: app_0, app_1, app_2, ads_0, ads_1, ads_2
async for chunk in merge_streams(app_stream(), ads_stream()):
print(chunk)
Metadata
Release files for ads4gpts-core 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ads4gpts_core-0.1.2.tar.gz | 7.4 kB | Without provenance | Details for ads4gpts_core-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ads4gpts_core-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ads4gpts_core-0.1.2-py3-none-any.whl |
Total release size: 18.9 kB
Release files / ads4gpts_core-0.1.2.tar.gz
| Download URL | ads4gpts_core-0.1.2.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e9a162364c7922c58b349ad1205b00f31bdcd4c3ebf1048429ec862a3faa236
|
|
BLAKE2b-256 checksum How to use checksums |
500577be6ee7d4487e5adf5f3a8bd57600f029b418b0cc30eaf47bf3c059a2d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / ads4gpts_core-0.1.2-py3-none-any.whl
| Download URL | ads4gpts_core-0.1.2-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48a4ce9982120070a07ef0b36c1ac6bef9504951c9c6a9dc9ee1bf2d36cbccb5
|
|
BLAKE2b-256 checksum How to use checksums |
f939b93c14f857bdf85679564aa45c9705922eee3f8543c0a41a88b0bf0c62c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for ads4gpts-core 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.