Фиксируем состояние
This commit is contained in:
@@ -65,8 +65,8 @@ class SummaryComposer:
|
||||
"",
|
||||
f"Passed: {passed}/{len(results)}",
|
||||
"",
|
||||
"| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass |",
|
||||
"|------|------|-------|---------------------|--------|-------------------|------------|------|",
|
||||
"| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Tokens | Pass |",
|
||||
"|------|------|-------|---------------------|--------|-------------------|------------|--------|------|",
|
||||
]
|
||||
lines.extend(self._result_rows(results))
|
||||
lines.extend(self._failure_section(results))
|
||||
@@ -80,7 +80,7 @@ class SummaryComposer:
|
||||
rows.append(
|
||||
f"| {item.case.source_file.name} | {item.case.case_id} | {self._table_text(item.case.query)} | "
|
||||
f"{item.case.expectations.router.sub_intent or '—'} | {actual.get('intent') or '—'} | "
|
||||
f"{actual.get('sub_intent') or '—'} | {self._rag_layers_text(item)} | {'✓' if item.passed else '✗'} |"
|
||||
f"{actual.get('sub_intent') or '—'} | {self._rag_layers_text(item)} | {self._token_text(item)} | {'✓' if item.passed else '✗'} |"
|
||||
)
|
||||
return rows
|
||||
|
||||
@@ -142,3 +142,10 @@ class SummaryComposer:
|
||||
return "—"
|
||||
parts = [f"{layer}:{counts[layer]}" for layer in sorted(counts)]
|
||||
return self._table_text(", ".join(parts), limit=120)
|
||||
|
||||
def _token_text(self, item: V2CaseResult) -> str:
|
||||
diagnostics = dict(item.details.get("diagnostics") or {})
|
||||
prompt = dict(diagnostics.get("prompt") or {})
|
||||
stats = dict(prompt.get("prompt_stats") or {})
|
||||
value = stats.get("tokens_in_estimate")
|
||||
return str(value) if value is not None else "—"
|
||||
|
||||
Reference in New Issue
Block a user