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
    region="eu-west"                            # Specify Region to use for the Gladia API
    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
    translation_context_adaptation= False,      # Enable context-aware translation
    translation_context= None,                  # Context input to guide translation
    translation_informal=False,                 # Use informal tone in translation
    pre_processing_audio_enhancer=False,        # Apply pre-processing to the audio stream to enhance the quality
    pre_processing_speech_threshold=0.6,        # Sensitivity for speech detection; closer to 1 = stricter, less background noise

    # Custom_vocabulary exemple
    custom_vocabulary=[
        "Westeros",
        {"value": "Stark"},
        {
            "value": "Night's Watch",
            "pronunciations": ["Nightz Watch"],
            "intensity": 0.4,
            "language": "en"
        }
    ],

    # Custom_spelling exemple
    custom_spelling={
        "Gorish": ["ghorish", "gaurish", "gaureish"],
        "Data Science": ["data-science", "data science"],
        ".": ["period", "full stop"],
        "SQL": ["sequel"]
    }
)

# 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


Release history Release notifications | RSS feed

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.5.13.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_gladia-1.5.13-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: livekit_plugins_gladia-1.5.13.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for livekit_plugins_gladia-1.5.13.tar.gz
Algorithm Hash digest
SHA256 94c9587d8e4235d6d2dc97017e4704ee408d55a076ddb44ec350dca3557d9d42
MD5 8a35a221fd54ec0b8351b41fab120714
BLAKE2b-256 41c2da15d92c46469c74d7654f4ebee7eaa8b012e387718ce880e765992aa44d

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_gladia-1.5.13.tar.gz:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_gladia-1.5.13-py3-none-any.whl
Algorithm Hash digest
SHA256 92f50b260a95e12e21996744bc26909cdccfac32a8538e9f91c1f8b849dca571
MD5 1b5ec04fab1c3ec2c0d0fc550537297e
BLAKE2b-256 11c830f6a03e4f3a57f67aefb474770d50f4ae0db6ed99d6dddbac5a33b4385e

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_gladia-1.5.13-py3-none-any.whl:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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