Add the translation service to the translation demo#78
Open
Karolk99 wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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/servicePython 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", | ||
| }; |
Karolk99
force-pushed
the
fce-3482/translation-backend
branch
from
July 21, 2026 16:08
c530776 to
9ca18fc
Compare
Qizot
approved these changes
Jul 22, 2026
Qizot
left a comment
There was a problem hiding this comment.
My only concern is having a top-level generic name translation-demo where in face this is moq-specific translation demo/service.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.