Skip to content

Conversation

@Warashi
Copy link
Contributor

@Warashi Warashi commented Dec 20, 2025

I want to use cross region inference profile such as global.anthropic.claude-sonnet-4-5-20250929-v1:0 or global.cohere.embed-v4:0.
Current implementation assumes the first segment to be provider name, but cross region inference profile id has the region name at the first segment.
This change makes us be able to use cross region inference profile.

Additionaly, this PR makes temparature and top_p as optional arguments, becasue some model such as Claude Haiku 4.5 does not support set both of them at the same time.

Some models such as Claude Haiku 4.5 do not support setting both
temperature and top_p at the same time.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Warashi, 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 flexibility and compatibility of the Bedrock client by enabling support for a wider range of model inference profiles, including those used for cross-region operations. Concurrently, it refines how model configuration parameters are handled, making temperature and top_p optional to accommodate models with specific parameter constraints, thereby preventing potential runtime issues.

Highlights

  • Enhanced Model ID Parsing: The logic for extracting the model provider from a model ID has been updated to correctly handle cross-region inference profiles, which include a region name as the first segment (e.g., 'global.anthropic.claude-sonnet-4-5-20250929-v1:0').
  • Optional Model Parameters: The temperature and top_p parameters for model configuration are now treated as optional. This change prevents errors with models that do not support setting both parameters simultaneously, such as Claude Haiku 4.5.

🧠 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 two main changes: it updates the logic for parsing Bedrock model IDs to support cross-region inference profiles, and it makes temperature and top_p optional parameters for Bedrock models. The changes are well-aligned with the goals described.

My review includes a couple of suggestions:

  1. In api/bedrock_client.py, I've proposed a more robust implementation for extracting the model provider to handle edge cases like empty segments in the model ID, which could currently lead to bugs.
  2. In api/websocket_wiki.py, I've suggested a small refactoring to make the code for adding optional parameters more concise and maintainable.

Overall, these are good improvements. Addressing the feedback will make the code more robust and maintainable.

Warashi and others added 2 commits December 20, 2025 13:23
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Warashi
Copy link
Contributor Author

Warashi commented Dec 20, 2025

/gemini review

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 two key improvements for AWS Bedrock integration. First, it enhances model ID parsing to support cross-region inference profiles, making the client more flexible. Second, it makes the temperature and top_p parameters optional, which is necessary for certain models that do not accept both simultaneously. The changes are well-implemented and address the stated goals. I have one suggestion to improve the readability of the model provider extraction logic.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sng-asyncfunc sng-asyncfunc merged commit 8f610c0 into AsyncFuncAI:main Dec 27, 2025
3 checks passed
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.

2 participants