Skip to content

Comments

feat(openrouter): add gemini 3.1 pro and fix related issues#2603

Open
zhangtony239 wants to merge 5 commits intolanggenius:mainfrom
zhangtony239:main
Open

feat(openrouter): add gemini 3.1 pro and fix related issues#2603
zhangtony239 wants to merge 5 commits intolanggenius:mainfrom
zhangtony239:main

Conversation

@zhangtony239
Copy link

@zhangtony239 zhangtony239 commented Feb 20, 2026

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.

Gemini 3 Pro Gemini 3.1 Pro
image image
  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)
  • Other Changes (Add New Models, Fix Model Parameters etc.)

Version Control (Any Changes to the Plugin Will Require Bumping the Version)

  • I have Bumped Up the Version in Manifest.yaml (Top-Level Version Field, Not in Meta Section)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.5.0,<0.6.0 is in requirements.txt (SDK docs)

Environment Verification (If Any Code Changes)

SaaS package powered by: dify-plugin-windows-amd64 v0.5.3

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 20, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 google/gemini-3.1-pro-preview model to the OpenRouter plugin, enhancing the range of available large language models. It includes specific configuration for the new model, notably adding a 'medium' option for the reasoning_effort parameter, and updates the plugin's version.

Highlights

  • New Model Integration: Integrated the google/gemini-3.1-pro-preview model into the OpenRouter plugin, expanding the available LLM options.
  • Reasoning Effort Configuration: Updated the reasoning_effort parameter for Gemini 3.1 Pro to include a 'medium' level, aligning with OpenRouter documentation and AI Studio confirmations.
  • Plugin Version Update: Incremented the OpenRouter plugin version from 0.0.35 to 0.0.36 in manifest.yaml.

🧠 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
  • models/openrouter/manifest.yaml
    • Updated the plugin version from 0.0.35 to 0.0.36.
  • models/openrouter/models/llm/_position.yaml
    • Added google/gemini-3.1-pro-preview to the list of LLM models.
  • models/openrouter/models/llm/gemini-3.1-pro-preview.yaml
    • Added a new configuration file for the google/gemini-3.1-pro-preview model, defining its properties, features (multi-tool-call, agent-thought, vision, document, video, audio), parameter rules (temperature, top_p, top_k, presence_penalty, frequency_penalty, max_tokens, response_format, json_schema, exclude_reasoning_tokens, reasoning_effort), and pricing.
Activity
  • The author confirmed bumping the version in Manifest.yaml.
  • The author ensured dify_plugin>=0.5.0,<0.6.0 is in requirements.txt.
  • The author tested changes on cloud.dify.ai with a clean environment.
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.

@dosubot dosubot bot added the enhancement New feature or request label Feb 20, 2026
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 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.

@zhangtony239
Copy link
Author

CI failed on rate limits. Requesting a manual merge, please.

@WH-2099
Copy link
Member

WH-2099 commented Feb 20, 2026

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.
Currently, the main difference between our two implementations lies in the specific configuration values ​​of temperature, top_p, and top_k. I plan to organize and integrate these later today. If you have any ideas, please feel free to contact me.

@zhangtony239
Copy link
Author

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. Currently, the main difference between our two implementations lies in the specific configuration values ​​of temperature, top_p, and top_k. I plan to organize and integrate these later today. If you have any ideas, please feel free to contact me.

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.

@zhangtony239 zhangtony239 changed the title feat(openrouter): add gemini 3.1 pro feat(openrouter): add gemini 3.1 pro and fix related issues Feb 21, 2026
@zhangtony239 zhangtony239 marked this pull request as draft February 21, 2026 00:15
@zhangtony239
Copy link
Author

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:

  • Temperature: Range normalized to 0.0 ~ 2.0, with the default set to 1.0.
  • Top_p: Default value updated to 0.95.
  • Top_k: This parameter has been removed from this PR. Since Gemini 2.0, Google has deprecated user-adjustable top_k and locked it to 64. Keeping it in the UI would be redundant/ineffective.

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!

@zhangtony239 zhangtony239 marked this pull request as ready for review February 21, 2026 02:37
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 21, 2026
@dosubot
Copy link

dosubot bot commented Feb 21, 2026

Related Documentation

Checked 0 published document(s) in 3 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@WH-2099
Copy link
Member

WH-2099 commented Feb 21, 2026

Thanks for the parameter adjustments, @zhangtony239. The alignment with the latest Gemini specs looks reasonable.

Good catch on removing top_k — I wasn't aware it had been deprecated and locked to 64 since Gemini 2.0. Makes sense to drop it from the config.

I'll review and follow up shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants