diff --git a/test2/client/src/App.jsx b/test2/client/src/App.jsx index c241cbe..fe7c76d 100644 --- a/test2/client/src/App.jsx +++ b/test2/client/src/App.jsx @@ -1,10 +1,11 @@ import { useState, useEffect, useCallback, useRef } from 'react'; -import { Settings2, Zap, Mic, MessageSquare, History, Plus } from 'lucide-react'; +import { Settings2, Zap, Mic, MessageSquare, History, Plus, Film } from 'lucide-react'; import VoicePanel from './components/VoicePanel'; import ChatPanel from './components/ChatPanel'; import SettingsPanel from './components/SettingsPanel'; import { getVoiceConfig } from './services/voiceApi'; import SessionHistoryPanel from './components/SessionHistoryPanel'; +import VideoPanel from './components/VideoPanel'; export default function App() { const [showSettings, setShowSettings] = useState(false); @@ -19,14 +20,25 @@ export default function App() { // 文字聊天消息(用于切回语音时注入上下文) const [chatMessages, setChatMessages] = useState([]); const [settings, setSettings] = useState({ - botName: '小智', - systemRole: '你是一个友善的智能助手,名叫小智。你擅长帮用户解答各类问题。', - speakingStyle: '请使用温和、清晰的口吻。', - greetingText: '你好,我是你的智能语音助手,有什么可以帮你的吗?', - modelVersion: '1.2.1.0', + modelVersion: 'O', speaker: 'zh_female_vv_jupiter_bigtts', enableWebSearch: false, }); + // 文字对话引擎: 'coze' (原方舟 HTTP/SSE) | 's2s' (S2S WebSocket, event 501) + const [textEngine, setTextEngine] = useState(() => { + try { + return localStorage.getItem('bigwo_text_engine') || 'coze'; + } catch (_) { + return 'coze'; + } + }); + const toggleTextEngine = useCallback(() => { + setTextEngine((prev) => { + const next = prev === 'coze' ? 's2s' : 'coze'; + try { localStorage.setItem('bigwo_text_engine', next); } catch (_) {} + return next; + }); + }, []); useEffect(() => { getVoiceConfig() @@ -108,14 +120,18 @@ export default function App() {
{mode === 'voice' ? '直连 S2S 语音 · ChatTTSText' - : handoff?.subtitles?.length > 0 - ? '语音转接 · 上下文已延续' - : '方舟 LLM · Function Calling'} + : mode === 'chat' + ? (textEngine === 's2s' + ? 'S2S 文字 · event 501 ChatTextQuery' + : (handoff?.subtitles?.length > 0 + ? '语音转接 · 上下文已延续' + : '方舟 LLM · Function Calling')) + : 'Seedance · AI 视频生成'}