Remove corpus counts from chat chrome

This commit is contained in:
2026-08-10 17:26:58 +07:00
parent 46469468bb
commit 97cb6d16f4
31 changed files with 2192 additions and 424 deletions
+11 -1
View File
@@ -13,6 +13,7 @@ and the Messages-API path on Bedrock is the Mantle client — not the legacy
from __future__ import annotations
import json
import re
from typing import Any
from rag.ports import AnswerGenerationUnavailable
@@ -123,8 +124,17 @@ class StubAnswerGenerator:
"""
def __init__(self, answer: str, evidence_sufficient: bool = True) -> None:
# `answer` keeps its old free-text-with-[n]-markers shape for this
# constructor's own callers (bootstrap.py's demo string) — wrapped
# into a single structured claim here since 2026-08-10's schema
# change (see rag/prompt.py's ANSWER_SCHEMA).
citations = [int(n) for n in re.findall(r"\[(\d+)\]", answer)]
text = re.sub(r"\s*\[\d+\]", "", answer).strip()
self._payload = json.dumps(
{"answer": answer, "evidence_sufficient": evidence_sufficient},
{
"claims": [{"text": text, "citations": citations}] if text else [],
"evidence_sufficient": evidence_sufficient,
},
ensure_ascii=False,
)
self.calls: list[tuple[str, str]] = []