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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.2.6.tar.gz
Algorithm Hash digest
SHA256 4e0e06a7214f46c53dc3b7e78ef05accb0a93e1c86bdc4435534ac51ebf7a4c4
MD5 c714b428041dc3c3defa503d643155ce
BLAKE2b-256 a4b509084b4eb684102670768ae862a723d575be61b6b4f096df89bb5fc48c81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_zhipu-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 33719dcb959ed8b14cecca04157ca030ef4096a4f8d4736461acb51ddaf37988
MD5 208c363ecf5edae0e242e77f638ee025
BLAKE2b-256 ea0a66522fb87f4cf94e31df57d37e429514e2e873b11a4162a192951ae6bbe4

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