Skip to content

Add the translation service to the translation demo#78

Open
Karolk99 wants to merge 1 commit into
mainfrom
fce-3482/translation-backend
Open

Add the translation service to the translation demo#78
Karolk99 wants to merge 1 commit into
mainfrom
fce-3482/translation-backend

Conversation

@Karolk99

Copy link
Copy Markdown
Contributor

No description provided.

@Karolk99
Karolk99 requested review from Qizot, Copilot and czerwiukk July 21, 2026 16:04
@linear

linear Bot commented Jul 21, 2026

Copy link
Copy Markdown

FCE-3482

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moq-demo Ready Ready Preview, Comment Jul 21, 2026 4:08pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a dedicated Python “translation service” to the translation-demo so the web app can discover and subscribe to live, AI-translated MoQ audio (and transcript/captions) tracks announced alongside source broadcasts.

Changes:

  • Introduces a new translation-demo/service Python project (moq-live-translation) that watches relay announcements and publishes on-demand translated audio + transcript tracks (Gemini Live via the “google” provider).
  • Adds provider-neutral translation plumbing (media pipeline, provider contracts, dynamic track handling, transcript publishing, session stats).
  • Updates demo documentation and environment templates to include service credentials and runtime instructions.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
translation-demo/src/utils/translation.ts Adjusts translation provider label mapping used by the web UI.
translation-demo/service/uv.lock Adds uv lockfile for the new Python translation service dependencies.
translation-demo/service/src/moq_live_translation/translator.py Orchestrates per-track translation (decode → provider → encode) and optional transcript handling.
translation-demo/service/src/moq_live_translation/transcript.py Publishes translated transcript updates to a dedicated MoQ text track (<lang>/transcript.json).
translation-demo/service/src/moq_live_translation/stats.py Implements per-session timing/latency statistics collection and periodic logging.
translation-demo/service/src/moq_live_translation/service.py Core async service: watches announcements, publishes translation broadcasts, serves dynamic requested tracks.
translation-demo/service/src/moq_live_translation/providers/google.py Google Gemini Live translation provider implementation over websockets.
translation-demo/service/src/moq_live_translation/providers/base.py Provider-neutral datatypes and Protocol interfaces for providers/sessions.
translation-demo/service/src/moq_live_translation/providers/init.py Re-exports provider contract symbols for convenient imports.
translation-demo/service/src/moq_live_translation/moq_compat.py Compatibility shims/monkeypatching for differing MoQ Python wrapper capabilities.
translation-demo/service/src/moq_live_translation/media.py Provider-neutral audio decode/resample/encode pipeline using PyAV.
translation-demo/service/src/moq_live_translation/fishjam.py Fetches MoQ access tokens from Fishjam for authenticated relay connections.
translation-demo/service/src/moq_live_translation/cli.py CLI entrypoint and flags to run the translation service (direct relay or Fishjam).
translation-demo/service/src/moq_live_translation/catalog.py Builds publishable output track parameters from Hang catalog audio entries.
translation-demo/service/src/moq_live_translation/main.py Enables python -m moq_live_translation execution.
translation-demo/service/src/moq_live_translation/init.py Exposes the CLI main entrypoint as the package API.
translation-demo/service/README.md Documents how to run/configure the translation service and its track contracts.
translation-demo/service/pyproject.toml Defines the new Python project, dependencies, and moq-live-translation script.
translation-demo/service/.python-version Pins the Python version for the service directory.
translation-demo/README.md Updates demo-level docs to include the new service and required credentials.
translation-demo/.gitignore Ignores the service venv and Python cache artifacts.
translation-demo/.env.example Adds Fishjam + Gemini environment variables needed by the service.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +116 to +118
self.model_latency.record(
self.latest_model_input_end_us - self.latest_model_output_end_us
)
Comment on lines +199 to +202
"translationConfig": {
"targetLanguageCode": self.context.target_language,
"echoTargetLanguage": True,
},
Comment on lines 17 to 19
const PROVIDER_LABELS: Record<string, string> = {
openai: "OpenAI",
google: "Google",
};

@Qizot Qizot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is having a top-level generic name translation-demo where in face this is moq-specific translation demo/service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants