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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dbfb7fcbc1a0246629aa699e06f1bfaed8a958b914942fe8dcee3a1518d6f58c
MD5 aa5eb79fb38916f7257e3ffd59bbc7a4
BLAKE2b-256 f0cc80e563fd97c800e844d3aa5a86f6f7754cf50d238d39b72fa2432e581a5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_xunfei-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b867c003e4b4523207bfd69ca9cf62d7e48270408b50d8ab63458ad2b0c18889
MD5 1bcb667f386877ebc3cdd3d50aef0eaa
BLAKE2b-256 6c08d989c75c6b1b21a96a990ed16b3d6ab280c8ede6d23a2cfdc5228210a093

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