Integration · Agent framework

Oogam + Pipecat

Build Indian-language voice agents with Pipecat and Oogam's speech models. Speech to text, text to speech and Sutra plug in as Pipecat services, across 27 Indian languages and English.

What's included

Three services, one package.

Speech to Text

OogamSTTService

Streaming transcription. Final transcripts in the caller's language; finalizes each turn the moment Pipecat's VAD hears the caller stop, and can follow a caller who switches language mid-call — most reliably from Hindi to English today.

wss://platform.oogam.ai/v1/realtime?intent=transcriptionReference

Text to Speech

OogamTTSService

Streaming speech, played as it is generated. Preset voices or your own cloned voices, in every Indian language Oogam speaks.

POST /v1/audio/speech · streamReference

Sutra

OogamLLMService

Oogam's conversation model, with native Hindi, Hinglish and Indian-language replies — through Pipecat's OpenAI-compatible service.

POST /v1/chat/completionsReference
How it works

Running in three steps.

01

Install

Add pipecat-oogam next to Pipecat. Python 3.11 or later, Pipecat 1.16 or later.

02

Add your key

Create an API key with the NAAD and SUTRA products on the Oogam Platform and set OOGAM_API_KEY.

03

Run your agent

Run the script and open the URL it prints. Talk — in Hindi or English.

Quick start

A complete Hindi voice agent.

Oogam speech to text, Sutra and Oogam text to speech, with Silero VAD and Smart Turn deciding when the caller has finished. Save it as agent.py, then run OOGAM_API_KEY=sk-setu-… python agent.py.

bash
pip install "pipecat-ai[runner,webrtc,silero]" pipecat-oogam
python
import os

import aiohttp
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.frames.frames import LLMRunFrame, TTSUpdateSettingsFrame
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.worker import PipelineWorker
from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import (
    LLMContextAggregatorPair,
    LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport
from pipecat.transcriptions.language import Language
from pipecat.transports.base_transport import TransportParams

from pipecat_oogam import OogamLLMService, OogamSTTService, OogamTTSService


async def bot(runner_args: RunnerArguments):
    transport = await create_transport(
        runner_args,
        {"webrtc": lambda: TransportParams(audio_in_enabled=True, audio_out_enabled=True)},
    )
    key = os.environ["OOGAM_API_KEY"]

    async with aiohttp.ClientSession() as session:
        stt = OogamSTTService(
            api_key=key,
            settings=OogamSTTService.Settings(
                language=Language.HI,
                auto_switch=True,  # follow a caller who changes language
                candidates=[Language.HI, Language.EN_IN],
            ),
        )
        llm = OogamLLMService(api_key=key)  # Sutra
        tts = OogamTTSService(
            api_key=key,
            aiohttp_session=session,
            settings=OogamTTSService.Settings(voice="aditi", language=Language.HI),
        )

        context = LLMContext([{"role": "system", "content": "You are a helpful assistant. Reply in one short spoken sentence."}])
        aggregators = LLMContextAggregatorPair(
            context, user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer())
        )
        worker = PipelineWorker(Pipeline([
            transport.input(), stt, aggregators.user(), llm, tts,
            transport.output(), aggregators.assistant(),
        ]))

        @stt.event_handler("on_language_changed")
        async def on_language_changed(service, from_code, to_code, reason):
            # Speak the language the caller switched to.
            await worker.queue_frame(
                TTSUpdateSettingsFrame(delta=OogamTTSService.Settings(language=to_code))
            )

        @transport.event_handler("on_client_connected")
        async def on_client_connected(transport, client):
            context.add_message({"role": "user", "content": "Greet the caller in Hindi."})
            await worker.queue_frames([LLMRunFrame()])

        @transport.event_handler("on_client_disconnected")
        async def on_client_disconnected(transport, client):
            await worker.cancel()  # end the call, and its Oogam session, when the caller leaves

        await PipelineRunner(handle_sigint=runner_args.handle_sigint).run(worker)


if __name__ == "__main__":
    from pipecat.runner.run import main

    main()
Turn-taking

Your turn detector decides. Oogam keeps up.

When the VAD reports that the caller stopped, the STT service sends Oogam finalize and the final transcript comes back marked as finalized, so Pipecat does not sit waiting for it. Smart Turn — or any turn strategy you choose — then decides whether the caller is really done, exactly as with any other streaming STT.

Best practices

Get the most out of it.

Start in the caller's language

Oogam does not detect the language at the start of a call, so a session starts in the language you give it. If you know it from the number dialled, a menu choice or your own records, start there. Text to speech falls back to Hindi for a code it does not know — set it deliberately on both services.

Let Pipecat own turn-taking

Keep the default: the STT service sends finalize when the VAD stops, so the turn closes without waiting out Oogam's own silence window, and Smart Turn decides when the caller is really done. When Smart Turn judges a sentence unfinished it waits 3 seconds before the agent replies; OogamSmartTurnStopStrategy(max_wait=1.5) shortens that.

Follow a switch, and move the voice

With auto_switch the session follows a caller who changes language from their second sentence — most reliably from Hindi to English today. Handle on_language_changed to move the TTS language, as the quick start does. A reply in another script is spoken in that script's language, so the agent is never left silent.

Size your limits

Calls are admitted per key, per account and per language, and each Sutra reply and spoken sentence counts against your key's requests-per-minute limit — about 15–25 per live call. A 429 or a 4429 close means wait and retry — honour Retry-After rather than reconnecting in a loop.

Which language switches are detected today is listed under Changing language mid-call. For a pair that is not, start the session in the caller's language or change language yourself with an STTUpdateSettingsFrame.

Sutra does not support function calling yet. If your agent uses tools, keep Oogam for speech to text and text to speech and pair them with an LLM service that supports tools.

Use cases

Where teams use it.

IVR and contact centres

Answer, route and resolve calls in the caller's own language.

Multilingual support agents

Start each call in the caller's language — Hindi, Gujarati, Tamil, English and more — and follow a caller who moves from Hindi to English.

Outbound calling

Lead qualification, renewals and feedback calls at scale.

Resources

Everything you need.

Package
pipecat-oogam · open source (MIT) · Python 3.11+ · maintained by DWET Labs
Streaming STT reference
Protocol, finalize, language switching, errors
Text to speech reference
Streaming speech · Voices
Sutra reference
Chat completions
Languages
All language codes
Pipecat
docs.pipecat.ai

Billed from your prepaid wallet: speech to text per second the session is open, text to speech per character, Sutra per token.

Ready to build?

Create a key, install the package, and talk to your agent in minutes.