guantao 1 день назад
Родитель
Сommit
9d83413ec2
2 измененных файлов с 84 добавлено и 8 удалено
  1. 49 0
      examples/process_pipeline/run_metrics.json
  2. 35 8
      examples/process_pipeline/ui/app.js

+ 49 - 0
examples/process_pipeline/run_metrics.json

@@ -2455,5 +2455,54 @@
       "Case generation failed: ImportError: cannot import name 'generate_case' from 'examples.process_pipeline.script.generate_case' (C:\\Users\\11304\\gitlab\\cybertogether\\Agent\\examples\\process_pipeline\\script\\generate_case.py)"
     ],
     "timestamp": "2026-05-07T18:23:01.825764"
+  },
+  {
+    "index": 109,
+    "requirement": "用ai生成真实摄影的美女写真组图,要求具有真实感,氛围感,人物一致性保持...",
+    "duration_seconds": 2141.28,
+    "total_cost_usd": 4.8887,
+    "costs_breakdown": {
+      "P1_Research_x": 3.197,
+      "P1_Research_xhs": 0.9593,
+      "P1_Research_zhihu": 0.7323
+    },
+    "trace_ids": {
+      "P1_Research_x": "2c31b203-506e-42a9-a625-1390a47bbd66",
+      "P1_Research_xhs": "42a82490-5cb8-4655-bcb9-239be8774ec6",
+      "P1_Research_zhihu": "87a84d13-e6b4-4e28-a78e-fc7c6cea49b7"
+    },
+    "errors": [
+      "P1_Research_x_R1 Failed: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The provided URL does not appear to be valid. Ensure it is correctly formatted.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-eafb8cdc-5c21-96ee-b59f-4d32ec0857ee', 'request_id': 'eafb8cdc-5c21-96ee-b59f-4d32ec0857ee'}",
+      "P1_Research_x_R1 crashed: BadRequestError: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The provided URL does not appear to be valid. Ensure it is correctly formatted.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-eafb8cdc-5c21-96ee-b59f-4d32ec0857ee', 'request_id': 'eafb8cdc-5c21-96ee-b59f-4d32ec0857ee'}"
+    ],
+    "timestamp": "2026-05-08T01:21:03.579611"
+  },
+  {
+    "index": 111,
+    "requirement": "给定一段文案或需求,用 AI 工具生成符合要求的排版图片的方法/教程/工作流...",
+    "duration_seconds": 13202.19,
+    "total_cost_usd": 55.2493,
+    "costs_breakdown": {
+      "P1_Research_x": 6.5839,
+      "P1_Research_xhs": 46.34,
+      "P1_Research_zhihu": 2.3255
+    },
+    "trace_ids": {
+      "P1_Research_x": "4812f192-d43d-48f4-8c15-5569742c98ee",
+      "P1_Research_xhs": "546a858e-270a-4f99-bc4c-e4b4361a26e9",
+      "P1_Research_zhihu": "ce288fd9-063f-4312-9aff-cc8c27b260cc"
+    },
+    "errors": [
+      "P1_Research_zhihu_R3 Failed: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-cef15cd3-d097-9f61-afb4-4fa971bbd7a4', 'request_id': 'cef15cd3-d097-9f61-afb4-4fa971bbd7a4'}",
+      "P1_Research_zhihu_R3 crashed: BadRequestError: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-cef15cd3-d097-9f61-afb4-4fa971bbd7a4', 'request_id': 'cef15cd3-d097-9f61-afb4-4fa971bbd7a4'}",
+      "P1_Research_zhihu_R4 Failed: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-590b5040-a1ce-9d71-acf3-99dd07d41c79', 'request_id': '590b5040-a1ce-9d71-acf3-99dd07d41c79'}",
+      "P1_Research_zhihu_R4 crashed: BadRequestError: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-590b5040-a1ce-9d71-acf3-99dd07d41c79', 'request_id': '590b5040-a1ce-9d71-acf3-99dd07d41c79'}",
+      "P1_Research_zhihu_R5 Failed: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-0fc9f891-7c47-9cb1-ae85-0cbb9509fbca', 'request_id': '0fc9f891-7c47-9cb1-ae85-0cbb9509fbca'}",
+      "P1_Research_zhihu_R5 crashed: BadRequestError: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-0fc9f891-7c47-9cb1-ae85-0cbb9509fbca', 'request_id': '0fc9f891-7c47-9cb1-ae85-0cbb9509fbca'}",
+      "P1_Research_zhihu_R6 Failed: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-923e8efe-0339-9a62-8c1e-5b0580a676a0', 'request_id': '923e8efe-0339-9a62-8c1e-5b0580a676a0'}",
+      "P1_Research_zhihu_R6 crashed: BadRequestError: Error code: 400 - {'error': {'message': '<400> InternalError.Algo.InvalidParameter: The image format is illegal and cannot be opened', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_parameter_error'}, 'id': 'chatcmpl-923e8efe-0339-9a62-8c1e-5b0580a676a0', 'request_id': '923e8efe-0339-9a62-8c1e-5b0580a676a0'}",
+      "Case generation failed: ImportError: cannot import name 'generate_case' from 'examples.process_pipeline.script.generate_case' (C:\\Users\\11304\\gitlab\\cybertogether\\Agent\\examples\\process_pipeline\\script\\generate_case.py)"
+    ],
+    "timestamp": "2026-05-08T01:36:20.699961"
   }
 ]

+ 35 - 8
examples/process_pipeline/ui/app.js

@@ -173,7 +173,7 @@ function renderRawCases(rawCasesObj) {
         rawCasesObj, sourceMap, detailMap, detailMapByUrl, reqId
     };
     
-    let statsHtml = '';
+    let totalStatsHtml = '';
     const detailedCaseObj = rawCasesObj['case'] || rawCasesObj['case_detailed'];
     if (detailedCaseObj) {
         const cd = detailedCaseObj;
@@ -200,10 +200,10 @@ function renderRawCases(rawCasesObj) {
             const displayWorkflowSuccess = cd.workflow_success !== undefined && cd.workflow_success !== null ? cd.workflow_success : (cd.success !== undefined && cd.success !== null ? cd.success : calcWorkflow);
             const displayCapabilitiesSuccess = cd.capabilities_success !== undefined && cd.capabilities_success !== null ? cd.capabilities_success : calcCapabilities;
             
-            statsHtml = `<div style="display:flex; gap:1rem; margin-bottom:1rem; padding:0.5rem 1rem; background:rgba(0, 0, 0, 0.03); border-radius:8px; align-items:center;">
+            totalStatsHtml = `<div style="display:flex; gap:1rem; margin-bottom:1rem; padding:0.5rem 1rem; background:rgba(0, 0, 0, 0.03); border-radius:8px; align-items:center;">
                 <div style="flex:1; text-align:center; display:flex; flex-direction:column; gap:2px;">
                     <span style="font-size:1.3rem; color:var(--text-main); font-weight:bold; line-height:1;">${cd.total}</span>
-                    <span style="color:var(--text-muted); font-size:0.75rem;">帖子总计</span>
+                    <span style="color:var(--text-muted); font-size:0.75rem;">未被过滤的帖子总数</span>
                 </div>
                 <div style="flex:1; text-align:center; display:flex; flex-direction:column; gap:2px;">
                     <span style="font-size:1.3rem; color:var(--success); font-weight:bold; line-height:1;">${displayWorkflowSuccess}</span>
@@ -217,12 +217,34 @@ function renderRawCases(rawCasesObj) {
         }
     }
     
+    let filteredStatsHtml = '';
+    if (rawCasesObj['filtered_cases']) {
+        const fObj = rawCasesObj['filtered_cases'];
+        let totalFiltered = 0;
+        if (fObj.total !== undefined) totalFiltered = fObj.total;
+        else if (fObj.cases) totalFiltered = fObj.cases.length;
+        else if (fObj.sources) totalFiltered = fObj.sources.length;
+        else if (fObj.by_reason) {
+            Object.values(fObj.by_reason).forEach(r => {
+                if (r.sources) totalFiltered += r.sources.length;
+                else if (r.cases) totalFiltered += r.cases.length;
+            });
+        } else if (Array.isArray(fObj)) totalFiltered = fObj.length;
+        
+        filteredStatsHtml = `<div style="display:flex; gap:1rem; margin-bottom:1rem; padding:0.5rem 1rem; background:rgba(0, 0, 0, 0.03); border-radius:8px; align-items:center;">
+            <div style="flex:1; text-align:center; display:flex; flex-direction:column; gap:2px;">
+                <span style="font-size:1.3rem; color:var(--text-main); font-weight:bold; line-height:1;">${totalFiltered}</span>
+                <span style="color:var(--text-muted); font-size:0.75rem;">被过滤的帖子数</span>
+            </div>
+        </div>`;
+    }
+    
     const allPlatforms = Object.keys(rawCasesObj).filter(p => p !== 'source' && p !== 'case_detailed' && p !== 'case' && p !== 'images');
     const channelPlatforms = allPlatforms.filter(p => p !== 'filtered_cases' && p !== 'source_ex');
     const hasFiltered = allPlatforms.includes('filtered_cases');
     const hasExternal = allPlatforms.includes('source_ex');
     
-    let html = statsHtml;
+    let html = '';
     html += `<div class="sub-tabs">`;
     html += `<button class="sub-tab-btn active" onclick="selectSubTab('total')">TOTAL</button>`;
     if (hasFiltered) html += `<button class="sub-tab-btn" onclick="selectSubTab('filtered_cases')">FILTERED</button>`;
@@ -231,8 +253,13 @@ function renderRawCases(rawCasesObj) {
     html += `<input type="file" id="input-upload-source-ex" accept=".json" style="display:none;">`;
     html += `</div><div class="sub-tab-contents">`;
 
-    const renderPaneContent = (pList) => {
+    const renderPaneContent = (pList, paneType) => {
         let paneHtml = '';
+        if (paneType === 'total' && typeof totalStatsHtml !== 'undefined' && totalStatsHtml) {
+            paneHtml += totalStatsHtml;
+        } else if (paneType === 'filtered_cases' && typeof filteredStatsHtml !== 'undefined' && filteredStatsHtml) {
+            paneHtml += filteredStatsHtml;
+        }
         let totalCases = 0;
         let seenIds = new Set();
         
@@ -358,12 +385,12 @@ function renderRawCases(rawCasesObj) {
         return paneHtml;
     };
 
-    html += `<div id="sub-tab-total" class="sub-tab-pane">${renderPaneContent([...channelPlatforms, 'source'])}</div>`;
-    if (hasFiltered) html += `<div id="sub-tab-filtered_cases" class="sub-tab-pane hidden">${renderPaneContent(['filtered_cases'])}</div>`;
+    html += `<div id="sub-tab-total" class="sub-tab-pane">${renderPaneContent([...channelPlatforms, 'source'], 'total')}</div>`;
+    if (hasFiltered) html += `<div id="sub-tab-filtered_cases" class="sub-tab-pane hidden">${renderPaneContent(['filtered_cases'], 'filtered_cases')}</div>`;
     if (hasExternal) {
         html += `<div id="sub-tab-source_ex" class="sub-tab-pane hidden">`;
         html += `<div style="margin-bottom: 1rem; text-align: right;"><button onclick="importAllExternalCases()" class="btn btn-primary btn-small">📥 全部导入 Source</button></div>`;
-        html += renderPaneContent(['source_ex']);
+        html += renderPaneContent(['source_ex'], 'source_ex');
         html += `</div>`;
     }