> ## Documentation Index
> Fetch the complete documentation index at: https://langchain.idochub.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ADS4GPTs

> [ADS4GPTs](https://www.ads4gpts.com/) 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:

<CodeGroup>
  ```bash pip theme={null}
  pip install ads4gpts-langchain
  ```

  ```bash uv theme={null}
  uv add ads4gpts-langchain
  ```
</CodeGroup>

### From Source

Alternatively, install from source:

<CodeGroup>
  ```bash pip theme={null}
  git clone https://github.com/ADS4GPTs/ads4gpts.git
  cd ads4gpts/libs/python-sdk/ads4gpts-langchain
  pip install .
  ```

  ```bash uv theme={null}
  git clone https://github.com/ADS4GPTs/ads4gpts.git
  cd ads4gpts/libs/python-sdk/ads4gpts-langchain
  uv add .
  ```
</CodeGroup>

## Prerequisites

* Python 3.11+
* ADS4GPTs API Key ([Obtain API Key](https://www.ads4gpts.com))

## Environment Variables

Set the following environment variables for API authentication:

```bash theme={null}
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.

```python theme={null}
from ads4gpts_langchain import Ads4gptsInlineSponsoredResponseTool
```

### Ads4gptsSuggestedPromptTool

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

```python theme={null}
from ads4gpts_langchain import Ads4gptsSuggestedPromptTool
```

### Ads4gptsInlineConversationalTool

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

```python theme={null}
from ads4gpts_langchain import Ads4gptsInlineConversationalTool
```

### Ads4gptsInlineBannerTool

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

```python theme={null}
from ads4gpts_langchain import Ads4gptsInlineBannerTool
```

### Ads4gptsSuggestedBannerTool

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

```python theme={null}
from ads4gpts_langchain import Ads4gptsSuggestedBannerTool
```

## Toolkit

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

```python theme={null}
from ads4gpts_langchain import Ads4gptsToolkit
```
