From 2ce7fcac720da388eb7461c372489f613d0a1078 Mon Sep 17 00:00:00 2001
From: Henrique Chaves <henrique@giskard.ai>
Date: Thu, 19 Dec 2024 09:53:12 -0300
Subject: [PATCH] Update the condition to raise LLMGenerationError

---
 giskard/rag/metrics/correctness.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/giskard/rag/metrics/correctness.py b/giskard/rag/metrics/correctness.py
index df2406be67..ed3d3e333d 100644
--- a/giskard/rag/metrics/correctness.py
+++ b/giskard/rag/metrics/correctness.py
@@ -117,7 +117,7 @@ def __call__(self, question_sample: dict, answer: AgentAnswer) -> dict:
                 caller_id=self.__class__.__name__,
             )
 
-            if "correctness" in json_output and isinstance(json_output["correctness"], str):
+            if "correctness" in json_output and not isinstance(json_output["correctness"], bool):
                 raise LLMGenerationError(
                     f"Error in correctness evaluation: {json_output['correctness']}. Please make sure the agent answer is correctly formatted."
                 )