traceAI-livekit
OpenTelemetry instrumentation for LiveKit agents integrated with Future AGI.
This package provides automatic attribute mapping from LiveKit's native OpenTelemetry instrumentation to Future AGI's semantic conventions, ensuring rich and structured traces in your dashboard.
Installation
pip install traceai-livekit
Quick Start
To instrument your LiveKit agent, simply initialize fi-instrumentation and enable the attribute mapping inside your agent's entrypoint.
from livekit.agents import AgentServer, JobContext
from fi_instrumentation.otel import register, ProjectType
from traceai_livekit import enable_http_attribute_mapping
server = AgentServer()
@server.rtc_session()
async def entrypoint(ctx: JobContext):
# 1. Initialize TraceAI (inside entrypoint for multiprocessing safety)
register(
project_name="My LiveKit Agent",
project_type=ProjectType.OBSERVE,
set_global_tracer_provider=True,
)
# 2. Enable LiveKit attribute mapping
# This automatically hooks into LiveKit's telemetry system
enable_http_attribute_mapping()
# ... rest of your agent logic ...
await ctx.connect()
if __name__ == "__main__":
server.run()
Features
- Automatic Attribute Mapping: Converts LiveKit attributes (like
lk.user_input,gen_ai.usage.input_tokens) to Future AGI standard attributes (input.value,llm.tokenCount.prompt). - Raw Data Preservation: Keeps original LiveKit attributes and adds
raw.input/raw.outputfor full debugging context. - Multiprocessing Support: Designed to work with LiveKit's worker process model.
- Event Parsing: Extracts LLM outputs from
gen_ai.choiceevents when available.
Examples
Check the examples/ directory for complete working agents:
simple_agent.py: A basic voice assistant agent.egress_agent.py: An agent with call recording (Egress) enabled.
Metadata
Release files for traceAI-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)
| File | Size | Uploaded | |
|---|---|---|---|
| traceai_livekit-0.1.1.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| traceai_livekit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / traceai_livekit-0.1.1.tar.gz
| Download URL | traceai_livekit-0.1.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a32c304c1854436d6ea427fd8900e8dcbca9420dfbbbd795d8c0d784f98a6a4
|
|
BLAKE2b-256 checksum How to use checksums |
1efa93160d00b499304874a03453241025db60586b8435d8133e9600492e6a4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / traceai_livekit-0.1.1-py3-none-any.whl
| Download URL | traceai_livekit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
692421835b30146f367761e569dad75248dc48de158185061c7cf7b31cfdf8d4
|
|
BLAKE2b-256 checksum How to use checksums |
c296beda1bbc53391f619257cba5b2b533f9a05d3a54205255b02e2a6e06f8dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|