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.0.tar.gz (4.9 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.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for matrixads-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f6db10386f808f5380e8816b9645a675e8aee3fe179e3c0ba41aea7d14fe1535
MD5 631b511acd474360811081f42323d4c7
BLAKE2b-256 ffc2141965fe7e43c40f6399c73b65d7cee681581853aed7766016a17a339bae

See more details on using hashes here.

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

Hashes for matrixads-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e283bff1cca297b6d28968136743c5cfe8ca4077a3e9553d200510c939342f9d
MD5 49a74dfef5986a859cd1804abc3f79e5
BLAKE2b-256 239064fa44c59dfa3a51876bb0aba9cac1efae1f8ba96201d29dba1f889a5013

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

2 files

1.0.1

2 files

This release

1.0.0 This release

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