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 {
|
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(() => {
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue