video-accessibility-old/backend
Vadym Samoilenko fa351e4d25 feat: per-client glossary — hybrid exact/vector retrieval + AI injection
Adds full glossary system so Gemini uses client-approved terminology
when generating subtitles and translations (critical for 3M brand names
and product codes across 16 target locales).

Backend:
- lib/locales.py: BCP-47 locale registry, normalises xlsx fr_fr → fr-FR
- models/glossary.py: Glossary / GlossaryVersion / GlossaryTerm + enums
- services/glossary_service.py: xlsx parse (openpyxl), ingest to Mongo,
  hybrid retrieval (Aho-Corasick exact + Atlas Vector Search), prompt block
- services/embedding_service.py: Gemini text-embedding-004, batch 100, retry
- tasks/embed_glossary.py: Celery background task for async embedding
- api/v1/routes_glossaries.py: CRUD endpoints under /clients/{id}/glossaries
- gemini.py: _build_glossary_block(), {GLOSSARY} injection in all 4 call sites
- tts.py / gemini_tts.py: pass full locale codes (no split("-")[0] truncation)
- tasks/translate_and_synthesize.py: glossary lookup + injection per language
- prompts: {GLOSSARY} placeholder in ingestion, targeted, transcreation prompts
- pyproject.toml: +openpyxl, +pyahocorasick

Frontend:
- routes/admin/glossaries/: GlossaryList, GlossaryUpload, GlossaryDetail
- App.tsx: 3 new routes under /admin/clients/:clientId/glossaries
- ClientDetail.tsx: Glossaries card with count + quick links
- types/api.ts: Glossary, GlossaryVersion, GlossaryDetail, GlossaryTerm types
- lib/api.ts: 7 new API methods (upload, list, detail, terms, versions, activate, archive)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 13:03:38 +01:00
..
__pycache__ initial commit 2025-08-24 16:28:33 -05:00
app feat: per-client glossary — hybrid exact/vector retrieval + AI injection 2026-04-29 13:03:38 +01:00
tests fix: use actual freeze segment durations for VTT subtitle retiming 2026-01-05 15:52:57 -06:00
.dockerignore fixed dockerignore 2025-10-08 17:17:39 -05:00
.dockerignore.old wrote docker files and deployment instructions 2025-10-08 16:00:12 -05:00
.env.example feat: Client → Team → Project isolation system with Project Manager role 2026-04-27 15:11:13 +01:00
.gitignore feat: per-client glossary — hybrid exact/vector retrieval + AI injection 2026-04-29 13:03:38 +01:00
celery_worker.py fix: pause at start of gap + add explicit whisper_transcribe import 2025-12-27 09:11:29 -06:00
cors-config.json initial commit 2025-08-24 16:28:33 -05:00
create_test_users.py added production user role and made it default for new MSAL users - production can access everything EXCEPT user management - that's only for admin 2025-10-10 10:07:30 -05:00
debug_login.py initial commit 2025-08-24 16:28:33 -05:00
Dockerfile feat: add environment-based worker concurrency for Cloud Run mode 2026-01-02 10:27:07 -06:00
Dockerfile.ffmpeg-service feat: add Cloud Run HTTP services for Whisper and FFmpeg 2026-01-02 10:12:50 -06:00
Dockerfile.old wrote docker files and deployment instructions 2025-10-08 16:00:12 -05:00
Dockerfile.whisper-service feat: add Cloud Run HTTP services for Whisper and FFmpeg 2026-01-02 10:12:50 -06:00
gunicorn_conf.py initial commit 2025-08-24 16:28:33 -05:00
migrate.py initial commit 2025-08-24 16:28:33 -05:00
optical-414516-80e2475f6412.json initial commit 2025-08-24 16:28:33 -05:00
poetry.lock chore: update poetry.lock with faster-whisper dependency 2025-12-27 08:29:11 -06:00
pyproject.toml feat: per-client glossary — hybrid exact/vector retrieval + AI injection 2026-04-29 13:03:38 +01:00
setup_secrets.py initial commit 2025-08-24 16:28:33 -05:00
simple_login_test.py initial commit 2025-08-24 16:28:33 -05:00
test_auth.py initial commit 2025-08-24 16:28:33 -05:00
test_db.py initial commit 2025-08-24 16:28:33 -05:00
test_endpoint.py initial commit 2025-08-24 16:28:33 -05:00
test_mp3_serving.py initial commit 2025-08-24 16:28:33 -05:00