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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post1.tar.gz
Algorithm Hash digest
SHA256 32f0762bee9a5ccff425e833fd2e38214be547eec16613ba08b06c5784aae072
MD5 d13d8aa9f773ed627e203664fa47af56
BLAKE2b-256 d48525d10532f2dc3bddd3c9cb221b8372bfaeada221c55ffa1aa7d3e7aa98d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf9f8e43988377ac84d063ac8a1ddac407812122efde6f8530e3e11796ab749
MD5 4bfede84ba1d0a06cc32c39c010026b9
BLAKE2b-256 dec9a671c356c3653f1290dcff4fb8ff183cdba903996e392c3dd478a49a9724

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