[PR #2111] [MERGED] feat(vertex_ai): Add Gemini 3 Pro Preview support #2268

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/2111
Author: @kaixintang95
Created: 11/20/2025
Status: Merged
Merged: 11/20/2025
Merged by: @crazywoola

Base: mainHead: feat/vertex-ai-gemini-3-pro-preview


📝 Commits (2)

  • db129c6 feat(vertex_ai): Add Gemini 3 Pro Preview support with new parameters
  • daca50a chore: Bump version to 0.0.29

📊 Changes

4 files changed (+137 additions, -4 deletions)

View changed files

📝 models/vertex_ai/manifest.yaml (+1 -1)
models/vertex_ai/models/llm/gemini-3-pro-preview.yaml (+102 -0)
📝 models/vertex_ai/models/llm/llm.py (+33 -2)
📝 models/vertex_ai/requirements.txt (+1 -1)

📄 Description

Summary

Add support for gemini-3-pro-preview model to the Vertex AI plugin with Gemini 3 specific features and parameters.

New Features

  • Add gemini-3-pro-preview model definition with 1M context window
  • Support thinking_level parameter (Low/High) for dynamic reasoning control
  • Support media_resolution parameter (Default/Low/Medium/High) for multimodal visual processing
  • Add model to global-only endpoint list for worldwide availability

Implementation Details

Model Definition (gemini-3-pro-preview.yaml):

  • Context window: 1,048,576 tokens
  • Max output: 65,536 tokens
  • Features: tool-call, multi-tool-call, agent-thought, vision, stream-tool-call, document, video, audio
  • Pricing: $2.00 input / $12.00 output per million tokens (standard tier ≤200K)

Code Changes (llm.py):

  • Add thinking_level to ThinkingConfig with string-to-enum conversion (Low → LOW, High → HIGH)
  • Add media_resolution parameter with MediaResolution enum mapping
  • Implement mutual exclusivity between thinking_budget (Gemini 2.x) and thinking_level (Gemini 3)
  • Gemini 3 models prioritize thinking_level when both parameters present
  • Fix: Add None check for content before calling .get("role") to prevent AttributeError

Dependencies (requirements.txt):

  • Update google-genai from 1.11.0 to 1.51.0 for full Gemini 3 API support

Key Parameters

thinking_level (New for Gemini 3)

  • Type: String enum (Low | High)
  • Default: High
  • Purpose: Dynamic reasoning depth control
  • Note: Replaces thinking_budget for Gemini 3 models

media_resolution (New for Gemini 3)

  • Type: String enum (Default | Low | Medium | High)
  • Default: Default (auto-select)
  • Purpose: Fine-grained multimodal visual processing quality
  • Token Impact:
    • Images (High): 1,120 tokens
    • PDF (Medium): 560 tokens
    • Video (Low/Medium): 70 tokens/frame
    • Video text-heavy (High): 280 tokens/frame

Backward Compatibility

  • Existing Gemini 1.x/2.x models continue using thinking_budget
  • Automatic parameter routing based on model name
  • SDK update tested for compatibility

Testing Checklist

  • Model appears in provider model list
  • Basic text generation works
  • Multimodal inputs (image, PDF, video, audio) work correctly
  • thinking_level parameter correctly sets reasoning depth
  • media_resolution parameter affects token usage as expected
  • include_thoughts returns reasoning process
  • Tool calling and function calling work
  • Grounding with Google Search works
  • Structured output (JSON schema) works
  • Existing Gemini 1.x/2.x models still work correctly

References

Files Changed

models/vertex_ai/models/llm/gemini-3-pro-preview.yaml  (new file, 103 lines)
models/vertex_ai/models/llm/llm.py                     (+35 lines, -2 lines)
models/vertex_ai/requirements.txt                      (SDK 1.11.0 → 1.51.0)

🤖 Generated with Claude Code


🔄 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/2111 **Author:** [@kaixintang95](https://github.com/kaixintang95) **Created:** 11/20/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `feat/vertex-ai-gemini-3-pro-preview` --- ### 📝 Commits (2) - [`db129c6`](https://github.com/langgenius/dify-official-plugins/commit/db129c67dfa3768b27acda65bb367bbf1bafd21d) feat(vertex_ai): Add Gemini 3 Pro Preview support with new parameters - [`daca50a`](https://github.com/langgenius/dify-official-plugins/commit/daca50a5d1c6f5b65af799718229a2a10bdba545) chore: Bump version to 0.0.29 ### 📊 Changes **4 files changed** (+137 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `models/vertex_ai/manifest.yaml` (+1 -1) ➕ `models/vertex_ai/models/llm/gemini-3-pro-preview.yaml` (+102 -0) 📝 `models/vertex_ai/models/llm/llm.py` (+33 -2) 📝 `models/vertex_ai/requirements.txt` (+1 -1) </details> ### 📄 Description ## Summary Add support for **gemini-3-pro-preview** model to the Vertex AI plugin with Gemini 3 specific features and parameters. ### New Features - ✅ Add `gemini-3-pro-preview` model definition with 1M context window - ✅ Support `thinking_level` parameter (Low/High) for dynamic reasoning control - ✅ Support `media_resolution` parameter (Default/Low/Medium/High) for multimodal visual processing - ✅ Add model to global-only endpoint list for worldwide availability ### Implementation Details **Model Definition** (`gemini-3-pro-preview.yaml`): - Context window: 1,048,576 tokens - Max output: 65,536 tokens - Features: tool-call, multi-tool-call, agent-thought, vision, stream-tool-call, document, video, audio - Pricing: $2.00 input / $12.00 output per million tokens (standard tier ≤200K) **Code Changes** (`llm.py`): - Add `thinking_level` to ThinkingConfig with string-to-enum conversion (Low → LOW, High → HIGH) - Add `media_resolution` parameter with MediaResolution enum mapping - Implement mutual exclusivity between `thinking_budget` (Gemini 2.x) and `thinking_level` (Gemini 3) - Gemini 3 models prioritize `thinking_level` when both parameters present - Fix: Add None check for content before calling `.get("role")` to prevent AttributeError **Dependencies** (`requirements.txt`): - Update `google-genai` from 1.11.0 to 1.51.0 for full Gemini 3 API support ### Key Parameters #### thinking_level (New for Gemini 3) - **Type**: String enum (Low | High) - **Default**: High - **Purpose**: Dynamic reasoning depth control - **Note**: Replaces `thinking_budget` for Gemini 3 models #### media_resolution (New for Gemini 3) - **Type**: String enum (Default | Low | Medium | High) - **Default**: Default (auto-select) - **Purpose**: Fine-grained multimodal visual processing quality - **Token Impact**: - Images (High): 1,120 tokens - PDF (Medium): 560 tokens - Video (Low/Medium): 70 tokens/frame - Video text-heavy (High): 280 tokens/frame ### Backward Compatibility - ✅ Existing Gemini 1.x/2.x models continue using `thinking_budget` - ✅ Automatic parameter routing based on model name - ✅ SDK update tested for compatibility ### Testing Checklist - [ ] Model appears in provider model list - [ ] Basic text generation works - [ ] Multimodal inputs (image, PDF, video, audio) work correctly - [ ] `thinking_level` parameter correctly sets reasoning depth - [ ] `media_resolution` parameter affects token usage as expected - [ ] `include_thoughts` returns reasoning process - [ ] Tool calling and function calling work - [ ] Grounding with Google Search works - [ ] Structured output (JSON schema) works - [ ] Existing Gemini 1.x/2.x models still work correctly ### References - **Official Documentation**: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro - **Related PRs**: #2081, #2106 (gemini plugin Gemini 3 implementation) - **API Reference**: google-genai 1.51.0 ### Files Changed ``` models/vertex_ai/models/llm/gemini-3-pro-preview.yaml (new file, 103 lines) models/vertex_ai/models/llm/llm.py (+35 lines, -2 lines) models/vertex_ai/requirements.txt (SDK 1.11.0 → 1.51.0) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#2268