feat(i18n): persist language preference and thread through chat, memoir, TTS

- Add users.language_preference (Alembic 0018, default zh); capture at signup/SMS
  only; expose on auth and profile APIs
- Lite English prompts for chat and memoir; localized stage labels and agent
  names (Life Echo / 岁月知己)
- Tencent TTS: language-aware synthesis, ModelType=1 for 501004, English chunking
- WebSocket pipeline: emit all AGENT_RESPONSE segments when TTS cancels; INFO logs
  for tts_this_turn and TTS decisions; on-demand TTS logging
- Expo: device language on auth, i18n tiers/agent name, [SPLIT] streaming UX fixes
- Tests for migration, prompts, pipeline, router tts_this_turn, reply segments

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin
2026-05-11 16:16:49 +08:00
parent 5ce29aad64
commit ccdc4e4277
64 changed files with 3233 additions and 208 deletions

View File

@@ -26,6 +26,7 @@ from app.agents.chat.background_voice import (
)
from app.agents.chat.occupation_context import get_occupation_chat_hint
from app.agents.chat.personas import (
AGENT_NAME_ZH,
get_interview_persona_tone_hint,
normalize_interview_persona,
)
@@ -328,7 +329,7 @@ def assemble_guided_prompt(
)
intro = (
"你是「岁月知己」——**主持式访谈者**:口语、克制、可靠;"
f"你是「{AGENT_NAME_ZH}」——**主持式访谈者**:口语、克制、可靠;"
"**职责是帮用户把人生故事口述清楚**,不代写金句、不把问题写成散文、不替用户选边站队。"
)
if intro_tone_line: