[PR #608] [CLOSED] feat: implement Gemini text embeddings calls #1460

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

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/608
Author: @Xeftax
Created: 3/29/2025
Status: Closed

Base: mainHead: main


📝 Commits (4)

  • 845def5 feat: implement Gemini text embeddings calls
  • 120cbc5 add common gemini error mapping across llm and embeddings
  • e81e295 Merge branch 'main' into main
  • 36e0184 Merge branch 'main' into main

📊 Changes

8 files changed (+316 additions, -37 deletions)

View changed files

models/gemini/models/common_gemini.py (+32 -0)
📝 models/gemini/models/llm/llm.py (+2 -32)
models/gemini/models/text_embedding/_position.yaml (+3 -0)
models/gemini/models/text_embedding/embedding-001.yaml (+9 -0)
models/gemini/models/text_embedding/gemini-embedding-exp-03-07.yaml (+9 -0)
models/gemini/models/text_embedding/text-embedding-004.yaml (+9 -0)
models/gemini/models/text_embedding/text_embedding.py (+241 -0)
📝 models/gemini/provider/google.yaml (+11 -5)

📄 Description

Related Issue or Context

https://github.com/langgenius/dify/issues/15529
https://ai.google.dev/gemini-api/docs/embeddings
https://ai.google.dev/gemini-api/docs/pricing#text-embedding-004

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)
  • Documentation update
  • Code refactoring
  • Other

Test Evidence

Important

Visual proof is required for Bug fixes, New features, Breaking changes:

Note

For Non-LLM Plugin Changes:

  • Bug fixes:
    • Show the fix working
  • New features:
    • Demonstrate the functionality
  • Breaking changes:
    • Show both old and new behavior

For LLM Plugin Changes:

  • Bug fixes:
    • Show the fix working with example inputs/outputs
  • New features:
    • Demonstrate the functionality with example inputs/outputs
  • Breaking changes (requires comprehensive testing):
    • Conversation & Interaction:
      • Conversation sequence correctness:
        • System message handling
        • Proper turn-taking (user→assistant messages)
      • Tool usage demonstrations (if applicable):
        • Multi-round tool interactions
        • Appropriate handling of tool outputs
    • Input/Output Handling:
      • Multimodal input handling (images, PDFs, audio, video if applicable)
      • Multimodal output generation (images, PDFs, audio, video if applicable)
      • Structured output format (if applicable)
    • Metrics:
      • Token consumption metrics
    • Others:
      • Reasoning process (if applicable, e.g. tool use)

Environment Verification

Important

Please confirm your testing environment:

  • Changes tested in a clean/isolated environment
  • Test environment matches production configuration
  • No cached data influenced the test results

🔄 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/608 **Author:** [@Xeftax](https://github.com/Xeftax) **Created:** 3/29/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`845def5`](https://github.com/langgenius/dify-official-plugins/commit/845def583b9ddb6f3b07903d058eca0d74e2f24c) feat: implement Gemini text embeddings calls - [`120cbc5`](https://github.com/langgenius/dify-official-plugins/commit/120cbc5f510106308b51705082851d39fad8f23a) add common gemini error mapping across llm and embeddings - [`e81e295`](https://github.com/langgenius/dify-official-plugins/commit/e81e29503c8cb121beef05b6a363bceda63b41b3) Merge branch 'main' into main - [`36e0184`](https://github.com/langgenius/dify-official-plugins/commit/36e018449379c97e898af014299c1088a6063a94) Merge branch 'main' into main ### 📊 Changes **8 files changed** (+316 additions, -37 deletions) <details> <summary>View changed files</summary> ➕ `models/gemini/models/common_gemini.py` (+32 -0) 📝 `models/gemini/models/llm/llm.py` (+2 -32) ➕ `models/gemini/models/text_embedding/_position.yaml` (+3 -0) ➕ `models/gemini/models/text_embedding/embedding-001.yaml` (+9 -0) ➕ `models/gemini/models/text_embedding/gemini-embedding-exp-03-07.yaml` (+9 -0) ➕ `models/gemini/models/text_embedding/text-embedding-004.yaml` (+9 -0) ➕ `models/gemini/models/text_embedding/text_embedding.py` (+241 -0) 📝 `models/gemini/provider/google.yaml` (+11 -5) </details> ### 📄 Description ## Related Issue or Context <!-- - Link related issues if applicable: #issue_number - Or provide context about why this change is needed --> https://github.com/langgenius/dify/issues/15529 https://ai.google.dev/gemini-api/docs/embeddings https://ai.google.dev/gemini-api/docs/pricing#text-embedding-004 ## Type of Change <!-- Put an `x` in all the boxes that apply --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that may cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Other ## Test Evidence > [!IMPORTANT] > Visual proof is required for Bug fixes, New features, Breaking changes: - Screenshots or Video/GIF (if applicable): https://github.com/user-attachments/assets/740fe2ab-bff6-422a-86e9-688c5abb21d4 > [!NOTE] > For Non-LLM Plugin Changes: > - **Bug fixes**: > - [ ] Show the fix working > - **New features**: > - [ ] Demonstrate the functionality > - **Breaking changes**: > - [ ] Show both old and new behavior > > For LLM Plugin Changes: > - **Bug fixes**: > - [ ] Show the fix working with example inputs/outputs > - **New features**: > - [x] Demonstrate the functionality with example inputs/outputs > - **Breaking changes** (requires comprehensive testing): > - **Conversation & Interaction**: > - Conversation sequence correctness: > - [ ] System message handling > - [ ] Proper turn-taking (user→assistant messages) > - Tool usage demonstrations (if applicable): > - [ ] Multi-round tool interactions > - [ ] Appropriate handling of tool outputs > - **Input/Output Handling**: > - [ ] Multimodal input handling (images, PDFs, audio, video if applicable) > - [ ] Multimodal output generation (images, PDFs, audio, video if applicable) > - [ ] Structured output format (if applicable) > - **Metrics**: > - [ ] Token consumption metrics > - **Others**: > - [ ] Reasoning process (if applicable, e.g. tool use) ### Environment Verification > [!IMPORTANT] > Please confirm your testing environment: - [x] Changes tested in a clean/isolated environment - [x] Test environment matches production configuration - [x] No cached data influenced the test results --- <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:00 -05:00
yindo closed this issue 2026-02-16 10:23:00 -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#1460