fix(tts): gate auto reply by ENABLE_TTS; allow on-demand and manual playback
- Pipeline: skip _send_tts_audio only for non-manual when ENABLE_TTS=false; remove enable_tts early return from handle_tts_request_on_demand. - Tencent TTS: PrimaryLanguage/chunking follow user language preference only. - Expo: let manual tts_audio bypass late-segment playback gate after interrupt. - Docs: clarify ENABLE_TTS vs tts_request in api/.env.example and TTSProvider port. - Tests: add manual bypass cases; adjust pipeline language tests for en+Chinese text. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -115,7 +115,8 @@ async def _send_tts_audio(
|
||||
settings.enable_tts,
|
||||
settings.tts_provider,
|
||||
)
|
||||
if not settings.enable_tts:
|
||||
# enable_tts:仅禁用「助手回复自动生成 TTS」(want_tts 路径);用户点喇叭(manual=True)仍可合成。
|
||||
if not manual and not settings.enable_tts:
|
||||
logger.info(
|
||||
"pipeline._send_tts_audio result conversation_id={} chunk_index={} ok=False "
|
||||
"url_set=False audio_bytes_len=0 reason=enable_tts_false",
|
||||
@@ -269,14 +270,6 @@ async def handle_tts_request_on_demand(
|
||||
settings.enable_tts,
|
||||
settings.tts_provider,
|
||||
)
|
||||
if not settings.enable_tts:
|
||||
logger.info(
|
||||
"pipeline.handle_tts_request_on_demand result ok=False reason=未开启语音合成 "
|
||||
"conversation_id={} assistant_message_id={}",
|
||||
conversation_id,
|
||||
assistant_message_id,
|
||||
)
|
||||
return False, "未开启语音合成"
|
||||
|
||||
conv = await db.get(Conversation, conversation_id)
|
||||
if not conv or conv.user_id != user_id or conv.deleted_at is not None:
|
||||
|
||||
Reference in New Issue
Block a user