Skip to content

Conversation

@fcogidi
Copy link
Collaborator

@fcogidi fcogidi commented Oct 31, 2025

PR Type

Feature

Short Description

  • Introduced gemini_grounding.py to implement a tool for fetching Google Search grounded responses from the Gemini model via a proxy server.
  • Updated .env.example to include WEB_SEARCH_BASE_URL and WEB_SEARCH_API_KEY.

Tests Added

tests/tool_tests/test_gemini_grounding.py

- Updated .env.example to include WEB_SEARCH_BASE_URL and WEB_SEARCH_API_KEY.
- Introduced web_search.py to implement a tool for fetching Google Search grounded responses from the Gemini model.
@fcogidi fcogidi self-assigned this Oct 31, 2025
…h query extraction

- Introduced RETRYABLE_STATUS for managing retryable HTTP status codes.
- Updated the _post method to _post_payload for clarity and added a docstring.
- Enhanced error handling in the backoff decorator to include specific exceptions and retry logic based on RETRYABLE_STATUS.
@fcogidi fcogidi marked this pull request as ready for review October 31, 2025 19:01
@fcogidi fcogidi requested a review from Copilot October 31, 2025 19:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a web search tool that integrates Google Search grounded responses from the Gemini model via a proxy server. The implementation includes configurable model settings, retry logic, and citation formatting.

Key changes:

  • New GeminiGroundingWithGoogleSearch class that handles API communication with retry logic and concurrency control
  • Citation formatting utility to add inline source links to Gemini responses
  • Environment variable configuration for the proxy server base URL and API key

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/utils/tools/web_search.py Implements the core web search tool with Gemini integration, including model configuration, API client, retry logic, and citation formatting
tests/tool_tests/test_web_search.py Adds integration test for the web search functionality
.env.example Adds environment variable placeholders for web search proxy configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fcogidi fcogidi added the enhancement New feature or request label Oct 31, 2025
@fcogidi fcogidi marked this pull request as draft November 3, 2025 14:41
- Updated the add_citations function to return a tuple of synthesized text and a mapping of citation IDs to source labels.
- Enhanced the GroundedResponse class to include a citations field.
- Improved error handling and type checks throughout the citation processing logic.
- Introduced a new _collect_citations function to streamline citation ID collection from candidates.
@fcogidi fcogidi marked this pull request as ready for review November 4, 2025 18:05
@fcogidi fcogidi requested a review from amrit110 November 5, 2025 20:22
@fcogidi fcogidi merged commit 3c3310f into main Nov 6, 2025
4 checks passed
@fcogidi fcogidi deleted the f/add_web_search_tool_func branch November 6, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants