From f19fb41d921c9e7d2ced6671920be7ebd6d00345 Mon Sep 17 00:00:00 2001 From: Martin Guitteny <“martin.guitteny@centralesupelec.fr”> Date: Mon, 20 Oct 2025 13:33:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(agents)=20change=20the=20way=20doc?= =?UTF-8?q?ker=20starts=20agents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change compose to start the agents in separate services and make installs in Dockerfile and not in compose It's cleaner that way --- compose.yml | 24 ++++++++++++++++++----- src/agents/Dockerfile | 4 +--- src/agents/pyproject.toml | 3 ++- src/summary/summary/core/celery_worker.py | 8 +------- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/compose.yml b/compose.yml index d56bdafe..57750c90 100644 --- a/compose.yml +++ b/compose.yml @@ -284,11 +284,11 @@ services: path: ./src/summary metadata-agent: - image: python:3.13-slim + build: + context: ./src/agents + dockerfile: Dockerfile working_dir: /app - volumes: - - ./src/agents:/app - command: ["sh","-lc","python -m pip install -U pip && python -m pip install --no-cache-dir 'livekit-agents==1.2.*' 'livekit-plugins-silero==1.2.*' 'livekit-plugins-deepgram==1.2.*' 'minio==7.2.*' 'python-dotenv==1.1.*' && python metadata_extractor.py start"] + command: ["python", "metadata_extractor.py", "start"] environment: LIVEKIT_URL: "ws://livekit:7880" LIVEKIT_API_KEY: "devkey" @@ -303,4 +303,18 @@ services: AWS_S3_REGION_NAME: "local" depends_on: - livekit - - minio \ No newline at end of file + - minio + + transcriber-agent: + build: + context: ./src/agents + dockerfile: Dockerfile + working_dir: /app + command: ["python", "multi-user-transcriber.py", "start"] + environment: + LIVEKIT_URL: "ws://livekit:7880" + LIVEKIT_API_KEY: "devkey" + LIVEKIT_API_SECRET: "secret" + PYTHONUNBUFFERED: "1" + depends_on: + - livekit \ No newline at end of file diff --git a/src/agents/Dockerfile b/src/agents/Dockerfile index dcd2ebf2..da29f8a9 100644 --- a/src/agents/Dockerfile +++ b/src/agents/Dockerfile @@ -19,6 +19,4 @@ USER ${DOCKER_USER} # Un-privileged user running the application COPY --from=builder /install /usr/local -COPY . . - -CMD ["python", "multi-user-transcriber.py", "start"] +COPY . . \ No newline at end of file diff --git a/src/agents/pyproject.toml b/src/agents/pyproject.toml index 81d5823e..b53ea844 100644 --- a/src/agents/pyproject.toml +++ b/src/agents/pyproject.toml @@ -7,7 +7,8 @@ dependencies = [ "livekit-agents==1.2.6", "livekit-plugins-deepgram==1.2.6", "livekit-plugins-silero==1.2.6", - "python-dotenv==1.1.1" + "python-dotenv==1.1.1", + "minio==7.2.15", ] [project.optional-dependencies] diff --git a/src/summary/summary/core/celery_worker.py b/src/summary/summary/core/celery_worker.py index 4404610b..1f98177d 100644 --- a/src/summary/summary/core/celery_worker.py +++ b/src/summary/summary/core/celery_worker.py @@ -182,9 +182,7 @@ def assign_participant_ids( # noqa: PLR0912 speaker_to_participant[speaker] = participant["name"] if mapping["confidence"] < overlap_threshold + 0.2: speaker_to_participant[speaker] += "?" - logger.info(speaker, "->", speaker_to_participant[speaker], "conf:", mapping["confidence"]) break - return speaker_to_participant @@ -464,7 +462,7 @@ def process_audio_transcribe_summarize_v2( # noqa: PLR0915 os.remove(temp_file_path) logger.debug("Temporary file removed: %s", temp_file_path) - if not ( + if ( analytics.is_feature_enabled("is_metadata_agent_enabled", distinct_id=sub) and settings.is_summary_enabled ): @@ -545,10 +543,6 @@ def process_audio_transcribe_summarize_v2( # noqa: PLR0915 ) else: logger.info("Summary generation not enabled for this user.") - summarize_transcription.apply_async( - args=[formatted_transcription, email, sub, title], - queue=settings.summarize_queue, - ) @celery.task(