Skip to main content

LiveKit Agent Plugins for Dify

Project description

LiveKit Plugins Dify

Agent Framework plugin for Dify.

Installation

pip install livekit-plugins-dify

Pre-requisites

  • Dify API Key environment variables: DIFY_API_KEY

Usage

This example shows how to use the Dify plugin.

from livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions
from livekit.plugins import dify
from dotenv import load_dotenv


async def entry_point(ctx: JobContext):
    
    await ctx.connect()
    
    agent = Agent(instructions="You are a helpful assistant.")

    session = AgentSession(
        llm = dify.LLM(user="xxx")
    )
    
    await session.start(agent=agent, room=ctx.room)


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_difyai-1.0.22.tar.gz (5.9 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_difyai-1.0.22-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_difyai-1.0.22.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_difyai-1.0.22.tar.gz
Algorithm Hash digest
SHA256 7410965ac0b0c46b253af011719ed914e03ffd95c27073b0b0f7bef29a7dbc58
MD5 dac6bdebb5529086032db28e02368c20
BLAKE2b-256 4e55ba684b1fb44b4b0f2e20d9cacea8e730488f0ccae8a975a578d1cd2b3122

See more details on using hashes here.

File details

Details for the file livekit_plugins_difyai-1.0.22-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_difyai-1.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 db43ec1840e928fa293dc39ce842e0a2701ee09d136361b976bbc0e0fc191956
MD5 4b49040b1668f16778a296734f1993b7
BLAKE2b-256 827b52ddfffa7133c7f794c6ebc8e0c67b9ae733849d2b8da72dd309e9e7c134

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