Remove corpus counts from chat chrome
This commit is contained in:
@@ -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]] = []
|
||||
|
||||
Reference in New Issue
Block a user