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

Uploaded Python 3

File details

Details for the file livekit_plugins_zhipu-1.1.2.post4.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post4.tar.gz
Algorithm Hash digest
SHA256 957377b9831611efff0d87a82d7b5437ef6c135095bf0403221fe0038a1bf3e3
MD5 6ff1319f64e5124ff5e64cb53c7c47b3
BLAKE2b-256 58bbbbf606ada46010ec2bbdf92be74e56b073fc15f81616be9437cf01a18389

See more details on using hashes here.

File details

Details for the file livekit_plugins_zhipu-1.1.2.post4-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post4-py3-none-any.whl
Algorithm Hash digest
SHA256 0639de4399a52e6c755f6110dc2d92a7d3e55cf9dd19908283050753e0d73cbb
MD5 a63fd30990bafa6c478082ffdcc29c55
BLAKE2b-256 a09ed90617469486dd8ea0446d22e0acc06539e49939a9d69069f679bfbbed4e

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