[PR #2109] [MERGED] feat(gemini): Support Gemini 3 Pro Image Preview & Configuration Enhancements #2266

Closed
opened 2026-02-16 11:16:32 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/2109
Author: @QIN2DIM
Created: 11/20/2025
Status: Merged
Merged: 11/20/2025
Merged by: @crazywoola

Base: mainHead: add-gemini-3-pro-image-preview


📝 Commits (7)

  • b71439f feat(gemini): add gemini-3-pro-image-preview model
  • fd16028 fix(gemini): correct Gemini 3 Pro context size
  • 71f028e Squashed commit of the following:
  • 6bdb3d6 refactor(gemini): rename image_size to resolution and add grounding parameter
  • 8d41d5d Update gemini-3-pro-image-preview.yaml
  • 55d80ea Update gemini-3-pro-image-preview.yaml
  • ca81e98 Merge branch 'main' into add-gemini-3-pro-image-preview

📊 Changes

4 files changed (+113 additions, -7 deletions)

View changed files

📝 models/gemini/manifest.yaml (+1 -1)
📝 models/gemini/models/llm/_position.yaml (+1 -0)
models/gemini/models/llm/gemini-3-pro-image-preview.yaml (+104 -0)
📝 models/gemini/models/llm/llm.py (+7 -6)

📄 Description

Gallery

Design and produce dify brand merchandise. https://dify.ai/
panel chat preview
image image d37ee561-f0da-4c87-a1b0-6127d522dce0
Search for the design principles of ReActAgentStrategy, and with a complete understanding of agency systems, create a paper illustration applied to finance agent tasks. Explain the architecture flowchart of an intelligent agent system that can assist investment research work, meeting the standards of top conferences in the field of artificial intelligence.
panel chat preview
image image 1743114d-caef-47b5-8414-d60bb6720360
c980c009-ee2a-451c-90ad-7b5a15f2a24c

Related Issues or Context

This PR introduces full support for the gemini-3-pro-image-preview model, including pricing and parameter configurations. It also refines image generation settings (resolution and aspect ratio) across Gemini models and adds grounding capabilities.

New Features

  • New Model Support: Added gemini-3-pro-image-preview with vision and document processing capabilities. Registered the model in the IMAGE_GENERATION_MODELS set.
  • Grounding: Added a grounding boolean parameter (default: false) for Gemini 3 Pro to enable fact-checking via Google Search, including translations for en_US, zh_Hans, and ja_JP.
  • Aspect Ratio Configuration: Added an aspect_ratio parameter to the gemini-2.5-flash-image model with predefined options (Auto, 1:1, 16:9, 3:4, 4:3, etc.).

♻️ Refactoring & Optimizations

  • Parameter Renaming: Renamed image_size to resolution for better clarity and updated related labels/help text.
  • Pricing Update: Replaced placeholder pricing with actual values for Gemini 3 Pro (Input: $2.0, Output: $120.0 per unit).
  • Code Structure: Implemented _set_image_config method to handle image generation settings uniformly.

🐛 Fixes & Adjustments

  • Context Size: Corrected the context_size for Gemini 3 Pro from 32,768 to 65,536 tokens.
  • Parameter Limits: Updated the maximum temperature value from 2 to 1.
  • Chore: Bumped plugin version to 0.6.3.

Change Log

  • feat: Add gemini-3-pro-image-preview model
  • feat: Add grounding parameter for Google Search
  • feat: Add aspect_ratio support for gemini-2.5-flash-image
  • refactor: Rename image_size to resolution & update pricing config
  • fix: Update Gemini 3 Pro context size to 65k

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • 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.3.0,<0.6.0 is in requirements.txt (SDK docs)

Environment Verification (If Any Code Changes)

Local Deployment Environment

  • Dify Version is: , I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.

SaaS Environment

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/2109 **Author:** [@QIN2DIM](https://github.com/QIN2DIM) **Created:** 11/20/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `add-gemini-3-pro-image-preview` --- ### 📝 Commits (7) - [`b71439f`](https://github.com/langgenius/dify-official-plugins/commit/b71439f31af58d22930d98330815467ade536909) feat(gemini): add gemini-3-pro-image-preview model - [`fd16028`](https://github.com/langgenius/dify-official-plugins/commit/fd16028f62e56904d1fb088ecb47d43adcbbce78) fix(gemini): correct Gemini 3 Pro context size - [`71f028e`](https://github.com/langgenius/dify-official-plugins/commit/71f028e60a5c1c2d3609db1ca10677a62338f6e7) Squashed commit of the following: - [`6bdb3d6`](https://github.com/langgenius/dify-official-plugins/commit/6bdb3d649087f620d06f634ca5eeb2eddc15ae82) refactor(gemini): rename image_size to resolution and add grounding parameter - [`8d41d5d`](https://github.com/langgenius/dify-official-plugins/commit/8d41d5df70873cc1354230430cf974c8224124d3) Update gemini-3-pro-image-preview.yaml - [`55d80ea`](https://github.com/langgenius/dify-official-plugins/commit/55d80ea9bd21a4f9c4c4e979fa4ef983c44a66f1) Update gemini-3-pro-image-preview.yaml - [`ca81e98`](https://github.com/langgenius/dify-official-plugins/commit/ca81e98654e3e2bb251aa5a09b7cad7b76ceac9a) Merge branch 'main' into add-gemini-3-pro-image-preview ### 📊 Changes **4 files changed** (+113 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `models/gemini/manifest.yaml` (+1 -1) 📝 `models/gemini/models/llm/_position.yaml` (+1 -0) ➕ `models/gemini/models/llm/gemini-3-pro-image-preview.yaml` (+104 -0) 📝 `models/gemini/models/llm/llm.py` (+7 -6) </details> ### 📄 Description ## Gallery ```markdown Design and produce dify brand merchandise. https://dify.ai/ ``` | panel | chat | preview | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | <img width="574" height="597" alt="image" src="https://github.com/user-attachments/assets/e11558a3-0519-4ecb-8ecc-dfce23325383" /> | <img width="877" height="773" alt="image" src="https://github.com/user-attachments/assets/88583648-1436-4b24-b594-17893e1a303b" /> | ![d37ee561-f0da-4c87-a1b0-6127d522dce0](https://github.com/user-attachments/assets/4a5e0aa0-1fb9-4a66-9a3d-1b0aa97cc232) | ```markdown Search for the design principles of ReActAgentStrategy, and with a complete understanding of agency systems, create a paper illustration applied to finance agent tasks. Explain the architecture flowchart of an intelligent agent system that can assist investment research work, meeting the standards of top conferences in the field of artificial intelligence. ``` | panel | chat | preview | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | <img width="579" height="630" alt="image" src="https://github.com/user-attachments/assets/d5fd60a1-6a72-4707-87e6-706b1f137a45" /> | <img width="865" height="766" alt="image" src="https://github.com/user-attachments/assets/85d1c620-3628-4ad3-9c3f-4d51c9e8b427" /> | ![1743114d-caef-47b5-8414-d60bb6720360](https://github.com/user-attachments/assets/42c4cefe-b195-4458-8bc8-b0f693b785d1) | | | | ![c980c009-ee2a-451c-90ad-7b5a15f2a24c](https://github.com/user-attachments/assets/276f9355-b382-4e02-a79b-173373e3b950) | ## Related Issues or Context <!-- ⚠️ NOTE: This repository is for Dify Official Plugins only. For community contributions, please submit to https://github.com/langgenius/dify-plugins instead. - Link Related Issues if Applicable: #issue_number - Or Provide Context about Why this Change is Needed --> This PR introduces full support for the `gemini-3-pro-image-preview` model, including pricing and parameter configurations. It also refines image generation settings (resolution and aspect ratio) across Gemini models and adds grounding capabilities. ### ✨ New Features * **New Model Support**: Added `gemini-3-pro-image-preview` with vision and document processing capabilities. Registered the model in the `IMAGE_GENERATION_MODELS` set. * **Grounding**: Added a `grounding` boolean parameter (default: `false`) for Gemini 3 Pro to enable fact-checking via Google Search, including translations for `en_US`, `zh_Hans`, and `ja_JP`. * **Aspect Ratio Configuration**: Added an `aspect_ratio` parameter to the `gemini-2.5-flash-image` model with predefined options (Auto, 1:1, 16:9, 3:4, 4:3, etc.). ### ♻️ Refactoring & Optimizations * **Parameter Renaming**: Renamed `image_size` to `resolution` for better clarity and updated related labels/help text. * **Pricing Update**: Replaced placeholder pricing with actual values for Gemini 3 Pro (Input: $2.0, Output: $120.0 per unit). * **Code Structure**: Implemented `_set_image_config` method to handle image generation settings uniformly. ### 🐛 Fixes & Adjustments * **Context Size**: Corrected the `context_size` for Gemini 3 Pro from 32,768 to **65,536** tokens. * **Parameter Limits**: Updated the maximum `temperature` value from 2 to 1. * **Chore**: Bumped plugin version to `0.6.3`. --- ### Change Log - [x] feat: Add `gemini-3-pro-image-preview` model - [x] feat: Add `grounding` parameter for Google Search - [x] feat: Add `aspect_ratio` support for `gemini-2.5-flash-image` - [x] refactor: Rename `image_size` to `resolution` & update pricing config - [x] fix: Update Gemini 3 Pro context size to 65k ## This PR contains Changes to *Non-Plugin* <!-- Put an `x` in all the boxes that apply by replacing [ ] with [x] For example: - [x] Documentation --> - [ ] Documentation - [ ] Other ## This PR contains Changes to *Non-LLM Models Plugin* - [ ] I have Run Comprehensive Tests Relevant to My Changes <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> ## This PR contains Changes to *LLM Models Plugin* <!-- LLM Models Test Example: --> <!-- https://github.com/langgenius/dify-official-plugins/blob/main/.assets/test-examples/llm-plugin-tests/llm_test_example.md --> - [ ] My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Structured Output Format (JSON, XML, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Token Consumption Metrics <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [x] Other Changes (Add New Models, Fix Model Parameters etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> ## 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) <!-- ⚠️ NOTE: Version Format: MAJOR.MINOR.PATCH - MAJOR (0.x.x): Reserved for Significant architectural changes or incompatible API modifications - MINOR (x.0.x): For New feature additions while maintaining backward compatibility - PATCH (x.x.0): For Backward-compatible bug fixes and minor improvements - Note: Each Version Component (MAJOR, MINOR, PATCH) Can Be 2 Digits, e.g., 10.11.22 --> ## Dify Plugin SDK Version - [x] I have Ensured `dify_plugin>=0.3.0,<0.6.0` is in requirements.txt ([SDK docs](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/README.md)) ## Environment Verification (If Any Code Changes) <!-- ⚠️ NOTE: At Least One Environment Must Be Tested. --> ### Local Deployment Environment - [x] Dify Version is: <!-- Specify Your Version (e.g., 1.2.0) -->, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration. <!-- - Python Virtual Env Matching Manifest.yaml & requirements.txt - No Breaking Changes in Dify That May Affect the Testing Result --> ### SaaS Environment - [ ] I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration <!-- - Python Virtual Env Matching Manifest.yaml & requirements.txt --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:16:32 -05:00
yindo closed this issue 2026-02-16 11:16:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#2266