update
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user