Skip to content

Commit

Permalink
response hallucination - expose error caught when calling openai (#246)
Browse files Browse the repository at this point in the history
* expose error caught in try-catch

---------

Co-authored-by: felipe207 <[email protected]>
  • Loading branch information
FelipeAdachi and felipe207 authored Mar 5, 2024
1 parent c7c6b46 commit 10d4f66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions langkit/response_hallucination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 10d4f66

Please sign in to comment.