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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.5.tar.gz
Algorithm Hash digest
SHA256 6e0140e1961bb760e7e97543f5a2b3da4d7b60287bf15ecef1fa143a10a250a0
MD5 a74b7d0b157dd23a50b61b44e6f1f873
BLAKE2b-256 40fdb34cbe79f4d68f9301779ab5064f09b0b2e00093edc60c0f1cac009cfd84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 12fa7b5524f0ee32dbee905c809fb57d675f799f829e2ec044f72de999e1872b
MD5 e09b30c9720ef15217eaf1d79a6e5018
BLAKE2b-256 bdf45e899d1e328ab98d2bb1fa37ede1cfaa52c7deaaabaed811b2b51dacc6d6

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