Skip to main content
Open on GitHub

ADS4GPTs

ADS4GPTs is building the open monetization backbone of the AI-Native internet. It helps AI applications monetize through advertising with a UX and Privacy first approach.

Installation and Setupโ€‹

Using pipโ€‹

You can install the package directly from PyPI:

pip install ads4gpts-langchain

From Sourceโ€‹

Alternatively, install from source:

git clone https://github.com/ADS4GPTs/ads4gpts.git
cd ads4gpts/libs/python-sdk/ads4gpts-langchain
pip install .

Prerequisitesโ€‹

Environment Variablesโ€‹

Set the following environment variables for API authentication:

export ADS4GPTS_API_KEY='your-ads4gpts-api-key'

Alternatively, API keys can be passed directly when initializing classes or stored in a .env file.

Toolsโ€‹

ADS4GPTs provides two main tools for monetization:

Ads4gptsInlineSponsoredResponseToolโ€‹

This tool fetches native, sponsored responses that can be seamlessly integrated within your AI application's outputs.

from ads4gpts_langchain import Ads4gptsInlineSponsoredResponseTool

Ads4gptsSuggestedPromptToolโ€‹

Generates sponsored prompt suggestions to enhance user engagement and provide monetization opportunities.

from ads4gpts_langchain import Ads4gptsSuggestedPromptTool

Ads4gptsInlineConversationalToolโ€‹

Delivers conversational sponsored content that naturally fits within chat interfaces and dialogs.

from ads4gpts_langchain import Ads4gptsInlineConversationalTool

Ads4gptsInlineBannerToolโ€‹

Provides inline banner advertisements that can be displayed within your AI application's response.

from ads4gpts_langchain import Ads4gptsInlineBannerTool

Ads4gptsSuggestedBannerToolโ€‹

Generates banner advertisement suggestions that can be presented to users as recommended content.

from ads4gpts_langchain import Ads4gptsSuggestedBannerTool

Toolkitโ€‹

The Ads4gptsToolkit combines these tools for convenient access in LangChain applications.

from ads4gpts_langchain import Ads4gptsToolkit

Was this page helpful?