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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 e96c3277ccd973ced37ee04546fcf5c43751627e56a5e681233963ff4452a2f0
MD5 b79696e24a7d2280beac42d24c3783ea
BLAKE2b-256 6fbd11d6a4c86e431daa3aee396586654fd765a8bd3e3d76799c050f5005f402

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 a11e469963d427fb5c1fb8d31a828ac1882ef73c6fcca05ff57831fec7791712
MD5 37ae48b887273a9a0c3d0c284c1f85fe
BLAKE2b-256 32cd03084c08c1439a106d4250488fb67a8d52ce926b0c8326d8039d96879189

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