Skip to content

Handle no grounding responses better ai 1697#6

Merged
dearden merged 3 commits intomainfrom
handle-no-grounding-responses-better-ai-1697
Feb 27, 2026
Merged

Handle no grounding responses better ai 1697#6
dearden merged 3 commits intomainfrom
handle-no-grounding-responses-better-ai-1697

Conversation

@dearden
Copy link
Copy Markdown
Contributor

@dearden dearden commented Feb 27, 2026

Fixes AI-1697.

Currently we ask Gemini to do grounding a grounding Google search. If it doesn't do that search, we will still return the output.

This change makes it so that if Gemini doesn't do that search, we raise an exception.

Practically, this will mean that SIFT should stop showing results with made up URLs. It will also mean that for an unknown number of claims we may not get any results, but we've decided that's probably better than potentially having lots of hallucinated sources.

There's also some improvements to test coverage, at the end of test_gemini.py. They're fairly uncontroversial, but there were various things I wanted to check to make sure this new exception didn't change behaviour in unexpected ways.


Pull request checklist

  • I have linked my PR to an issue
  • I’ve used conventional commits
  • My branch is up-to-date with main
  • Where appropriate, I have added or updated tests
  • Where appropriate, I have updated documentation to reflect my changes

@dearden dearden requested a review from nmenezes0 February 27, 2026 13:26
Copy link
Copy Markdown

@nmenezes0 nmenezes0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - nice clear function names so I think I managed to follow!

@dearden dearden merged commit 59e1ccc into main Feb 27, 2026
2 checks passed
@dearden dearden deleted the handle-no-grounding-responses-better-ai-1697 branch February 27, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants