Skip to content

Conversation

@gustavoreimche
Copy link

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gustavoreimche, 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 expands the system's integration capabilities by adding full support for Azure AI as an embedding provider. It also improves the efficiency of API key management by making Google Generative AI configuration conditional on its active use. A minor adjustment to the maximum allowed token size for requests further refines the system's operational parameters.

Highlights

  • Azure Embedder Support: This pull request introduces comprehensive support for Azure AI as a new embedder option, allowing the system to utilize Azure's embedding capabilities. This includes updating configuration loading, embedder type detection, and the embedder selection logic.
  • Refined Google API Key Configuration: The configuration for Google Generative AI has been optimized. The system will now only attempt to configure the Google API key if Google is explicitly set as the default provider, reducing unnecessary checks and warnings.
  • Increased Token Limit: The recommended token limit for requests processed by the websocket handler has been increased from 8000 to 9000 tokens, providing more flexibility for larger inputs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 introduces support for an Azure embedder by adding its configuration to embedder.json, integrating it into the embedder loading and type detection logic within api/config.py, and enabling its use in api/tools/embedder.py. The api/main.py file was refactored to conditionally configure the Google API key only if Google is the default provider, removing a previous general environment variable check. Additionally, the recommended token limit for requests in api/websocket_wiki.py was increased from 8000 to 9000. Review comments suggest refactoring the is_azure_embedder function in api/config.py to use a shared helper to reduce code duplication, and similarly, refactoring the get_embedder_type function's if/elif chain into a dictionary for better scalability. Another comment points out a misleading comment in api/main.py regarding Azure environment variables, and finally, it's recommended to define the new token limit of 9000 in api/websocket_wiki.py as a module-level constant to avoid magic numbers.

Comment on lines +240 to +256
def is_azure_embedder():
"""
Check if the current embedder configuration uses AzureAIClient.
Returns:
bool: True if using AzureAIClient, False otherwise
"""
embedder_config = get_embedder_config()
if not embedder_config:
return False

model_client = embedder_config.get("model_client")
if model_client:
return model_client.__name__ == "AzureAIClient"

client_class = embedder_config.get("client_class", "")
return client_class == "AzureAIClient"
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 new function is_azure_embedder duplicates the logic found in is_ollama_embedder, is_google_embedder, and is_bedrock_embedder. To improve maintainability and reduce code duplication, consider creating a private helper function that takes the client name as an argument. This would centralize the checking logic.

For example, you could have a helper:

def _is_embedder_of_type(client_name: str) -> bool:
    embedder_config = get_embedder_config()
    if not embedder_config:
        return False

    model_client = embedder_config.get("model_client")
    if model_client:
        return model_client.__name__ == client_name

    client_class = embedder_config.get("client_class", "")
    return client_class == client_name

Then this function could be simplified to return _is_embedder_of_type("AzureAIClient").

Comment on lines +82 to +83
if tokens > 9000:
logger.warning(f"Request exceeds recommended token limit ({tokens} > 9000)")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The token limit 9000 is used as a magic number in both the condition and the log message. To improve maintainability and avoid potential inconsistencies (like the one fixed in this change), consider defining this value as a constant at the module level (e.g., REQUEST_TOKEN_LIMIT = 9000) and referencing it in both places.

gustavoreimche and others added 2 commits December 30, 2025 19:42
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>
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