fix: calculate total from criteria scores instead of trusting LLM

LLM sometimes returns inconsistent total values. Now we always
compute total = sum(criteria.score) for accuracy.
This commit is contained in:
sit002 2025-12-02 14:19:10 +08:00
parent 7ef1bf7f40
commit 38b6d5498d

View File

@ -169,6 +169,12 @@ def main():
"confidence": 0.0
}
# 重新计算 total不信任 LLM 返回的 total使用各项得分之和
criteria = resp.get("criteria", [])
if criteria:
calculated_total = sum(float(c.get("score", 0)) for c in criteria)
resp["total"] = round(calculated_total, 2)
# 边界带自动送审
try:
rubric_data = json.loads(rubric_text)