Skip to content

refactor: remove ParseParams() from Tool interface#2375

Merged
duwenxin99 merged 9 commits into
mainfrom
remove-parseParam
Jan 28, 2026
Merged

refactor: remove ParseParams() from Tool interface#2375
duwenxin99 merged 9 commits into
mainfrom
remove-parseParam

Conversation

@duwenxin99

Copy link
Copy Markdown
Contributor

The ParseParams Tool interface is only passing the tool's parameter into a generic parameters.ParseParams() helper. Instead of keeping it as a tool interface, we add a GetParameters() method (#2374) to the tool interface and call it directly from the API handlers. This way we keep the parameter parsing logic independent from the tools.

@duwenxin99 duwenxin99 requested review from a team January 27, 2026 22:15
@duwenxin99 duwenxin99 changed the base branch from main to refactor-parse January 27, 2026 22:15
@duwenxin99 duwenxin99 assigned kurtisvg and unassigned Yuan325 Jan 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @duwenxin99, 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 refactors the way tool parameters are handled within the system. By extracting the parameter parsing responsibility from individual tools and centralizing it, the change promotes a cleaner architecture and better separation of concerns. This modification simplifies the Tool interface and streamlines the parameter processing workflow for all integrated tools.

Highlights

  • Tool Interface Refactoring: The ParseParams() method has been removed from the Tool interface, centralizing parameter parsing logic outside of individual tool implementations.
  • New GetParameters Method: A new GetParameters() method has been added to the Tool interface, allowing API handlers to retrieve tool parameters directly for external parsing.
  • Centralized Parameter Parsing: API handlers now call a generic parameters.ParseParams() helper, passing the tool's parameters obtained via tool.GetParameters(), ensuring consistent parsing across all tools.
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.

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

Copy link
Copy Markdown
Contributor

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 is a significant refactoring that removes the ParseParams() method from the Tool interface and its implementations. The parameter parsing logic is now centralized and called directly from the API handlers using parameters.ParseParams(tool.GetParameters(), ...). This is a good change as it simplifies the Tool interface and decouples the tools from the specifics of parameter parsing. The changes are applied consistently across a large number of files, including updating test files. The overall change improves code structure and maintainability. I've found one minor issue with a dangling comment, which is noted in the specific feedback.

Comment thread internal/tools/cassandra/cassandracql/cassandracql.go Outdated
Base automatically changed from refactor-parse to main January 27, 2026 22:27
@duwenxin99 duwenxin99 enabled auto-merge (squash) January 28, 2026 22:10
@duwenxin99 duwenxin99 merged commit 2d5d333 into main Jan 28, 2026
12 checks passed
@duwenxin99 duwenxin99 deleted the remove-parseParam branch January 28, 2026 23:01
github-actions Bot pushed a commit to Jaleel-zhu/genai-toolbox that referenced this pull request Jan 28, 2026
…pis#2375)

The `ParseParams` Tool interface is only passing the tool's parameter
into a generic `parameters.ParseParams()` helper. Instead of keeping it
as a tool interface, we add a `GetParameters()` method
(googleapis#2374) to the tool
interface and call it directly from the API handlers. This way we keep
the parameter parsing logic independent from the tools. 2d5d333
kshalu-code pushed a commit to kshalu-code/genai-toolbox that referenced this pull request Feb 4, 2026
The `ParseParams` Tool interface is only passing the tool's parameter
into a generic `parameters.ParseParams()` helper. Instead of keeping it
as a tool interface, we add a `GetParameters()` method
(googleapis#2374) to the tool
interface and call it directly from the API handlers. This way we keep
the parameter parsing logic independent from the tools.
dumians pushed a commit to dumians/genai-toolbox that referenced this pull request Feb 18, 2026
The `ParseParams` Tool interface is only passing the tool's parameter
into a generic `parameters.ParseParams()` helper. Instead of keeping it
as a tool interface, we add a `GetParameters()` method
(googleapis#2374) to the tool
interface and call it directly from the API handlers. This way we keep
the parameter parsing logic independent from the tools.
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.

3 participants