This commit is contained in:
zyp
2026-11-27 14:43:37 +08:00
parent 1ae94dfb1f
commit b18c6efe92
64 changed files with 5629 additions and 2414 deletions
+4 -2
View File
@@ -54,7 +54,7 @@ def evidence_context(evidence: list[Evidence], budget: int = 18000, resources=No
fields[label] = excerpt(value, question)
reduced = reduced or len(value) > 1600
record = {"source_id": f"{item.resource}:{row['id']}", "resource": item.resource,
"title": str(row.get("title", item.title))[:200], "fields": fields}
"title": str(row.get("name") or row.get("title") or item.title)[:200], "fields": fields}
cost = len(json.dumps(record, ensure_ascii=False))
if cost > budget:
reduced = True
@@ -220,4 +220,6 @@ def grounded_answer(payload) -> dict | None:
# The audited answer already explains empty results in the current context;
# a second generic suggestion here can contradict its concrete next step.
append_note(blocks, answer_footer(payload))
return {"answer": "\n\n".join(blocks), "skill_names": [], "source_ids": refs}
limited = bool(issues or payload.investigation_note or payload.question_spec.get('limitation'))
return {"answer": "\n\n".join(blocks), "skill_names": [], "source_ids": refs,
"answer_status": "partial" if limited else "complete"}