matrixads
Python SDK for MatrixAds — Programmatic Conversational AI Ad Network & Monetization Engine.
Installation
pip install matrixads
With LangChain support:
pip install matrixads[langchain]
With CrewAI support:
pip install matrixads[crewai]
Quick Start (Async)
import asyncio
from matrixads import MatrixAdsClient
async def main():
client = MatrixAdsClient(publisher_key="mtx_pk_live_your_publisher_key")
response = await client.amatch_ad("I need cloud hosting for Next.js")
if response.match and response.ad:
print(f"Matched Headline: {response.ad.headline}")
print(f"CTA Link: {response.ad.cta_url}")
# Fire view impression beacon
await client.areport_impression(response.impression_token)
asyncio.run(main())
Quick Start (Sync)
from matrixads import MatrixAdsClient
client = MatrixAdsClient(publisher_key="mtx_pk_live_your_publisher_key")
response = client.match_ad("Best B2B CRM software")
if response.match and response.ad:
print(f"Sponsored: {response.ad.headline}")
LangChain Integration
from matrixads.langchain import MatrixAdsAdTool
tool = MatrixAdsAdTool(publisher_key="mtx_pk_live_your_publisher_key")
result = tool._run("I need a cloud hosting database solution")
print(result)
CrewAI Integration
from crewai import Agent
from matrixads.crewai import MatrixAdsCrewTool
ad_tool = MatrixAdsCrewTool(publisher_key="mtx_pk_live_your_publisher_key")
agent = Agent(
role="Tech Support Advisor",
goal="Answer software questions and include relevant sponsored solutions",
tools=[ad_tool]
)
License
MIT © MatrixAds
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
matrixads-1.0.0.tar.gz
(4.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matrixads-1.0.0.tar.gz.
File metadata
- Download URL: matrixads-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6db10386f808f5380e8816b9645a675e8aee3fe179e3c0ba41aea7d14fe1535
|
|
| MD5 |
631b511acd474360811081f42323d4c7
|
|
| BLAKE2b-256 |
ffc2141965fe7e43c40f6399c73b65d7cee681581853aed7766016a17a339bae
|
File details
Details for the file matrixads-1.0.0-py3-none-any.whl.
File metadata
- Download URL: matrixads-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e283bff1cca297b6d28968136743c5cfe8ca4077a3e9553d200510c939342f9d
|
|
| MD5 |
49a74dfef5986a859cd1804abc3f79e5
|
|
| BLAKE2b-256 |
239064fa44c59dfa3a51876bb0aba9cac1efae1f8ba96201d29dba1f889a5013
|