Fix frontend opener showing
This commit is contained in:
@@ -409,12 +409,13 @@ class DuplexPipeline:
|
|||||||
|
|
||||||
prompt_hint = (self._runtime_greeting or "").strip()
|
prompt_hint = (self._runtime_greeting or "").strip()
|
||||||
system_prompt = (
|
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:
|
if prompt_hint:
|
||||||
user_prompt += f" Style hint: {prompt_hint}"
|
user_prompt += f" 风格提示:{prompt_hint}"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
generated = await self.llm_service.generate(
|
generated = await self.llm_service.generate(
|
||||||
|
|||||||
@@ -1632,11 +1632,10 @@ export const DebugDrawer: React.FC<{
|
|||||||
lastUserFinalRef.current = '';
|
lastUserFinalRef.current = '';
|
||||||
setWsError('');
|
setWsError('');
|
||||||
closeWs();
|
closeWs();
|
||||||
if (textTtsEnabled) await ensureAudioContext();
|
if (textTtsEnabled) await ensureAudioContext();
|
||||||
await ensureWsSession();
|
await ensureWsSession();
|
||||||
await startVoiceCapture();
|
await startVoiceCapture();
|
||||||
setCallStatus('active');
|
setCallStatus('active');
|
||||||
setMessages([]);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
stopVoiceCapture();
|
stopVoiceCapture();
|
||||||
@@ -1707,7 +1706,6 @@ export const DebugDrawer: React.FC<{
|
|||||||
if (textTtsEnabled) await ensureAudioContext();
|
if (textTtsEnabled) await ensureAudioContext();
|
||||||
await ensureWsSession();
|
await ensureWsSession();
|
||||||
setTextSessionStarted(true);
|
setTextSessionStarted(true);
|
||||||
setMessages([]);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setWsStatus('error');
|
setWsStatus('error');
|
||||||
|
|||||||
Reference in New Issue
Block a user