LiveKit Agent Plugins for Alibaba Cloud
Project description
livekit-plugins-aliyun
适配阿里云百炼的livekit-agent框架插件。目前支持TTS, LLM, STT。
安装
pip install livekit-plugins-aliyun
环境变量
- LLM, STT, TTS:
DASHSCOPE_API_KEY
使用示例
以下代码展示了如何在livekit-agent中使用livekit-plugins-aliyun插件。
from livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions
from livekit.plugins import aliyun
from dotenv import load_dotenv
async def entry_point(ctx: JobContext):
await ctx.connect()
agent = Agent(instructions="You are a helpful assistant.")
session = AgentSession(
stt=aliyun.STT(model="paraformer-realtime-v2"),
tts=aliyun.TTS(model="cosyvoice-v2", voice="longcheng_v2"),
llm=aliyun.LLM(model="qwen-plus"),
)
await session.start(agent=agent, room=ctx.room)
await session.generate_reply()
if __name__ == "__main__":
load_dotenv()
cli.run_app(WorkerOptions(entrypoint_fnc=entry_point))
若需要使用STT热词功能,需要在STT插件中配置vocabulary_id参数。
session = AgentSession(
stt=aliyun.STT(model="paraformer-realtime-v2", vocabulary_id="your_vocabulary_id"),
tts=aliyun.TTS(model="cosyvoice-v2", voice="longcheng_v2"),
llm=aliyun.LLM(model="qwen-plus"),
)
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_aliyun-1.2.8.tar.gz.
File metadata
- Download URL: livekit_plugins_aliyun-1.2.8.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55aeda5c1ef80ad8c564081f6a9832ae4f8a92668771183cd9ff4bbef5a2b7a4
|
|
| MD5 |
bd3b39c8b58fb6898220397f445f6dda
|
|
| BLAKE2b-256 |
c51ea3b9a838e1187ea891b22166507866542dc0344f120bd87df2fe7a86b2ea
|
File details
Details for the file livekit_plugins_aliyun-1.2.8-py3-none-any.whl.
File metadata
- Download URL: livekit_plugins_aliyun-1.2.8-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04e20a70b62bcfcec622b164d0efe1e48d806814da7713228316f5a59f8930a0
|
|
| MD5 |
6445634652e12f2b3fefd6bd472feffd
|
|
| BLAKE2b-256 |
232e7002c0e00d7cb72915a521bfdda39ba0287a5636dcb228a40a6acc79f9e4
|