[PR #804] [MERGED] feat(gemini): Update Gemini Models to support image multimodal output #1560

Closed
opened 2026-02-16 10:23:19 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/804
Author: @QuantumGhost
Created: 4/27/2025
Status: Merged
Merged: 5/15/2025
Merged by: @Yeuoly

Base: mainHead: feat/reapply-gemini-multimodal


📝 Commits (8)

📊 Changes

6 files changed (+694 additions, -91 deletions)

View changed files

📝 .gitignore (+176 -0)
models/gemini/.gitignore (+1 -0)
📝 models/gemini/README.md (+19 -2)
📝 models/gemini/manifest.yaml (+2 -1)
📝 models/gemini/models/llm/llm.py (+285 -88)
models/gemini/models/llm/test_llm.py (+211 -0)

📄 Description

Related Issue or Context

Plugin side change for langgenius/dify#15814. Continuation of prematurely merged PR #687.

Type of Change

  • Bug Fix (non-breaking change which fixes an Issue)
  • New Feature (non-breaking change which adds Functionality)
  • Breaking Change (fix or feature that may cause existing Functionality to not work as expected)
    • Input/Output Handling:
      • Multimodal Output Generation (Image generation)
  • Documentation Update
  • Code Refactoring
  • Other

Version Control (if applicable)

  • Version bumped in Manifest.yaml (top-level Version field, not in Meta section)
  • minimum_dify_version raised.

Test Evidence (if applicable)

Important

Visual Proof is required for Bug Fixes, New Features, and Breaking Changes:

Screenshots or Video/GIF:

Now texts and images generated by Google Gemini model can be viewed in the chat:

image

Test Prompt:

I need you to draw two images of a car for me.

The brand of the car should be well-known. The image should be a sketch. 
The logo of the car should be clear and easy to identify.

First show me the image, then write a simple description about the image.

Environment Verification

Local Deployment Environment

Local Deployment Dify Version: v1.3.0+dev (a development version, see langgenius/dify#17372).

SaaS Environment

  • Testing performed on cloud.dify.ai
    Wait for the release of langgenius/dify#17372.
  • Changes tested in a Clean Environment that matches Production Configuration
  • Testing performed in the development environment.

🔄 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/804 **Author:** [@QuantumGhost](https://github.com/QuantumGhost) **Created:** 4/27/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/reapply-gemini-multimodal` --- ### 📝 Commits (8) - [`4ef9e9d`](https://github.com/langgenius/dify-official-plugins/commit/4ef9e9dcc41e6120848529fc87b4e80c817360bf) feat(gemini): Update Gemini Models to support image multimodal output - [`324024e`](https://github.com/langgenius/dify-official-plugins/commit/324024e967423751fec8fd5a4052625cfa4f8abc) Fix(gemini): Fix incorrect model name in _get_response_modalities - [`47c4991`](https://github.com/langgenius/dify-official-plugins/commit/47c499126069c73843f97b675a150b3a7a0ee3d2) chore: ignore common python related files in .gitignore - [`2abddfe`](https://github.com/langgenius/dify-official-plugins/commit/2abddfe8e350de8fa9ff59fd8467a3ba22473d97) feat(gemini): upgrade to Gemini 0.2.0 with breaking changes, requires Dify>=1.4.0 - [`097f0ec`](https://github.com/langgenius/dify-official-plugins/commit/097f0ec890c98a61b337e38067672dcc6f4d3142) chore(gemini): Ignore file_cache.json - [`639ed48`](https://github.com/langgenius/dify-official-plugins/commit/639ed48552a8dcf35820a9cbe888b04c25c4bb9d) test(gemini): Add tests for _content_to_part and _convert_to_contents - [`45cafc7`](https://github.com/langgenius/dify-official-plugins/commit/45cafc75631e24654147f379c6a9ef3c5fc849d5) Merge branch 'main' of https://github.com/langgenius/dify-official-plugins into feat/reapply-gemini-multimodal - [`38a3e25`](https://github.com/langgenius/dify-official-plugins/commit/38a3e25b4b492be78ab91898e1c731d6ecd0bd28) Merge branch 'main' of https://github.com/langgenius/dify-official-plugins into feat/reapply-gemini-multimodal ### 📊 Changes **6 files changed** (+694 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+176 -0) ➕ `models/gemini/.gitignore` (+1 -0) 📝 `models/gemini/README.md` (+19 -2) 📝 `models/gemini/manifest.yaml` (+2 -1) 📝 `models/gemini/models/llm/llm.py` (+285 -88) ➕ `models/gemini/models/llm/test_llm.py` (+211 -0) </details> ### 📄 Description ## Related Issue or Context Plugin side change for langgenius/dify#15814. Continuation of prematurely merged PR #687. ## Type of Change - [ ] Bug Fix (non-breaking change which fixes an Issue) - [x] New Feature (non-breaking change which adds Functionality) - [x] Breaking Change (fix or feature that may cause existing Functionality to not work as expected) - **Input/Output Handling**: - [x] Multimodal Output Generation (Image generation) - [ ] Documentation Update - [ ] Code Refactoring - [ ] Other ## Version Control (if applicable) - [x] Version bumped in Manifest.yaml (top-level `Version` field, not in Meta section) - [x] `minimum_dify_version` raised. ## Test Evidence (if applicable) > [!IMPORTANT] > Visual Proof is required for Bug Fixes, New Features, and Breaking Changes: ### Screenshots or Video/GIF: Now texts and images generated by Google Gemini model can be viewed in the chat: <img width="392" alt="image" src="https://github.com/user-attachments/assets/60d2778b-59a5-47ee-afc5-bf023a9f7be1" /> Test Prompt: ```text I need you to draw two images of a car for me. The brand of the car should be well-known. The image should be a sketch. The logo of the car should be clear and easy to identify. First show me the image, then write a simple description about the image. ``` ### Environment Verification #### Local Deployment Environment Local Deployment Dify Version: v1.3.0+dev (a development version, see langgenius/dify#17372). #### SaaS Environment - [ ] Testing performed on cloud.dify.ai Wait for the release of langgenius/dify#17372. - [ ] Changes tested in a Clean Environment that matches Production Configuration - [x] Testing performed in the development environment. --- <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 10:23:19 -05:00
yindo closed this issue 2026-02-16 10:23:19 -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#1560