Aliyun implementation for LiveKit Agents
Project description
Aliyun plugin for LiveKit Agents
Realtime speech-to-text, text-to-speech, and LLM support for LiveKit Agents using Aliyun DashScope.
The plugin exposes:
livekit.plugins.aliyun.STTlivekit.plugins.aliyun.TTSlivekit.plugins.aliyun.LLM
Installation
pip install livekit-plugins-alicloud
Pre-requisites
You'll need an API key from Aliyun. It can be set as an environment variable: DASHSCOPE_API_KEY
Quick Start
from dotenv import load_dotenv
from livekit.agents import Agent, AgentSession
from livekit.plugins import aliyun
load_dotenv()
session = AgentSession(
llm=aliyun.LLM(),
stt=aliyun.STT(),
tts=aliyun.TTS(),
)
agent = Agent(instructions="Reply briefly and clearly.")
LLM
Common Options
from livekit.plugins import aliyun
llm = aliyun.LLM(
model="qwen-plus",
enable_thinking=False,
)
api_key: DashScope API key. Overrides the environment variable.model: DashScope OpenAI-compatible chat model name. Defaults toqwen-plus.base_url: Override the OpenAI-compatible endpoint. Defaults tohttps://dashscope.aliyuncs.com/compatible-mode/v1.enable_thinking: Whether to enable Qwen deep-thinking mode. Defaults toFalse.thinking_budget: Optional token budget for thinking mode. Requiresenable_thinking=True.max_tokens: Optional maximum output token count.seed: Optional deterministic sampling seed.tool_choice: Supportsauto,none, and forcing a specific function tool. Therequiredoption is not supported.preserve_thinking: Not supported in this version. Reasoning content is not persisted or returned as ordinary text.
STT
Common Options
from livekit.plugins import aliyun
stt = aliyun.STT(
model="qwen3-asr-flash-realtime",
language="zh",
sample_rate=16000,
interim_results=True,
)
api_key: DashScope API key. Overrides the environment variable.model: Realtime ASR model name.language: Optional language code such aszh,yue, oren.sample_rate: Input sample rate. Typical value is16000.interim_results: Whether to emit interim transcripts.turn_detection: Server-side VAD settings. Set it toNoneto use manual mode.
Manual Mode
To disable server-side turn detection and use manual mode:
from livekit.plugins import aliyun
stt = aliyun.STT(turn_detection=None)
TTS
Common Options
from livekit.plugins import aliyun
tts = aliyun.TTS(
model="qwen3-tts-flash-realtime",
voice="Cherry",
language_type="Chinese",
)
api_key: DashScope API key. Overrides the environment variable.model: Realtime TTS model name.voice: Realtime TTS voice name.language_type: One ofAuto,Chinese,English,German,Italian,Portuguese,Spanish,Japanese,Korean,French, orRussian.base_url: Override the websocket endpoint. For the international region, usewss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file livekit_plugins_alicloud-1.6.2.tar.gz.
File metadata
- Download URL: livekit_plugins_alicloud-1.6.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3772694cea707a5d5b884d1b46cdcba2c96d02963479bd574cb8d477e1c637dc
|
|
| MD5 |
1f2ca79ba65b8b94eb6d0ad8ffe07431
|
|
| BLAKE2b-256 |
11404b17f30101d77b92e4283ce5dd3fb9d13eae52c452645825d154364db27e
|
File details
Details for the file livekit_plugins_alicloud-1.6.2-py3-none-any.whl.
File metadata
- Download URL: livekit_plugins_alicloud-1.6.2-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1213216895161e09edadf96ba37419d4c1d055f5a2ebdb106e1e3b3724942406
|
|
| MD5 |
1286766c558cdf7650cd9f9239543f9d
|
|
| BLAKE2b-256 |
544d145a31fb7a7fa2b90d2acbe3cc72b7bad1c90314eb5037f0b5f84dcc38d2
|