Skip to main content

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__ / VERSIONPARLOT_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_sid and 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_sid on 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), or configure(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

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

parlot_instrumentation_livekit-0.1.0.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parlot_instrumentation_livekit-0.1.0-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file parlot_instrumentation_livekit-0.1.0.tar.gz.

File metadata

File hashes

Hashes for parlot_instrumentation_livekit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8a4f227bbe397791aa5c21bec38bcf5f56ff38ff8ec8e11e41dfa4dcccd82766
MD5 18c0439f23ca1205d117f5136ef3da68
BLAKE2b-256 f7b1e9fba466d336b28d6056c9216f37edf5fafd940cd9089afd5b61b6bc9da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for parlot_instrumentation_livekit-0.1.0.tar.gz:

Publisher: publish.yml on parlot-ai/sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file parlot_instrumentation_livekit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parlot_instrumentation_livekit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 562fe71091fde5f54b3964fd5db9cabff10e4bb47ac6e81f72437e1a1428d2d7
MD5 88c82f092016f59c6d053ad53a4d5cda
BLAKE2b-256 46c2812c7369433686fe23cad267ca7dc121b32a51ee49f633ffddb57441344c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page