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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.2.post7.tar.gz
Algorithm Hash digest
SHA256 4d58119df134dfb88284e0c4ecf5c0e8e170f38cd807f3489bee81d630f90f96
MD5 46b77c419790f985a4df3b15de94d2f2
BLAKE2b-256 a6633a7609d94d42577ec4e23ccd5bf82d7b15946f8c9e4b832e64b639c7da30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.2.post7-py3-none-any.whl
Algorithm Hash digest
SHA256 631dd3c29211f939a6aa264f3cab05e1219107a07d511ab2558067182f83e356
MD5 c6247b49405f30d9d5d5663315ac066c
BLAKE2b-256 c1dbc70ae4be6d695f9c30cad9a7dd7b63da90f60d3bcca1cd45b7c09aa811da

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