Monitoring plugin for exporting LiveKit AgentSession call review payloads to Hamming
Project description
Hamming plugin for LiveKit Agents
Post-call monitoring for LiveKit Agents with Hamming.
Installation
Install the plugin from a checked out repository or extracted source archive:
python -m pip install ./livekit-plugins/livekit-plugins-hamming
Pre-requisites
You will need Hamming credentials before configuring the plugin.
HAMMING_API_KEYHAMMING_EXTERNAL_AGENT_ID
Credentials can be passed directly or through environment variables.
Usage
import os
from livekit.agents import AgentSession, JobContext
from livekit.plugins import hamming
async def entrypoint(ctx: JobContext) -> None:
await ctx.connect()
hamming.configure_hamming(
api_key=os.environ["HAMMING_API_KEY"],
external_agent_id=os.environ["HAMMING_EXTERNAL_AGENT_ID"],
recording={"mode": "session_audio"},
)
session = AgentSession()
hamming.attach_session(session, job_ctx=ctx)
Recording Modes
The plugin supports explicit recording modes through configure_hamming(recording=...).
If recording is omitted, the plugin exports monitoring payloads only and does not start or resolve recordings.
none- Send monitoring payload only.
session_audio- Use LiveKit session recording and inline
recording_captureon the final/collectpayload.
- Use LiveKit session recording and inline
participant_egress- Start managed LiveKit participant egress and send dual-track recording URLs derived from deterministic output paths.
room_composite- Start managed LiveKit room composite egress and send a single
recording_urlderived from a deterministic output path.
- Start managed LiveKit room composite egress and send a single
Session Audio (Default Simple Path)
hamming.configure_hamming(
api_key=os.environ["HAMMING_API_KEY"],
external_agent_id=os.environ["HAMMING_EXTERNAL_AGENT_ID"],
recording={"mode": "session_audio"},
)
Managed Participant Egress
hamming.configure_hamming(
api_key=os.environ["HAMMING_API_KEY"],
external_agent_id=os.environ["HAMMING_EXTERNAL_AGENT_ID"],
recording={
"mode": "participant_egress",
"livekit": {
"url": os.environ["LIVEKIT_URL"],
"api_key": os.environ["LIVEKIT_API_KEY"],
"api_secret": os.environ["LIVEKIT_API_SECRET"],
},
"s3": {
# Required for deterministic artifact URL resolution.
"public_url_base": os.environ.get("LIVEKIT_RECORDING_PUBLIC_URL_BASE", ""),
# Optional. Include upload credentials only if the plugin should write
# directly to S3 instead of relying on LiveKit project defaults.
"access_key": os.environ.get("LIVEKIT_RECORDING_S3_ACCESS_KEY", ""),
"secret": os.environ.get("LIVEKIT_RECORDING_S3_SECRET", ""),
"region": os.environ.get("LIVEKIT_RECORDING_S3_REGION", ""),
"bucket": os.environ.get("LIVEKIT_RECORDING_S3_BUCKET", ""),
},
},
)
Managed Room Composite
hamming.configure_hamming(
api_key=os.environ["HAMMING_API_KEY"],
external_agent_id=os.environ["HAMMING_EXTERNAL_AGENT_ID"],
recording={
"mode": "room_composite",
"livekit": {
"url": os.environ["LIVEKIT_URL"],
"api_key": os.environ["LIVEKIT_API_KEY"],
"api_secret": os.environ["LIVEKIT_API_SECRET"],
},
"audio_only": True,
"file_type": "ogg",
},
)
Notes:
- Managed remote recording modes require LiveKit server API credentials.
- Managed remote recording modes also require
job_ctxwhen callinghamming.attach_session(...). - Managed remote recording modes require deterministic artifact URL resolution via
recording.s3.public_url_baseorrecording.s3.bucket+recording.s3.region. - If you provide full S3 credentials, the plugin uses those upload settings for egress output.
- If you omit S3 upload credentials, your LiveKit project must already have default file output storage configured.
- The plugin does not poll LiveKit for completed artifact locations; it derives the final public URLs from the configured output path.
Verify configuration
import os
from livekit.plugins import hamming
report = hamming.doctor(api_key=os.environ["HAMMING_API_KEY"])
print(report.to_dict())
Notes
- Sessions are exported when attached through
hamming.attach_session(...). - Recording is opt-in. Omitting
recording=...sends monitoring payloads without recording artifacts. auto_record_audio=Trueis still supported as a backward-compatible alias forrecording={"mode": "session_audio"}.- Managed remote recording modes stop egress on close and send deterministic artifact URLs through the same
/api/rest/v2/collectingestion path.
Troubleshooting
RuntimeError: hamming is not configured- Call
hamming.configure_hamming(...)beforehamming.attach_session(...).
- Call
ValueError: Hamming API key required- Set
HAMMING_API_KEYor passapi_key=....
- Set
external_agent_id is required- Set
HAMMING_EXTERNAL_AGENT_IDor passexternal_agent_id=....
- Set
Unsupported recording mode- Use
none,session_audio,participant_egress, orroom_composite.
- Use
recording mode 'participant_egress' requires LiveKit server credentials- Provide
recording.livekitor setLIVEKIT_URL,LIVEKIT_API_KEY, andLIVEKIT_API_SECRET.
- Provide
recording mode 'participant_egress' requires deterministic artifact URL resolution- Provide
recording.s3.public_url_baseorrecording.s3.bucket+recording.s3.region.
- Provide
recording mode 'participant_egress' requires JobContext- Pass
job_ctx=ctxtohamming.attach_session(...)or call it from inside the active LiveKit job.
- Pass
Project details
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 livekit_plugins_hamming-1.5.2.tar.gz.
File metadata
- Download URL: livekit_plugins_hamming-1.5.2.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b2a91aedef5cc2f7a9bcfb425669caecab5563476f299161cec51267d3b6e4
|
|
| MD5 |
14a5254bef75579834392e302cda8c7f
|
|
| BLAKE2b-256 |
dd1ad86b2bc68c93fa52b585e2ed6747f2b4331f8e929cbe523a55c2345bc42c
|
Provenance
The following attestation bundles were made for livekit_plugins_hamming-1.5.2.tar.gz:
Publisher:
publish.yml on livekit/agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livekit_plugins_hamming-1.5.2.tar.gz -
Subject digest:
73b2a91aedef5cc2f7a9bcfb425669caecab5563476f299161cec51267d3b6e4 - Sigstore transparency entry: 1258473018
- Sigstore integration time:
-
Permalink:
livekit/agents@38f1d6960b3e539529aa2900ab650d5b09891c39 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/livekit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38f1d6960b3e539529aa2900ab650d5b09891c39 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file livekit_plugins_hamming-1.5.2-py3-none-any.whl.
File metadata
- Download URL: livekit_plugins_hamming-1.5.2-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
410c4b51990960ee5de68ba50acf5e10526b3e43e99e17d4ac3b1ae499d92460
|
|
| MD5 |
e9a75e21b3cb9236489e8ebf9e61399f
|
|
| BLAKE2b-256 |
620f4057323b4ec1f3d595ff50fe9d948c2b6670bad2886ac284a12f974ed33b
|
Provenance
The following attestation bundles were made for livekit_plugins_hamming-1.5.2-py3-none-any.whl:
Publisher:
publish.yml on livekit/agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livekit_plugins_hamming-1.5.2-py3-none-any.whl -
Subject digest:
410c4b51990960ee5de68ba50acf5e10526b3e43e99e17d4ac3b1ae499d92460 - Sigstore transparency entry: 1258473096
- Sigstore integration time:
-
Permalink:
livekit/agents@38f1d6960b3e539529aa2900ab650d5b09891c39 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/livekit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38f1d6960b3e539529aa2900ab650d5b09891c39 -
Trigger Event:
pull_request
-
Statement type: