LiveKit Agents

repository·main·Indexed 27 days ago

https://github.com/livekit/agents

A framework for building real-time, programmable, multi-modal voice and video agents that run on servers. It allows developers to mix and match STT, LLM, and TTS providers to create conversational AI participants, featuring a unified API (Inference) and a wide array of plugins including AWS, Azure, Anthropic, OpenAI, and Baseten.

Tokens
33.3K
Snippets
160
Records
243
Agent score
96%

What's inside livekit-agents

  1. Sarvam.ai Plugin Features Overview

    main

    The Sarvam.ai plugin provides support for Indian-language voice AI services, including:

    • Speech-to-Text (STT): Uses Sarvam's "Saarika" models to convert audio to text.
    • Text-to-Speech (TTS): Uses Sarvam's "Bulbul" models to convert text to audio.
    • LLM (Chat Completions): OpenAI-compatible support for sarvam-30b, sarvam-30b-16k, sarvam-105b, and sarvam-105b-32k models, including tool calling.
  2. Manage Resemble TTS resources manually

    main

    If you cannot use an async context manager, you must manually manage the lifecycle of the TTS instance. Always call await tts.aclose() in a finally block to ensure resources are released.

    import asyncio
    from livekit.plugins.resemble import TTS
    
    async def run_tts_example():
        tts = TTS(
            api_key="your_api_key", 
            voice_uuid="your_voice_uuid",
        )
    
        try:
            audio_stream = tts.synthesize("Hello, world!")
            async for chunk in audio_stream:
                process_audio(chunk.frame.data)
        finally
            # Always clean up resources when done
            await tts.aclose()
  3. Configure RTZR credentials and URLs

    main

    To use the RTZR plugin, you must provide credentials obtained from the RTZR Developers Console via environment variables. You can also override the API and WebSocket URLs.

    Required Credentials:

    • RTZR_CLIENT_ID: Your RTZR client ID.
    • RTZR_CLIENT_SECRET: Your RTZR client secret.

    Optional URL Overrides:

    • RTZR_API_BASE: The base HTTP API URL used for token issuance (e.g., https://openapi.vito.ai).
    • RTZR_WEBSOCKET_URL: The WebSocket URL used for live streaming (e.g., wss://openapi.vito.ai).

    Note: If RTZR_WEBSOCKET_URL is not provided, the plugin will automatically derive it from RTZR_API_BASE by replacing the scheme with wss://.

    RTZR_CLIENT_ID=<your_client_id>
    RTZR_CLIENT_SECRET=<your_client_secret>
    
    # Optional overrides
    RTZR_API_BASE=https://openapi.vito.ai
    RTZR_WEBSOCKET_URL=wss://openapi.vito.ai