Skip to content

feat: Add Google Search grounding to GoogleModel - open issue #840 #2161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

vjvkrm
Copy link

@vjvkrm vjvkrm commented Jul 9, 2025

Closes #840

Description

This pull request implements native Google Search grounding for the GoogleModel, enabling it to answer questions about current events and access real-time information. This provides a direct and intuitive way to leverage one of Gemini's core features within the pydantic-ai framework, resolving the feature request in issue #840.

Key Changes

  • ✨ Feature Implementation:

    • Introduced a new enable_google_search: bool parameter to the GoogleModel constructor.
    • When True, the model is configured to automatically use the GoogleSearch tool for grounding.
  • 🧪 Test Coverage:

    • Added a new test case test_google_search to tests/models/test_google.py.
    • Includes a vcrpy cassette to ensure the test runs offline and validates the feature's behavior without needing a live API key during CI/CD runs.
  • 📚 Documentation:

    • Updated docs/models/google.md with a new "Grounding with Google Search" section.
    • The new documentation includes a clear explanation and a concise code example for users.

Copy link
Contributor

hyperlint-ai bot commented Jul 9, 2025

PR Change Summary

Implemented Google Search grounding in the GoogleModel, enhancing its ability to provide real-time information.

  • Introduced a new parameter enable_google_search in the GoogleModel constructor.
  • Added a test case for the Google Search feature to ensure functionality without a live API key.
  • Updated documentation to include a new section on using Google Search grounding.

Modified Files

  • docs/models/google.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@DouweM
Copy link
Collaborator

DouweM commented Jul 16, 2025

This is already covered in #2102 which will be merged soon!

@DouweM DouweM closed this Jul 16, 2025
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.

Support built-in tools
2 participants