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.1.0.post0.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.1.0.post0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_xunfei-1.1.0.post0.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0.post0.tar.gz
Algorithm Hash digest
SHA256 2177a4255d8c38983a56f07a5482aaf20864c39f6f679f86d63ca74329dc1d3e
MD5 9ec8bb4ff2846a2a33b37bc78d309816
BLAKE2b-256 921d689ab9b04f47a36cb3e6fe11d3c2f17908b5f9d7c7f36bb6b55b352178ff

See more details on using hashes here.

File details

Details for the file livekit_plugins_xunfei-1.1.0.post0-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 de5667fd478d0df2ed7be2655be5408c3daf60b9121cb2bef483c48ad8a41a6f
MD5 84e36cab826ae77ed10920bf532df585
BLAKE2b-256 8949f8e4a555ae2edea497738f2b8f27ec6c35dd19f6e82806cfe529bd586dbf

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