Registry / llm-agents / livekit-plugins-assemblyai

livekit-plugins-assemblyai

JSON →
library1.6.0pypypi✓ verified 85d ago

LiveKit AssemblyAI Plugin is an Agent Framework plugin for integrating AssemblyAI's Speech-to-Text (STT) capabilities into LiveKit AI Agents. It enables real-time transcription for conversational AI applications. The library is actively maintained with frequent releases, often in sync with the core `livekit-agents` library, and is currently at version 1.5.4.

pip install "livekit-agents[assemblyai]~=1.5"
INSTALL
IMPORT
SIG · LIVEKIT-PLUGINS-AS
L
livekit-plugins-assemblyai
llm-agentspythonv1.6.0
Install
16.3s avg
Import
5277ms
Disk
322MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/4 runs
✓ 19.65s
py 3.11
2/4 runs
✓ 16.98s
py 3.12
2/4 runs
✓ 14.08s
py 3.13
2/4 runs
✓ 14.4s
py 3.9
2/4 runs
2/4 runs
322MB installed
● package 322MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

STT
from livekit.plugins import assemblyai
AgentSession
from livekit.agents import AgentSession
Required for integrating AssemblyAI STT into a LiveKit Agent.

This quickstart demonstrates how to initialize the AssemblyAI STT plugin. It requires the `ASSEMBLYAI_API_KEY` environment variable to be set. For a complete voice agent, the `assemblyai.STT` instance would be passed to the `AgentSession` constructor.

import os from livekit.agents import AgentSession, JobContext from livekit.plugins import assemblyai from livekit.agents.voice import VoiceAgent from dotenv import load_dotenv load_dotenv() class MyAssemblyAIAgent(VoiceAgent): def __init__(self, ctx: JobContext): super().__init__(ctx) self.stt = assemblyai.STT( api_key=os.environ.get('ASSEMBLYAI_API_KEY', '') ) async def start(self): # Example: Using AssemblyAI STT directly (not in a full agent pipeline) # For a full agent, you'd pass self.stt to AgentSession's stt parameter. print("AssemblyAI STT initialized. API Key status: ", "Set" if self.stt.api_key else "Not Set") if __name__ == "__main__": # In a real application, you'd run the agent via LiveKit's infrastructure. # This is a minimal example to show STT initialization. if not os.environ.get('ASSEMBLYAI_API_KEY'): print("Warning: ASSEMBLYAI_API_KEY environment variable is not set. STT may fail.") # You can instantiate the STT directly for testing or use it within a full AgentSession my_stt_instance = assemblyai.STT(api_key=os.environ.get('ASSEMBLYAI_API_KEY', '')) print(f"AssemblyAI STT configured with API key: {'Yes' if my_stt_instance.api_key else 'No'}")
Debug
Known issues
breakingLiveKit Agents 1.5.0 deprecated several keyword arguments for turn handling, such as `min_endpointing_delay` and `allow_interruptions`. These are now consolidated into a `TurnHandlingOptions` dictionary. Using old kwargs will still work but will emit deprecation warnings and will be removed in a future v2.0 release.
fix
Migrate `AgentSession` turn-handling parameters to use the `turn_handling` dictionary with `TurnHandlingOptions`. Example: `session = AgentSession(turn_handling={'endpointing': {'min_delay': 0.5}})`.
affects: >=1.5.0 of livekit-agents
gotchaWhen using AssemblyAI's native turn detection (`turn_detection="stt"`) in LiveKit Agents, the `max_turn_silence` default value differs from AssemblyAI's API. The LiveKit plugin defaults to `max_turn_silence=100`, while the AssemblyAI API's default is `max_turn_silence=1000`. This can lead to shorter turn durations than expected.
fix
If `turn_detection="stt"` is set, explicitly configure `max_turn_silence=1000` within `TurnHandlingOptions` to restore the original AssemblyAI behavior. Example: `turn_handling={'turn_detection': 'stt', 'endpointing': {'max_turn_silence': 1000}}`.
affects: All versions
gotchaPreemptive generation is enabled by default in LiveKit Agents 1.5.0 and newer. This starts LLM and TTS inference before a user's turn fully completes, reducing latency but potentially changing agent conversational flow.
fix
To disable preemptive generation and return to previous behavior, initialize `AgentSession` with `preemptive_generation=False`: `session = AgentSession(preemptive_generation=False)`.
affects: >=1.5.0 of livekit-agents
Errors
Common errors & fixes
ValueError: ASSEMBLYAI_API_KEY not set
The AssemblyAI STT plugin requires an API key for authentication, which is typically read from the `ASSEMBLYAI_API_KEY` environment variable.
fix
Set the `ASSEMBLYAI_API_KEY` environment variable in your shell or a `.env` file that is loaded by your application. Ensure `python-dotenv` is installed if using `.env` files. `export ASSEMBLYAI_API_KEY='your_key_here'`
TypeError: AgentSession() got an unexpected keyword argument 'min_endpointing_delay'
In `livekit-agents` v1.5.0, turn handling parameters like `min_endpointing_delay` were deprecated and moved into a consolidated `TurnHandlingOptions` dictionary passed via the `turn_handling` argument.
fix
Update your `AgentSession` initialization to use the `turn_handling` dictionary. For example, instead of `AgentSession(min_endpointing_delay=0.5)`, use `AgentSession(turn_handling={'endpointing': {'min_delay': 0.5}})`.
Upgrade
Version history
1.6.0latest on PyPI · released Jun 11, 2026
Audit
Dependencies
livekit-agentsrequiredThis is a plugin for the LiveKit Agents framework, and requires it for core agent functionality.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
livekit-plugins-assemblyai — pip install livekit-plugins-assemblyai · libregistry