From 705647d7329fe1a8ae87a0f156f564799dd8a75e Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 1 Mar 2026 08:19:05 -0800 Subject: [PATCH] feat: upgrade TTS to gpt-4o-mini-tts with voice instructions - Switch from tts-1 to gpt-4o-mini-tts for lower latency and better quality - Change voice from alloy to coral - Add Chinese speech instructions for natural tone control Co-Authored-By: Claude Opus 4.6 --- packages/services/voice-agent/src/agent.py | 1 + packages/services/voice-agent/src/config.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/services/voice-agent/src/agent.py b/packages/services/voice-agent/src/agent.py index e2e9351..71e3757 100644 --- a/packages/services/voice-agent/src/agent.py +++ b/packages/services/voice-agent/src/agent.py @@ -168,6 +168,7 @@ async def entrypoint(ctx: JobContext) -> None: tts = openai_plugin.TTS( model=settings.openai_tts_model, voice=settings.openai_tts_voice, + instructions="用自然、友好的中文语气说话,语速适中,像真人助手一样。", client=_oai_client_tts, ) else: diff --git a/packages/services/voice-agent/src/config.py b/packages/services/voice-agent/src/config.py index b5600a2..1fffbfe 100644 --- a/packages/services/voice-agent/src/config.py +++ b/packages/services/voice-agent/src/config.py @@ -27,8 +27,8 @@ class Settings(BaseSettings): openai_api_key: str = "" openai_base_url: str = "" openai_stt_model: str = "gpt-4o-transcribe" - openai_tts_model: str = "tts-1" - openai_tts_voice: str = "alloy" + openai_tts_model: str = "gpt-4o-mini-tts" + openai_tts_voice: str = "coral" # Device device: str = "cpu" # "cpu" or "cuda"