🔧(agents) change the way docker starts agents
Change compose to start the agents in separate services and make installs in Dockerfile and not in compose It's cleaner that way
This commit is contained in:
+19
-5
@@ -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
|
||||
- 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
|
||||
@@ -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 . .
|
||||
@@ -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]
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user