diff --git a/pyproject.toml b/pyproject.toml index 97b7f18b..85c0c94e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,7 @@ dependencies = [ "aiohttp>=3.9.0", "deepagents>=0.2.5", "json-repair>=0.54.0", + "openpyxl>=3.1.5", ] [tool.ruff] line-length = 120 # 代码最大行宽 diff --git a/src/services/evaluation_service.py b/src/services/evaluation_service.py index fdb01b3a..b3afcf17 100644 --- a/src/services/evaluation_service.py +++ b/src/services/evaluation_service.py @@ -284,7 +284,7 @@ class EvaluationService: generated = 0 attempts = 0 - await context.set_progress(25, "生成样本") + await context.set_progress(0, "准备生成样本") with open(data_file_path, "w", encoding="utf-8") as f: # Allow more attempts to generate enough questions diff --git a/web/src/components/RAGEvaluationTab.vue b/web/src/components/RAGEvaluationTab.vue index 036759e9..a07df61d 100644 --- a/web/src/components/RAGEvaluationTab.vue +++ b/web/src/components/RAGEvaluationTab.vue @@ -18,9 +18,18 @@ :key="benchmark.benchmark_id" :value="benchmark.benchmark_id" > - {{ benchmark.name }}({{ benchmark.question_count }} 个问题) + {{ benchmark.name }} ({{ benchmark.question_count }} 个问题) + @@ -466,7 +475,7 @@ const handleSearchConfigSave = (config) => { }; // 加载基准列表 -const loadBenchmarks = async () => { +const loadBenchmarks = async (showSuccessMessage = false) => { if (!props.databaseId) return; benchmarksLoading.value = true; @@ -491,6 +500,11 @@ const loadBenchmarks = async () => { selectedBenchmark.value = response.data.find(b => b.benchmark_id === selectedBenchmarkId.value); } } + + // 如果是手动刷新,显示成功提示 + if (showSuccessMessage) { + message.success(`已刷新,找到 ${response.data.length} 个评估基准`); + } } else { console.error('响应格式不符合预期:', response); message.error('基准数据格式错误'); @@ -857,6 +871,10 @@ onMounted(() => { margin: 0; white-space: nowrap; } + + .refresh-benchmarks-btn { + color: var(--gray-600); + } } .toolbar-right {