Skip to main content

LiveKit Agent Plugins for Xunfei

Project description

LiveKit Plugins Xunfei

Agent Framework plugin for services from Xunfei(火山引擎). Currently supports STT.

Installation

pip install livekit-plugins-xunfei

Pre-requisites

  • XunFei STT environment variable: XUNFEI_STT_APP_ID, XUNFEI_STT_API_KEY.

Usage

This example shows how to use the Volcengine plugin to create a voice agent that achieved 1 second of latency.

from livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions
from livekit.plugins import xunfei
from dotenv import load_dotenv


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

    session = AgentSession(
        # app_id and api_key can be found in the xfyun console.
        stt=xunfei.STT(app_id="xxx", api_key="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))

Project details


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_xunfei-1.0.17.tar.gz (6.6 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_xunfei-1.0.17-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_xunfei-1.0.17.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.0.17.tar.gz
Algorithm Hash digest
SHA256 20cb349740e014f010aa740d65490865d1a7b81e5eef3d9dd9983932091e1ff4
MD5 7e8574975f5587682b7345eb8497b336
BLAKE2b-256 e0332d5c9f9d25acbaebfec1f4018e3e955517fa992580fa0ff23ec6f4f45ed3

See more details on using hashes here.

File details

Details for the file livekit_plugins_xunfei-1.0.17-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 ad1a5fbee670c1352541e250c4da0b446e909de6d34d9c1385cc7beaa6635ce5
MD5 90a5fd9016cfff41dd8c8c51807a1776
BLAKE2b-256 9e12e9a7da4346b07ec84f75d15c9c419265429b170c25a3c9e086e889046519

See more details on using hashes here.

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