livekit-plugins-volcengine


Namelivekit-plugins-volcengine JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryLiveKit Agent Plugins for Volcengine
upload_time2025-07-23 02:53:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords audio livekit realtime video webrtc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # livekit-plugins-volcengine

适配火山引擎服务的[livekit-agent](https://github.com/livekit/agents)框架插件。目前支持[TTS](https://www.volcengine.com/docs/6561/79817), [LLM](https://www.volcengine.com/docs/82379/1298454#%E6%B5%81%E5%BC%8F%E8%B0%83%E7%94%A8), [STT](https://www.volcengine.com/docs/6561/80818#python),[BigModelSTT](https://www.volcengine.com/docs/6561/1354869),[Realtime](https://www.volcengine.com/docs/6561/1594356)

## 安装
```python
pip install livekit-plugins-volcengine
```

## 环境变量

- Volcengine TTS: `VOLCENGINE_TTS_ACCESS_TOKEN`
- Volcengine STT: `VOLCENGINE_STT_ACCESS_TOKEN`
- Volcengine LLM: `VOLCENGINE_LLM_API_KEY`
- Volcengine Realtime: `VOLCENGINE_REALTIME_ACCESS_TOKEN`

## 使用示例

以下代码展示了如何在`livekit-agent`中使用`livekit-plugins-volcengine`插件。

```python
from livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions
from livekit.plugins import volcengine, deepgram, silero
from dotenv import load_dotenv


async def entry_point(ctx: JobContext):
    
    await ctx.connect()
    
    agent = Agent(instructions="You are a helpful assistant.")

    session = AgentSession(
        # 语音识别:https://console.volcengine.com/speech/service/16
        stt=volcengine.STT(app_id="xxx", cluster="xxx"),
        # 大模型语音识别:https://console.volcengine.com/speech/service/10011
        stt = volcengine.BigModelSTT(app_id="xxx"),
        # 语音识别:https://www.volcengine.com/docs/6561/97465
        tts=volcengine.TTS(app_id="xxx", cluster="xxx", vioce_type="BV001_V2_streaming"),
        # 大语言模型:https://www.volcengine.com/docs/82379/1513689
        llm=volcengine.LLM(model="doubao-1-5-lite-32k-250115"),
        # 端到端实时语音大模型:https://www.volcengine.com/docs/6561/1594356
        llm=volcengine.RealtimeModel(app_id="xxxx",
                                     speaking_style="xxxx", # 回复语音风格
                                     system_role="xxx", # 系统提示词
                                     opening="xxx") # 开场词
    )
    
    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))
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "livekit-plugins-volcengine",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "audio, livekit, realtime, video, webrtc",
    "author": null,
    "author_email": "wangmengdi <790990241@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/70/fa/455e43056fc667b2050949660c727d95fdfb35083fba31f608e20d3635bf/livekit_plugins_volcengine-1.2.0.tar.gz",
    "platform": null,
    "description": "# livekit-plugins-volcengine\n\n\u9002\u914d\u706b\u5c71\u5f15\u64ce\u670d\u52a1\u7684[livekit-agent](https://github.com/livekit/agents)\u6846\u67b6\u63d2\u4ef6\u3002\u76ee\u524d\u652f\u6301[TTS](https://www.volcengine.com/docs/6561/79817), [LLM](https://www.volcengine.com/docs/82379/1298454#%E6%B5%81%E5%BC%8F%E8%B0%83%E7%94%A8), [STT](https://www.volcengine.com/docs/6561/80818#python)\uff0c[BigModelSTT](https://www.volcengine.com/docs/6561/1354869)\uff0c[Realtime](https://www.volcengine.com/docs/6561/1594356)\n\n## \u5b89\u88c5\n```python\npip install livekit-plugins-volcengine\n```\n\n## \u73af\u5883\u53d8\u91cf\n\n- Volcengine TTS: `VOLCENGINE_TTS_ACCESS_TOKEN`\n- Volcengine STT: `VOLCENGINE_STT_ACCESS_TOKEN`\n- Volcengine LLM: `VOLCENGINE_LLM_API_KEY`\n- Volcengine Realtime: `VOLCENGINE_REALTIME_ACCESS_TOKEN`\n\n## \u4f7f\u7528\u793a\u4f8b\n\n\u4ee5\u4e0b\u4ee3\u7801\u5c55\u793a\u4e86\u5982\u4f55\u5728`livekit-agent`\u4e2d\u4f7f\u7528`livekit-plugins-volcengine`\u63d2\u4ef6\u3002\n\n```python\nfrom livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions\nfrom livekit.plugins import volcengine, deepgram, silero\nfrom dotenv import load_dotenv\n\n\nasync def entry_point(ctx: JobContext):\n    \n    await ctx.connect()\n    \n    agent = Agent(instructions=\"You are a helpful assistant.\")\n\n    session = AgentSession(\n        # \u8bed\u97f3\u8bc6\u522b\uff1ahttps://console.volcengine.com/speech/service/16\n        stt=volcengine.STT(app_id=\"xxx\", cluster=\"xxx\"),\n        # \u5927\u6a21\u578b\u8bed\u97f3\u8bc6\u522b\uff1ahttps://console.volcengine.com/speech/service/10011\n        stt = volcengine.BigModelSTT(app_id=\"xxx\"),\n        # \u8bed\u97f3\u8bc6\u522b\uff1ahttps://www.volcengine.com/docs/6561/97465\n        tts=volcengine.TTS(app_id=\"xxx\", cluster=\"xxx\", vioce_type=\"BV001_V2_streaming\"),\n        # \u5927\u8bed\u8a00\u6a21\u578b\uff1ahttps://www.volcengine.com/docs/82379/1513689\n        llm=volcengine.LLM(model=\"doubao-1-5-lite-32k-250115\"),\n        # \u7aef\u5230\u7aef\u5b9e\u65f6\u8bed\u97f3\u5927\u6a21\u578b\uff1ahttps://www.volcengine.com/docs/6561/1594356\n        llm=volcengine.RealtimeModel(app_id=\"xxxx\",\n                                     speaking_style=\"xxxx\", # \u56de\u590d\u8bed\u97f3\u98ce\u683c\n                                     system_role=\"xxx\", # \u7cfb\u7edf\u63d0\u793a\u8bcd\n                                     opening=\"xxx\") # \u5f00\u573a\u8bcd\n    )\n    \n    await session.start(agent=agent, room=ctx.room)\n    \n    await session.generate_reply()\n\nif __name__ == \"__main__\":\n    load_dotenv()\n    cli.run_app(WorkerOptions(entrypoint_fnc=entry_point))\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "LiveKit Agent Plugins for Volcengine",
    "version": "1.2.0",
    "project_urls": null,
    "split_keywords": [
        "audio",
        " livekit",
        " realtime",
        " video",
        " webrtc"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5dbbfd7b5b71e4da19f08148cf83f7dc8844051fd3a7ecae1420912fac436a79",
                "md5": "0c883b29527f9263f486d2806cd84c0f",
                "sha256": "727937fd1eaac60d62f4377d048b11880aae04008dd461008aa673f43913fb18"
            },
            "downloads": -1,
            "filename": "livekit_plugins_volcengine-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c883b29527f9263f486d2806cd84c0f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 30290,
            "upload_time": "2025-07-23T02:53:55",
            "upload_time_iso_8601": "2025-07-23T02:53:55.536771Z",
            "url": "https://files.pythonhosted.org/packages/5d/bb/fd7b5b71e4da19f08148cf83f7dc8844051fd3a7ecae1420912fac436a79/livekit_plugins_volcengine-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "70fa455e43056fc667b2050949660c727d95fdfb35083fba31f608e20d3635bf",
                "md5": "75576303d85a42fb6420277f6e1f46bd",
                "sha256": "203af8483ab549676de379889d9c35c433f22a8cf5d2685c95af0f7723422f64"
            },
            "downloads": -1,
            "filename": "livekit_plugins_volcengine-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "75576303d85a42fb6420277f6e1f46bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25070,
            "upload_time": "2025-07-23T02:53:56",
            "upload_time_iso_8601": "2025-07-23T02:53:56.633819Z",
            "url": "https://files.pythonhosted.org/packages/70/fa/455e43056fc667b2050949660c727d95fdfb35083fba31f608e20d3635bf/livekit_plugins_volcengine-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-23 02:53:56",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "livekit-plugins-volcengine"
}
        
Elapsed time: 1.15420s