diff --git a/engine/core/duplex_pipeline.py b/engine/core/duplex_pipeline.py index ad42d13..c99cba7 100644 --- a/engine/core/duplex_pipeline.py +++ b/engine/core/duplex_pipeline.py @@ -409,12 +409,13 @@ class DuplexPipeline: prompt_hint = (self._runtime_greeting or "").strip() system_prompt = ( - "You generate one concise opener for a live voice call assistant. " - "Return plain text only, no quotes, no markdown, one sentence." + "你是语音通话助手的开场白生成器。" + "请只输出一句自然、简洁、友好的中文开场白。" + "不要使用引号,不要使用 markdown,不要加解释。" ) - user_prompt = "Generate a friendly opening line (max 25 words)." + user_prompt = "请生成一句中文开场白(不超过25个汉字)。" if prompt_hint: - user_prompt += f" Style hint: {prompt_hint}" + user_prompt += f" 风格提示:{prompt_hint}" try: generated = await self.llm_service.generate( diff --git a/web/pages/Assistants.tsx b/web/pages/Assistants.tsx index ac11f7b..09820e6 100644 --- a/web/pages/Assistants.tsx +++ b/web/pages/Assistants.tsx @@ -1632,11 +1632,10 @@ export const DebugDrawer: React.FC<{ lastUserFinalRef.current = ''; setWsError(''); closeWs(); - if (textTtsEnabled) await ensureAudioContext(); - await ensureWsSession(); - await startVoiceCapture(); + if (textTtsEnabled) await ensureAudioContext(); + await ensureWsSession(); + await startVoiceCapture(); setCallStatus('active'); - setMessages([]); } catch (e) { console.error(e); stopVoiceCapture(); @@ -1707,7 +1706,6 @@ export const DebugDrawer: React.FC<{ if (textTtsEnabled) await ensureAudioContext(); await ensureWsSession(); setTextSessionStarted(true); - setMessages([]); } catch (e) { console.error(e); setWsStatus('error');