Skip to main content

Overview

AwaazAIFrameSerializer converts between Pipecat frames and the 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.

Source Repository

Source code, examples, and issues for the Awaaz AI integration

PyPI Package

The pipecat-awaazai package on PyPI

Awaaz AI

Learn about Awaaz AI’s telephony stack and request a demo number

Documentation

Awaaz AI voice hosting docs and message formats

Installation

This is a community-maintained package distributed separately from pipecat-ai:
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. Request a demo number via the Book a Demo form.
  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.

Configuration

Constructor parameters for AwaazAIFrameSerializer:
stream_sid
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.
params
AwaazAIFrameSerializer.InputParams
default:"InputParams()"
Optional serializer input parameters. See InputParams below.

InputParams

Passed via the params constructor argument using AwaazAIFrameSerializer.InputParams(...).
ParameterTypeDefaultDescription
awaaz_ai_sample_rateint8000Sample rate of the Awaaz AI media stream.
sample_rateint8000Sample rate used for deserialized inbound audio.
See the source repository for the authoritative, up-to-date list of parameters and message formats.

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.
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 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 for the latest tested version and changelog.