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 xunfei plugin to create a voice agent.

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.2.9.tar.gz (6.5 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.2.9-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.2.9.tar.gz
Algorithm Hash digest
SHA256 41a6282673cf6eb3abbff4f6a10c0c59e9cb488a16bf383260ca34c91ae7fc45
MD5 9cf98548c2290c9e3af75e8f7344c90d
BLAKE2b-256 73bcfcc9bffbdca51b3a5c6aa0445f33d7bd6c957a75f3f63390d37775749254

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 216f6fa93be41a5ea1d07c356ab01b04819d7b07e7a2212b5eb85b73ffa99204
MD5 6a22e634e68ea278fabcf74778546383
BLAKE2b-256 f34cff7d3b585f76d4f6df7ed87e548d8851f978247603808c36a3fa4b4a159f

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