Skip to main content

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.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matrixads-1.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file matrixads-1.0.1.tar.gz.

File metadata

  • Download URL: matrixads-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for matrixads-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7d19b1d498c43e9f914787b70011a4c5d823c4256b8a7b392ee86e68b09d0226
MD5 3b2ab70ef42f10352988593d97b1d153
BLAKE2b-256 4e1832832e0c09e298710b7a624a95f31d227dec5eb4c65d5e45214d413003f2

See more details on using hashes here.

File details

Details for the file matrixads-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: matrixads-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for matrixads-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3652cc0d4fbd33372da778bde699a58f6aa4c36a6616c26c7b517ac18bbe2a0e
MD5 9cb6082c276f029d7d16533dbec8a30f
BLAKE2b-256 d21d4513bbad865b3b01700b377b141d84ee5f7e70c1a533e4b5d38bac80ae03

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

2 files

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page