Respan instrumentation plugin for LiveKit Agents
Project description
Respan LiveKit Instrumentation
Respan instrumentation plugin for LiveKit Agents.
It translates LiveKit's native livekit-agents LLM spans into canonical Respan
chat spans and emits Respan tool spans for execute_function_call.
Installation
pip install respan-ai respan-instrumentation-livekit livekit-agents
Usage
import os
from livekit.agents import llm
from respan import Respan, workflow
from respan_instrumentation_livekit import LiveKitInstrumentor
respan = Respan(
api_key=os.environ["RESPAN_API_KEY"],
app_name="livekit-example",
instrumentations=[LiveKitInstrumentor()],
)
@workflow(name="livekit_chat.workflow")
async def run_chat(model: llm.LLM) -> str:
chat_ctx = llm.ChatContext.empty()
chat_ctx.add_message(role="user", content="Say hello in one sentence.")
response = await model.chat(chat_ctx=chat_ctx).collect()
return response.text
Captured Spans
- LiveKit
LLMStreamrequests become Respanchatspans with request messages, completions, tool calls, tool definitions when available, model, provider, and token usage. - LiveKit
execute_function_callexecutions become Respantoolspans.
Use Respan(..., customer_identifier=..., thread_identifier=..., metadata=...)
or respan.propagate_attributes(...) to attach Respan attributes to LiveKit
spans.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_livekit-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_livekit-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a47a5cf73d13f9e585c070cd560dd0a3ac162d27c3793bdb8da1d74633ff15
|
|
| MD5 |
b0a400d233cc9bbe558a7d1b93e7b216
|
|
| BLAKE2b-256 |
f26450f60e0e9cd7ebc7620a68f783f8bccb6be4b2d5577eb9f4289f70f50903
|
File details
Details for the file respan_instrumentation_livekit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_livekit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d58fc01dda2df79b25743e4739342ae105087b4e8bdb93f0fa5264fdcec16426
|
|
| MD5 |
43e1abd33f224e56f706b6f57a422625
|
|
| BLAKE2b-256 |
690fe1519ca8ea0b23939d4db8b3a9f80fca9afd308cbf34c29aac1826d4e62d
|