parlot-instrumentation-livekit
LiveKit span processor, egress recording to R2, and platform.ref.* attributes for Parlot session resolve.
Full public guide: LiveKit (checklist, recording, contract maps, escalation, OTEL coverage). Shared semantics (escalation roles, metadata, refs): Concepts.
Integration checklist
Two steps are required for full Parlot behavior. All SDK examples follow this pattern.
1. configure() at import (required)
Call before constructing AgentSession — patches AgentSession.__init__, sets up OTLP export to PARLOT_ENDPOINT, and installs turn/handoff/close event hooks.
from parlot.instrumentation.livekit import configure
configure()
Optional: agent_id= for canonical deployment identity and version= for deployment version. Full resolution order is in the SDK README.
What to expect for version
configure(version=...) resolves once at startup (first non-empty wins): version= kwarg → __main__.__version__ / VERSION → PARLOT_AGENT_VERSION → local git short SHA (only when cwd has a .git directory).
If none resolve, gen_ai.agent.version is omitted. The platform Versions tab then stays empty (it filters agent_version != '').
LiveKit job processes: with python agent.py dev (or spawned job_proc workers), __main__ is LiveKit’s IPC entrypoint, not your agent file. A module-level __version__ on agent.py often does not resolve. The parent dev watcher also skips configure() via _is_livekit_dev_watch_parent, so instrumentation runs in the child where __main__ is not your entrypoint. Example dirs like examples/livekit/restaurant-agent usually have no .git, so the git SHA fallback also fails.
Reliable patterns for LiveKit:
configure(agent_id="restaurant-agent", version="0.1.0")
or set PARLOT_AGENT_VERSION=0.1.0 at deploy/runtime.
2. await ctx.connect() before session.start() (required)
Call explicitly in your entrypoint. Parlot patches JobContext.connect to:
- Refresh
platform.ref.room_sidand room metadata on the live session span (paste-search and platform UI linking). - Start Room Composite Egress to Cloudflare R2 when recording is enabled.
async def entrypoint(ctx: JobContext):
await ctx.connect()
session = AgentSession(...)
await session.start(agent=..., room=ctx.room)
Without ctx.connect() you may still see basic telemetry — turns, handoffs, session close — if you pass room=ctx.room to session.start(). You will not get:
- Room audio recording (egress to R2)
- A reliable
room_sidon the session span for paste-search and UI linking
Always call ctx.connect() in production agents and in all Parlot examples.
Environment
Set PARLOT_ENDPOINT and PARLOT_API_KEY. The API key is org-scoped — mint it in Parlot Settings → API Keys (shown once on create). Recording needs Settings → Recording (or configure(record=…) / job metadata) plus agent LIVEKIT_* credentials. Org LiveKit integration (signing key + API secret) is optional: it enables signed egress webhooks for faster audio_available confirmation; without it, recordings still upload to R2 and confirm via lazy R2 reconcile when the session is opened.
Recording policy (precedence: job metadata → configure(record=…) → Settings → Recording via bootstrap):
- UI: Parlot → Settings → Recording (per-agent toggles + globs for unseen agents)
- Code:
configure(record=True),configure(record=False), orconfigure(record=["my-agent*"]) - Dispatch: job metadata
{ "record": true|false }
Session application logs (Python logging, default on) use the same control path via Settings → Logs / configure(capture_logs=…) / job capture_logs. Not print(). Treat content like stdout for PII.
Generative AI content capture (message bodies / tool payloads; default on) is documented in Concepts. Override with configure(capture_genai_content=True|False).
Optional: PARLOT_DIAGNOSTICS=off to disable SDK self-diagnostics (export/handler failures reported to Parlot). Default is on; metadata only, no conversation content. Under sustained outage the buffer drops and circuit-breaks — it does not retry-storm the collector.
Examples
examples/livekit/livekit-voice— minimal hello-worldexamples/livekit/multi-agent— storytelling handoffsexamples/livekit/restaurant-agent— greeter → specialist routingexamples/livekit/hotel-receptionist— boutique-hotel receptionist + seed sample sessions
Development
uv sync --group dev
uv run pytest -q
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 parlot_instrumentation_livekit-0.1.0.tar.gz.
File metadata
- Download URL: parlot_instrumentation_livekit-0.1.0.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a4f227bbe397791aa5c21bec38bcf5f56ff38ff8ec8e11e41dfa4dcccd82766
|
|
| MD5 |
18c0439f23ca1205d117f5136ef3da68
|
|
| BLAKE2b-256 |
f7b1e9fba466d336b28d6056c9216f37edf5fafd940cd9089afd5b61b6bc9da3
|
Provenance
The following attestation bundles were made for parlot_instrumentation_livekit-0.1.0.tar.gz:
Publisher:
publish.yml on parlot-ai/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parlot_instrumentation_livekit-0.1.0.tar.gz -
Subject digest:
8a4f227bbe397791aa5c21bec38bcf5f56ff38ff8ec8e11e41dfa4dcccd82766 - Sigstore transparency entry: 2553104816
- Sigstore integration time:
-
Permalink:
parlot-ai/sdk@2189c5475a7a63a91d516439992ce791e3f3d375 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/parlot-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2189c5475a7a63a91d516439992ce791e3f3d375 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file parlot_instrumentation_livekit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: parlot_instrumentation_livekit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 61.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
562fe71091fde5f54b3964fd5db9cabff10e4bb47ac6e81f72437e1a1428d2d7
|
|
| MD5 |
88c82f092016f59c6d053ad53a4d5cda
|
|
| BLAKE2b-256 |
46c2812c7369433686fe23cad267ca7dc121b32a51ee49f633ffddb57441344c
|
Provenance
The following attestation bundles were made for parlot_instrumentation_livekit-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on parlot-ai/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parlot_instrumentation_livekit-0.1.0-py3-none-any.whl -
Subject digest:
562fe71091fde5f54b3964fd5db9cabff10e4bb47ac6e81f72437e1a1428d2d7 - Sigstore transparency entry: 2553104859
- Sigstore integration time:
-
Permalink:
parlot-ai/sdk@2189c5475a7a63a91d516439992ce791e3f3d375 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/parlot-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2189c5475a7a63a91d516439992ce791e3f3d375 -
Trigger Event:
workflow_dispatch
-
Statement type: