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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post3.tar.gz
Algorithm Hash digest
SHA256 2d847e55c03b06879b0f7f424494aea7112349f7868447e5ec4ac6eebd685b55
MD5 ae818eef8a2cd8d83c744aacfa63a723
BLAKE2b-256 594f1e3a738cc8649bf38a80f8e7c754a39a0b8687b7313cf792ad861a04baea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.1.2.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 a36d046d0d1dc336a77dd09b89e0197b1550f045ac4d23147c526d537b70615f
MD5 ff73ec9ff26a207e9457b1f34a48844d
BLAKE2b-256 6fec8c849f7a0c6747fa9d6f59bc3a9f6ec83f2d16187f978252f1229619db75

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