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

# AwaazAI

> Telephony frame serializer for hosting Pipecat agents on the Awaaz AI media stream over a websocket

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="awaazde" maintainerUrl="https://github.com/awaazde" repo="https://github.com/awaazde/pipecat-awaazai" />

## Overview

`AwaazAIFrameSerializer` converts between Pipecat frames and the [Awaaz AI](https://www.awaaz.ai/)
telephony media stream, enabling real-time voice agents over a websocket. It is
designed to be wired into a `FastAPIWebsocketTransport` so you can host a Pipecat
agent on Awaaz AI's telephony stack and reach it over an Indian phone number.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/awaazde/pipecat-awaazai">
    Source code, examples, and issues for the Awaaz AI integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-awaazai/">
    The `pipecat-awaazai` package on PyPI
  </Card>

  <Card title="Awaaz AI" icon="phone" href="https://www.awaaz.ai/">
    Learn about Awaaz AI's telephony stack and request a demo number
  </Card>

  <Card title="Documentation" icon="book" href="https://docs.awaaz.de/">
    Awaaz AI voice hosting docs and message formats
  </Card>
</CardGroup>

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
pip install pipecat-awaazai
```

## Prerequisites

To host an agent on the Awaaz AI telephony stack you need:

1. **Awaaz AI phone number**: Purchase a phone number from
   [Awaaz AI](https://www.awaaz.ai/). Request a demo number via the
   [Book a Demo form](https://www.awaaz.ai/#Book-Demo).
2. **A public websocket endpoint**: Expose your bot's websocket so Awaaz AI can
   connect to it (for example, by tunneling with `ngrok` during development).

The serializer itself does not require any API keys. The provider's message
formats are documented in the [Awaaz AI docs](https://docs.awaaz.de/).

## Configuration

Constructor parameters for `AwaazAIFrameSerializer`:

<ParamField path="stream_sid" type="str" required>
  The Awaaz AI stream identifier for the call. It is included in the outgoing
  `media` and `clear` events sent back to Awaaz AI. Typically parsed from the
  initial websocket `start` message.
</ParamField>

<ParamField path="params" type="AwaazAIFrameSerializer.InputParams" default="InputParams()">
  Optional serializer input parameters. See [InputParams](#inputparams) below.
</ParamField>

### InputParams

Passed via the `params` constructor argument using
`AwaazAIFrameSerializer.InputParams(...)`.

| Parameter              | Type  | Default | Description                                      |
| ---------------------- | ----- | ------- | ------------------------------------------------ |
| `awaaz_ai_sample_rate` | `int` | `8000`  | Sample rate of the Awaaz AI media stream.        |
| `sample_rate`          | `int` | `8000`  | Sample rate used for deserialized inbound audio. |

<Note>
  See the [source repository](https://github.com/awaazde/pipecat-awaazai) for
  the authoritative, up-to-date list of parameters and message formats.
</Note>

## Usage

Wire the serializer into a `FastAPIWebsocketTransport`. The `stream_sid` is read
from the initial websocket `start` message Awaaz AI sends when a call connects.

```python theme={null}
from pipecat_awaazai import AwaazAIFrameSerializer
from pipecat.transports.network.fastapi_websocket import (
    FastAPIWebsocketTransport,
    FastAPIWebsocketParams,
)

serializer = AwaazAIFrameSerializer(stream_sid=stream_id)

transport = FastAPIWebsocketTransport(
    websocket=websocket_client,
    params=FastAPIWebsocketParams(
        audio_in_enabled=True,
        audio_out_enabled=True,
        add_wav_header=False,
        serializer=serializer,
    ),
)
```

See the [source repository](https://github.com/awaazde/pipecat-awaazai) for a
complete `bot.py` example, including parsing `stream_sid` from the initial
websocket messages and running the bot behind an `ngrok` tunnel.

## Compatibility

Tested with Pipecat v0.0.101 and Python 3.10+. Check the [source
repository](https://github.com/awaazde/pipecat-awaazai) for the latest tested
version and changelog.
