Skip to main content

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 LLMStream requests become Respan chat spans with request messages, completions, tool calls, tool definitions when available, model, provider, and token usage.
  • LiveKit execute_function_call executions become Respan tool spans.

Use Respan(..., customer_identifier=..., thread_identifier=..., metadata=...) or respan.propagate_attributes(...) to attach Respan attributes to LiveKit spans.

Metadata

Release files for respan-instrumentation-livekit 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-livekit 0.1.1
File Size Uploaded
respan_instrumentation_livekit-0.1.1.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-livekit 0.1.1
File Interpreter ABI Platform
respan_instrumentation_livekit-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / respan_instrumentation_livekit-0.1.1.tar.gz

Download URL respan_instrumentation_livekit-0.1.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
87d23cbfeb39228b5092f1883ae96fd1708efb774a8db02b03c8a9d893bbf830
BLAKE2b-256 checksum
How to use checksums
757d96e8207380844425bf6264f5bd87e29166226fc6af26a6efb9bf08ac9b96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_livekit-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_livekit-0.1.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f755873679f974a1815e2448a6b000b2dd34ee5e649728c47300d0f419987d42
BLAKE2b-256 checksum
How to use checksums
6aeab39900f288a7aec963f8760a49cb0e74f4b64574cdb437df97403ef0ee32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page