diff --git a/apps/desktop/src/components/ChatInterface.tsx b/apps/desktop/src/components/ChatInterface.tsx index 7d51227..1c2889a 100644 --- a/apps/desktop/src/components/ChatInterface.tsx +++ b/apps/desktop/src/components/ChatInterface.tsx @@ -2,7 +2,6 @@ import React, { useState, useCallback, useRef, useEffect } from 'react'; import { MessageCircle, Send, - Trash2, Bot, User, AlertCircle, @@ -437,11 +436,6 @@ export const ChatInterface: React.FC = ({ } }, [handleSendMessage]); - // 清除聊天历史 - const handleClearChat = useCallback(() => { - setMessages([]); - setError(null); - }, []); // 重试最后一条消息 const handleRetry = useCallback(() => { diff --git a/apps/desktop/src/pages/tools/ChatTool.tsx b/apps/desktop/src/pages/tools/ChatTool.tsx index 0b1f44f..0d81049 100644 --- a/apps/desktop/src/pages/tools/ChatTool.tsx +++ b/apps/desktop/src/pages/tools/ChatTool.tsx @@ -1,12 +1,9 @@ import React, { useState, useEffect } from 'react'; import { - ArrowLeft, MessageCircle, Settings, Info, - Zap } from 'lucide-react'; -import { useNavigate } from 'react-router-dom'; import { ChatInterface } from '../../components/ChatInterface'; import { testRagGroundingConnection, getRagGroundingConfig } from '../../services/ragGroundingService'; import { RagGroundingConfigInfo } from '../../types/ragGrounding'; @@ -16,7 +13,6 @@ import { RagGroundingConfigInfo } from '../../types/ragGrounding'; * 遵循 Tauri 开发规范和 UI/UX 设计标准 */ const ChatTool: React.FC = () => { - const navigate = useNavigate(); const [connectionStatus, setConnectionStatus] = useState<'checking' | 'connected' | 'error'>('checking'); const [configInfo, setConfigInfo] = useState(null); const [showSettings, setShowSettings] = useState(false); @@ -44,11 +40,6 @@ const ChatTool: React.FC = () => { checkConnection(); }, []); - // 返回工具列表 - const handleBack = () => { - navigate('/tools'); - }; - // 重新连接 const handleReconnect = async () => { setConnectionStatus('checking'); diff --git a/apps/desktop/src/services/ragGroundingService.ts b/apps/desktop/src/services/ragGroundingService.ts index 5aa42df..83d75ab 100644 --- a/apps/desktop/src/services/ragGroundingService.ts +++ b/apps/desktop/src/services/ragGroundingService.ts @@ -7,8 +7,6 @@ import { RagGroundingQueryOptions, RagGroundingQueryResult, RagGroundingServiceStatus, - RagGroundingError, - RagGroundingErrorType, RagGroundingStats, DEFAULT_RAG_GROUNDING_CONFIG, } from '../types/ragGrounding'; @@ -250,18 +248,6 @@ export class RagGroundingService { } return JSON.stringify(error); } - - /** - * 创建 RAG Grounding 错误 - */ - private createError(type: RagGroundingErrorType, message: string, details?: any): RagGroundingError { - return { - type, - message, - details, - timestamp: new Date(), - }; - } } /** diff --git a/apps/desktop/src/utils/testChatFunction.ts b/apps/desktop/src/utils/testChatFunction.ts index 888b847..d5d2ddb 100644 --- a/apps/desktop/src/utils/testChatFunction.ts +++ b/apps/desktop/src/utils/testChatFunction.ts @@ -8,7 +8,7 @@ import { queryRagGrounding, testRagGroundingConnection, getRagGroundingConfig } /** * 控制台日志工具 */ -class ConsoleLogger { +export class ConsoleLogger { static logChatResponse(userInput: string, response: any, totalTime: number) { console.group('🎯 聊天回复详情'); console.log('📝 用户输入:', userInput);