fix: build error
This commit is contained in:
parent
343688af56
commit
f467b215b5
|
|
@ -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<ChatInterfaceProps> = ({
|
|||
}
|
||||
}, [handleSendMessage]);
|
||||
|
||||
// 清除聊天历史
|
||||
const handleClearChat = useCallback(() => {
|
||||
setMessages([]);
|
||||
setError(null);
|
||||
}, []);
|
||||
|
||||
// 重试最后一条消息
|
||||
const handleRetry = useCallback(() => {
|
||||
|
|
|
|||
|
|
@ -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<RagGroundingConfigInfo | null>(null);
|
||||
const [showSettings, setShowSettings] = useState(false);
|
||||
|
|
@ -44,11 +40,6 @@ const ChatTool: React.FC = () => {
|
|||
checkConnection();
|
||||
}, []);
|
||||
|
||||
// 返回工具列表
|
||||
const handleBack = () => {
|
||||
navigate('/tools');
|
||||
};
|
||||
|
||||
// 重新连接
|
||||
const handleReconnect = async () => {
|
||||
setConnectionStatus('checking');
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue