✨(agents) initialize LiveKit agent from multi-user transcriber example
Create Python script based on LiveKit's multi-user transcriber example with enhanced request_fnc handler that ensures job uniqueness by room. A transcriber sends segments to every participant present in a room and transcribes every participant's audio. We don't need several transcribers in the same room. Made the worker hidden - by default it uses auto dispatch and is visible as any other participant, but having a transcriber participant would be weird since no other videoconference tool treats this feature as a bot participant joining a call. Job uniqueness is ensured using agent identity by forging a deterministic identity for each transcriber by room. This makes sure two transcribers would never be able to join the same room. It might be a bit harsh, but our API calling to list participants before accepting a new transcription job should already filter out situations where an agent is triggered twice. We chose explicit worker orchestration over auto-dispatch because we want to keep control of this feature which will be challenging to scale. LiveKit agent scaling is documented but we need to experiment in real life situations with their Worker/Job mechanism. Currently uses Deepgram since Arnaud's draft Kyutai plugin isn't ready for production. This allows our ops team to advance on deploying and monitoring agents. Deepgram was a random choice offering 200 hours free, though it only works for English. ASR provider needs to be refactored as a pluggable system selectable through environment variables or settings. Agent dispatch will be triggered via a new REST API endpoint to our backend. This is quite a first naive version of a minimal dockerized LiveKit agent to start playing with the framework.
This commit is contained in:
committed by
aleb_the_flash
parent
6ca73c665b
commit
ea2e5e8609
24
src/agents/Dockerfile
Normal file
24
src/agents/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM python:3.13-slim AS base
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
WORKDIR /builder
|
||||
|
||||
COPY pyproject.toml .
|
||||
|
||||
RUN mkdir /install && \
|
||||
pip install --prefix=/install .
|
||||
|
||||
FROM base AS production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG DOCKER_USER
|
||||
USER ${DOCKER_USER}
|
||||
|
||||
# Un-privileged user running the application
|
||||
COPY --from=builder /install /usr/local
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["python", "multi-user-transcriber.py", "start"]
|
||||
Reference in New Issue
Block a user