diff --git a/langkit/response_hallucination.py b/langkit/response_hallucination.py index 0b79467..4fafb0e 100644 --- a/langkit/response_hallucination.py +++ b/langkit/response_hallucination.py @@ -105,6 +105,10 @@ def get_samples(self, prompt): response: ChatLog = Conversation(self.sample_generator_llm).send_prompt( prompt ) + if response.errors: + raise Exception( + f"Response Hallucination - Error generating sample: {response.errors}" + ) samples.append(response) return samples