Skip to main content

Agent Framework plugin for services using Gladia's API.

Project description

Gladia plugin for LiveKit Agents

Support for speech-to-text with Gladia.

See https://docs.livekit.io/agents/integrations/stt/gladia/ for more information.

Installation

pip install livekit-plugins-gladia

Pre-requisites

You'll need an API key from Gladia. It can be set as an environment variable: GLADIA_API_KEY

Features

  • Streaming speech-to-text
  • Multi-language support
  • Code-switching between languages
  • Interim results (partial transcriptions)
  • Voice activity detection with energy filtering
  • Optional real-time translation
  • Customizable audio parameters (sample rate, bit depth, channels, encoding)

Example Usage

from livekit.stt import STT
from livekit.plugins.gladia.stt import STT as GladiaSTT

# Basic initialization
stt = GladiaSTT(
    api_key="your-api-key-here",  # or use GLADIA_API_KEY env var
    interim_results=True
)

# With more options
stt = GladiaSTT(
    languages=["en", "fr"],  # Specify languages or let Gladia auto-detect
    code_switching=True,     # Allow switching between languages during recognition
    sample_rate=16000,       # Audio sample rate in Hz
    bit_depth=16,            # Audio bit depth
    channels=1,              # Number of audio channels
    encoding="wav/pcm",      # Audio encoding format
    energy_filter=True,      # Enable voice activity detection
    translation_enabled=True,
    translation_target_languages=["en"],
    translation_model="base",
    translation_match_original_utterances=True
)

# Update options after initialization
stt.update_options(
    languages=["ja", "en"],
    translation_enabled=True,
    translation_target_languages=["fr"]
)

Using with LiveKit Agents Framework

from livekit.agents import Agent
from livekit.plugins.gladia.stt import STT as GladiaSTT

agent = Agent(
    stt=GladiaSTT(
        api_key="your-api-key-here",
        languages=["en"],
        translation_enabled=True,
        translation_target_languages=["es"]
    )
)

# Rest of your agent setup...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_gladia-1.0.21.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

livekit_plugins_gladia-1.0.21-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_gladia-1.0.21.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_gladia-1.0.21.tar.gz
Algorithm Hash digest
SHA256 b47c2b2ca449de0b99c09326b845370042c05fc78eed73b89acb5fd3aa6b7b82
MD5 f72def3a79c719aff4c4ac16833d3ce9
BLAKE2b-256 06a153c9d9ccf7529c9a898b32d656132e8bbb05455625b46ffd6c4bbc6ae5b9

See more details on using hashes here.

File details

Details for the file livekit_plugins_gladia-1.0.21-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_gladia-1.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 21e296f9cd75b1492c1776f7ffbe5257ee38eb1e6dac743906e2710e579fafb1
MD5 3fa2eb1966efb7319205ba99ba1818d5
BLAKE2b-256 7b51f3d85cef24c928f5725d9f18781d5e1b6669145aa5392009fa7a795de248

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page