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:
parent
7ef1bf7f40
commit
38b6d5498d
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user