ajuste no contas

This commit is contained in:
T3782834
2026-09-01 11:24:03 -03:00
parent 9ed4782f9d
commit 397b831fd3
428 changed files with 2294 additions and 4648 deletions

View File

@@ -38,4 +38,13 @@ class TimGroundednessJudge(_TimJudge):
class TimResponseQualityJudge(_TimJudge):
name='tim_response_quality'
async def evaluate(self, question, answer, context):
return self._result(await self._invoke(build_rqlt_prompt(str(question or ''), str(answer or ''))))
out = await self._invoke(build_rqlt_prompt(str(question or ''), str(answer or '')))
# RQLT contract is explicitly 0..10. The base normalizer cannot infer
# that score=1 means 1/10 (it also supports judges that already emit
# 0..1), so normalize this judge at its boundary.
try:
out = dict(out or {})
out['score'] = float(out.get('score', 0)) / 10.0
except Exception:
out = {**dict(out or {}), 'score': 0.0}
return self._result(out)