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

Uploaded Python 3

File details

Details for the file livekit_plugins_xunfei-1.1.2.post6.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.2.post6.tar.gz
Algorithm Hash digest
SHA256 f3bfd4812489dfbb9fea450fa63e914d440500f758e94a101cada3a34852c5ee
MD5 75e36a9ef8540a8ede8e82642225005b
BLAKE2b-256 fef5aed726e76f08aa678ad458ecaf458ab3120aebe5b4cba1e7287b94a04699

See more details on using hashes here.

File details

Details for the file livekit_plugins_xunfei-1.1.2.post6-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.2.post6-py3-none-any.whl
Algorithm Hash digest
SHA256 e397ffe74cebcd31bd39fd7655bfe8ecbfd0d947a1a6ab45f88fafc5bb888f4e
MD5 183d88a05eb5d5685e127e4176a48a45
BLAKE2b-256 805d22d7f2486a489a1b65b46761ef6171a9a87b17fa1783d2b4165dabb7fb10

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