Skip to content

Conversation

@omkute10
Copy link

@omkute10 omkute10 commented Oct 26, 2025

Problem:
When debugging agents that utilize the VertexAiSearchTool, it's currently difficult to inspect the specific configuration parameters (datastore ID, engine ID, filter, max_results, etc.) being passed to the underlying Vertex AI Search API via the LlmRequest. This lack of visibility can hinder troubleshooting efforts related to tool configuration.

Solution:
This PR enhances the VertexAiSearchTool by adding a debug-level log statement within the process_llm_request method. This log precisely records the parameters being used for the Vertex AI Search configuration just before it's appended to the LlmRequest.

This provides developers with crucial visibility into the tool's runtime behavior when debug logging is enabled, significantly improving the debuggability of agents using this tool. Corresponding unit tests were updated to rigorously verify this new logging output using caplog. Additionally, minor fixes were made to the tests to resolve Pydantic validation errors.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary of pytest results: All unit tests in tests/unittests/tools/test_vertex_ai_search_tool.py and the broader suite pass successfully after changes. (pytest tests/unittests) The updated tests specifically assert the presence and content of the new debug log messages using caplog.

Manual End-to-End (E2E) Tests:

Verified by running a simple agent configuration locally that uses VertexAiSearchTool with logging level set to DEBUG. Confirmed the expected log message containing the correct parameters appears in the console output, demonstrating the feature works as intended in a basic execution flow.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas (The log message itself provides runtime context).
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

N/A

@google-cla
Copy link

google-cla bot commented Oct 26, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link

Summary of Changes

Hello @omkute10, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the debuggability of agents utilizing the VertexAiSearchTool. By introducing a debug-level log, developers can now easily inspect the exact configuration parameters (such as datastore ID, engine ID, filter, and max_results) being passed to the Vertex AI Search API. This enhanced visibility will streamline troubleshooting efforts related to tool configuration, ensuring a smoother development experience.

Highlights

  • Enhanced Debugging: Added a debug-level log statement to VertexAiSearchTool's process_llm_request method, providing visibility into Vertex AI Search API configuration parameters.
  • Resource ID Extraction: Introduced a new static helper method _extract_resource_id within VertexAiSearchTool to parse resource IDs from full resource paths.
  • Test Coverage: Updated unit tests to rigorously verify the new debug logging output using caplog and added new tests for tool initialization scenarios.
  • Test Fixes: Resolved minor Pydantic validation errors in existing unit tests and standardized model paths.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot
Copy link
Collaborator

adk-bot commented Oct 26, 2025

Hello @omkute10, thank you for your contribution!

Before we can merge this PR, we need to address a couple of items from our contribution guidelines:

  1. Contributor License Agreement (CLA): It looks like the CLA check is failing. Please sign the Google CLA to proceed.
  2. Associated Issue: For new features, we require an associated GitHub issue to track the work. Could you please create an issue for this feature and link it to this PR?

Once these items are addressed, we can proceed with the review.

Response from ADK Triaging Agent

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds debug-level logging to the VertexAiSearchTool to provide better visibility into its configuration at runtime. The changes are well-implemented, including a helper to extract resource IDs for cleaner log messages. The unit tests have been diligently updated to verify the new logging output. My review includes suggestions to improve the robustness and consistency of the log assertions in the tests.

omkute10 and others added 2 commits October 26, 2025 15:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@adk-bot adk-bot added the tools [Component] This issue is related to tools label Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants