Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ def run_one_iteration(self) -> Literal["COMPLETE", "CONTINUE"]:
return "COMPLETE"

if not response.candidates:
if response.prompt_feedback and response.prompt_feedback.block_reason == types.BlockReason.SAFETY:
raise ValueError(f"Response was blocked due to safety. Feedback: {response.prompt_feedback}")
print("Response has no candidates!")
print(response)
raise ValueError("Empty response")
Expand Down
Loading