Skip to content

Conversation

vorburger
Copy link
Member

@vorburger vorburger commented Oct 7, 2025

Related to #473.

Intentionally just for FunctionTool, for now; but this should eventually really be done everywhere like this (IMHO).

#487 is a possible future follow-up, extending this with more flexibility; before working further on that, I want to see if this will already get LGTM, as is; and how long it takes to get this reviewed and merged... 🤣 I would pick that (#487) up later.

Copy link
Contributor

Summary of Changes

Hello @vorburger, 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 standardizes the JSON serialization and deserialization process within the FunctionTool by integrating JsonBaseModel. This change aims to improve code consistency and maintainability by centralizing the ObjectMapper configuration, aligning FunctionTool with a broader architectural pattern for managing JSON operations.

Highlights

  • Refactored JSON Mapping: The FunctionTool has been updated to utilize JsonBaseModel for its ObjectMapper instance, centralizing JSON serialization/deserialization configuration.
  • Dependency Streamlining: The direct dependency on Jdk8Module within FunctionTool has been removed, as its functionality is now handled through JsonBaseModel.
  • Consistent ObjectMapper Usage: The OBJECT_MAPPER in FunctionTool is now initialized by calling JsonBaseModel.getMapper(), promoting a consistent approach to JSON processing across the codebase.
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.

Copy link
Contributor

@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 refactors FunctionTool to use a shared ObjectMapper from JsonBaseModel, which is a good move for consistency. However, the implementation changes OBJECT_MAPPER to an instance field from a static one. This introduces a critical issue, as the field is accessed by static methods, which will lead to a compilation failure. My review includes a code suggestion to correct this by reverting it to a static final field and placing it with other static members for better organization.

@vorburger vorburger force-pushed the issue-473_ObjectMapper branch from 0522824 to 5291d9c Compare October 7, 2025 19:14
@vorburger vorburger marked this pull request as draft October 7, 2025 19:15
@vorburger vorburger force-pushed the issue-473_ObjectMapper branch from 5291d9c to 4327a38 Compare October 7, 2025 19:17
@vorburger vorburger marked this pull request as ready for review October 7, 2025 19:18
@copybara-service copybara-service bot merged commit b30d30e into google:main Oct 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants