Skip to content

Commit

Permalink
Update the condition to raise LLMGenerationError
Browse files Browse the repository at this point in the history
  • Loading branch information
henchaves committed Dec 19, 2024
1 parent 481f91d commit 2ce7fca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion giskard/rag/metrics/correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down

0 comments on commit 2ce7fca

Please sign in to comment.