Metadata-Version: 2.4
Name: matrixads
Version: 1.0.2
Summary: Python SDK for MatrixAds Conversational AI Monetization and Ad Network
Home-page: https://thematrixads.store
Author: MatrixAds Team
Author-email: MatrixAds Team <sdk@thematrixads.store>
Project-URL: Homepage, https://thematrixads.store
Project-URL: Documentation, https://thematrixads.store/docs
Project-URL: Repository, https://github.com/Raja1802/matrixads
Keywords: matrixads,monetization,ai-ads,chatbot-ads,python,langchain,crewai,llamaindex,conversational-ai,ad-network,llm-monetization,programmatic-ads,native-ads
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.1.0; extra == "crewai"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# matrixads

> Python SDK for MatrixAds — Programmatic Conversational AI Ad Network & Monetization Engine.

Official Website: [https://thematrixads.store](https://thematrixads.store)

## Installation

```bash
pip install matrixads
```

With LangChain support:
```bash
pip install matrixads[langchain]
```

With CrewAI support:
```bash
pip install matrixads[crewai]
```

## Quick Start (Async)

```python
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)

```python
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

```python
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

```python
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](https://thematrixads.store)
