Skip to main content

LiveKit Agent Plugins for Zhipu

Project description

LiveKit Plugins Zhipu(智谱)

Agent Framework plugin for services from Zhipu. Currently supports LLM

Installation

pip install livekit-plugins-zhipu

Pre-requisites

  • Zhipu LLM environment variable: ZHIPU_LLM_API_KEY

Usage

This example shows how to use the Zhipu plugin to create a voice agent.

from livekit.agents import Agent, AgentSession, JobContext, cli, WorkerOptions
from livekit.plugins import zhipu
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=zhipu.LLM(model="glm-4-flashx"),
    )
    
    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_zhipu-1.2.3.tar.gz (7.0 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_zhipu-1.2.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_zhipu-1.2.3.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.2.3.tar.gz
Algorithm Hash digest
SHA256 8a2d06a9ec61a6ece685c45e7607fbf55ed76a5f4045cb2bd596796b09e32e8d
MD5 507033311e5609bed8e0949c85ff2fb9
BLAKE2b-256 5b207bb749a38836ab478d79279e20ccca77bfe960ba9c93ae85d0c8c59db081

See more details on using hashes here.

File details

Details for the file livekit_plugins_zhipu-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c2ed6a4213452c99baf4150b4e5621ec37c8241a29731993a89890f6341b4e
MD5 a38dc24fe4cee1673c7d1fac26eef0d1
BLAKE2b-256 bf49b90e42bcae9a1934e9030ef104ee2b936b4542e6176fd10f65e1d6835c47

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