fix: build error

This commit is contained in:
imeepos 2025-07-21 23:47:20 +08:00
parent 343688af56
commit f467b215b5
4 changed files with 1 additions and 30 deletions

View File

@ -2,7 +2,6 @@ import React, { useState, useCallback, useRef, useEffect } from 'react';
import { import {
MessageCircle, MessageCircle,
Send, Send,
Trash2,
Bot, Bot,
User, User,
AlertCircle, AlertCircle,
@ -437,11 +436,6 @@ export const ChatInterface: React.FC<ChatInterfaceProps> = ({
} }
}, [handleSendMessage]); }, [handleSendMessage]);
// 清除聊天历史
const handleClearChat = useCallback(() => {
setMessages([]);
setError(null);
}, []);
// 重试最后一条消息 // 重试最后一条消息
const handleRetry = useCallback(() => { const handleRetry = useCallback(() => {

View File

@ -1,12 +1,9 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
ArrowLeft,
MessageCircle, MessageCircle,
Settings, Settings,
Info, Info,
Zap
} from 'lucide-react'; } from 'lucide-react';
import { useNavigate } from 'react-router-dom';
import { ChatInterface } from '../../components/ChatInterface'; import { ChatInterface } from '../../components/ChatInterface';
import { testRagGroundingConnection, getRagGroundingConfig } from '../../services/ragGroundingService'; import { testRagGroundingConnection, getRagGroundingConfig } from '../../services/ragGroundingService';
import { RagGroundingConfigInfo } from '../../types/ragGrounding'; import { RagGroundingConfigInfo } from '../../types/ragGrounding';
@ -16,7 +13,6 @@ import { RagGroundingConfigInfo } from '../../types/ragGrounding';
* Tauri UI/UX * Tauri UI/UX
*/ */
const ChatTool: React.FC = () => { const ChatTool: React.FC = () => {
const navigate = useNavigate();
const [connectionStatus, setConnectionStatus] = useState<'checking' | 'connected' | 'error'>('checking'); const [connectionStatus, setConnectionStatus] = useState<'checking' | 'connected' | 'error'>('checking');
const [configInfo, setConfigInfo] = useState<RagGroundingConfigInfo | null>(null); const [configInfo, setConfigInfo] = useState<RagGroundingConfigInfo | null>(null);
const [showSettings, setShowSettings] = useState(false); const [showSettings, setShowSettings] = useState(false);
@ -44,11 +40,6 @@ const ChatTool: React.FC = () => {
checkConnection(); checkConnection();
}, []); }, []);
// 返回工具列表
const handleBack = () => {
navigate('/tools');
};
// 重新连接 // 重新连接
const handleReconnect = async () => { const handleReconnect = async () => {
setConnectionStatus('checking'); setConnectionStatus('checking');

View File

@ -7,8 +7,6 @@ import {
RagGroundingQueryOptions, RagGroundingQueryOptions,
RagGroundingQueryResult, RagGroundingQueryResult,
RagGroundingServiceStatus, RagGroundingServiceStatus,
RagGroundingError,
RagGroundingErrorType,
RagGroundingStats, RagGroundingStats,
DEFAULT_RAG_GROUNDING_CONFIG, DEFAULT_RAG_GROUNDING_CONFIG,
} from '../types/ragGrounding'; } from '../types/ragGrounding';
@ -250,18 +248,6 @@ export class RagGroundingService {
} }
return JSON.stringify(error); return JSON.stringify(error);
} }
/**
* RAG Grounding
*/
private createError(type: RagGroundingErrorType, message: string, details?: any): RagGroundingError {
return {
type,
message,
details,
timestamp: new Date(),
};
}
} }
/** /**

View File

@ -8,7 +8,7 @@ import { queryRagGrounding, testRagGroundingConnection, getRagGroundingConfig }
/** /**
* *
*/ */
class ConsoleLogger { export class ConsoleLogger {
static logChatResponse(userInput: string, response: any, totalTime: number) { static logChatResponse(userInput: string, response: any, totalTime: number) {
console.group('🎯 聊天回复详情'); console.group('🎯 聊天回复详情');
console.log('📝 用户输入:', userInput); console.log('📝 用户输入:', userInput);