Skip to content

Conversation

@yeesian
Copy link
Collaborator

@yeesian yeesian commented Sep 26, 2025

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yeesian, 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 refactors the internal API client initialization within the Vertex AI session service. The change simplifies how the underlying API client is obtained, moving from an indirect access through a wrapper client to a direct instantiation of the base client. This improves clarity and potentially efficiency in client management.

Highlights

  • API Client Instantiation: The _get_api_client method in vertex_ai_session_service.py has been updated to directly instantiate genai.client.BaseApiClient instead of genai.Client()._api_client. This change streamlines the client creation process by using the base client directly.
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 the API client instantiation in vertex_ai_session_service.py to avoid using a private _api_client attribute. This is a good improvement for maintainability. My review includes a suggestion to further improve the method by also removing another private attribute access, if possible.

Comment on lines +380 to +382
api_client = genai.client.BaseApiClient(
vertexai=True, project=self._project, location=self._location
)._api_client
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change to use genai.client.BaseApiClient directly is a good improvement for maintainability. To make this even more robust, consider passing http_options to the BaseApiClient constructor. This would allow removing the subsequent modification of the private _http_options attribute, making the code cleaner and less coupled to the library's internal implementation.

@yeesian
Copy link
Collaborator Author

yeesian commented Sep 26, 2025

This is meant for testing purposes, and not for merging

@yeesian yeesian closed this Sep 26, 2025
@hangfei hangfei deleted the yeesian-patch-1 branch November 5, 2025 20:00
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.

1 participant