diff --git a/web/pages/Assistants.tsx b/web/pages/Assistants.tsx index 11ae5b6..2428bf6 100644 --- a/web/pages/Assistants.tsx +++ b/web/pages/Assistants.tsx @@ -2534,6 +2534,8 @@ export const DebugDrawer: React.FC<{ const setNsEnabled = useDebugPrefsStore((state) => state.setNsEnabled); const agcEnabled = useDebugPrefsStore((state) => state.agcEnabled); const setAgcEnabled = useDebugPrefsStore((state) => state.setAgcEnabled); + const fastgptInteractiveVoiceEnabled = useDebugPrefsStore((state) => state.fastgptInteractiveVoiceEnabled); + const setFastgptInteractiveVoiceEnabled = useDebugPrefsStore((state) => state.setFastgptInteractiveVoiceEnabled); const clientToolEnabledMap = useDebugPrefsStore((state) => state.clientToolEnabledMap); const setClientToolEnabled = useDebugPrefsStore((state) => state.setClientToolEnabled); const hydrateClientToolDefaults = useDebugPrefsStore((state) => state.hydrateClientToolDefaults); @@ -2752,6 +2754,12 @@ export const DebugDrawer: React.FC<{ fastgptInteractiveDialogRef.current = fastgptInteractiveDialog; }, [fastgptInteractiveDialog]); + useEffect(() => { + if (!fastgptInteractiveVoiceEnabled && fastgptInteractiveDialog.open) { + stopPromptVoicePlayback(); + } + }, [fastgptInteractiveVoiceEnabled, fastgptInteractiveDialog.open]); + useEffect(() => { dynamicVariableSeqRef.current = 0; setDynamicVariables([]); @@ -3088,7 +3096,7 @@ export const DebugDrawer: React.FC<{ submitLabel: item.payload.submitLabel, cancelLabel: item.payload.cancelLabel, }); - if (nextVoiceText) { + if (nextVoiceText && fastgptInteractiveVoiceEnabled) { void playPromptVoice(nextVoiceText); } return; @@ -3163,6 +3171,10 @@ export const DebugDrawer: React.FC<{ const fieldValues = snapshot.fieldValues; const interactionType = snapshot.interactionType; stopPromptVoicePlayback(); + // Stop only local playback so the resumed FastGPT response can take over + // without cancelling the active server-side turn. + stopPlaybackImmediately(); + setAgentState('waiting'); setFastgptInteractiveDialog({ open: false, interactionType: 'userSelect', @@ -4605,6 +4617,23 @@ export const DebugDrawer: React.FC<{ Auto Gain Control (AGC) +
+

Prompt Voice

+
+
+
FastGPT Interactive
+
+ Play the interactive description or prompt voice when the popup opens. +
+
+ +
+

Client Tools

滑块控制调试会话内客户端工具是否启用。

@@ -5086,7 +5115,7 @@ export const DebugDrawer: React.FC<{ )} {fastgptInteractiveDialog.open && (
-
+
{!fastgptInteractiveDialog.required && (
+
{fastgptInteractiveDialog.interactionType === 'userSelect' ? (
{fastgptInteractiveDialog.options.map((option) => { @@ -5202,6 +5232,7 @@ export const DebugDrawer: React.FC<{ })}
)} +