From cbdc0f6cd72286f3e260adc0bbb617a93001414c Mon Sep 17 00:00:00 2001 From: Moreno Bonaventura Date: Fri, 6 Dec 2024 16:56:18 +0000 Subject: [PATCH] Update evaluators_service.py using `is not None` checks instead of truthy checks, which is more explicit and correct for boolean values. truthy checks fails in the case of `ground_truth_value` and `llm_app_output_value` both equal to a valid False value --- agenta-backend/agenta_backend/services/evaluators_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agenta-backend/agenta_backend/services/evaluators_service.py b/agenta-backend/agenta_backend/services/evaluators_service.py index ae8bad50e9..c221495e78 100644 --- a/agenta-backend/agenta_backend/services/evaluators_service.py +++ b/agenta-backend/agenta_backend/services/evaluators_service.py @@ -815,7 +815,7 @@ def diff(ground_truth: Any, app_output: Any, compare_schema_only: bool) -> float llm_app_output_value = flattened_app_output.get(key, None) key_score = 0.0 - if ground_truth_value and llm_app_output_value: + if ground_truth_value is not None and llm_app_output_value is not None: key_score = diff( {key: ground_truth_value}, {key: llm_app_output_value},