feat(openrouter): add gemini 3.1 pro and fix related issues#2603
feat(openrouter): add gemini 3.1 pro and fix related issues#2603zhangtony239 wants to merge 5 commits intolanggenius:mainfrom
Conversation
Summary of ChangesHello @zhangtony239, 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 introduces the Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the google/gemini-3.1-pro-preview model to the OpenRouter plugin. The changes include adding the new model definition, updating the model position list, and bumping the plugin version. The implementation is mostly correct, but I've found one issue regarding the max_tokens configuration for the new model, which appears to be set higher than the official limit documented by OpenRouter. This could lead to API errors for users.
|
CI failed on rate limits. Requesting a manual merge, please. |
|
Hi, I'm following up on support for the Gemini 3.1 series. As you can see, I added the basic configuration for the Gemini plugin in #2606. To avoid ambiguity, I want our YAML configurations to be as consistent as possible. |
Thanks for your help. I looked at #2606 and am currently retesting locally to see if these AIStudio-aligned parameters will cause compatibility issues with OpenRouter. |
|
Apologies for the noise in the commit history and the multiple pushes. I encountered a highly unintuitive caching issue where the plugin state failed to refresh even after a clean re-installation. After a series of "ritual" steps (disabling/re-enabling the plugin), I’ve confirmed that the logic is now correctly applied. I have aligned the parameters with the latest Google Gemini specifications:
Note on CI: The current failure is related to the deprecated gpt-4o test cases and is unrelated to this PR. Since I am following the "Atomic PR" principle, I have not included fixes for the general test suite here. Ready for review! |
|
Thanks for the parameter adjustments, @zhangtony239. The alignment with the latest Gemini specs looks reasonable. Good catch on removing I'll review and follow up shortly. |
Related Issues or Context
#2607
This PR contains Changes to LLM Models Plugin
New reasoning_effort level
Based on OpenRouter Docs and Gemini 3.1 Pro release notes, and confirmation from AIStudio, the configuration of Gemini 3.1 Pro has been updated to include a 'medium' level of reasoning_effort.
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.5.0,<0.6.0is in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
SaaS package powered by: dify-plugin-windows-amd64 v0.5.3
SaaS Environment