Skip to content

fix(tokener): preserve embedding retrieval purpose - #4137

Draft
samzong wants to merge 1 commit into
mainfrom
fix/embedding-purpose
Draft

samzong wants to merge 1 commit into
mainfrom
fix/embedding-purpose

Conversation

@samzong

@samzong samzong commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

Preserve the selected query or document purpose for gemini-embedding-001 through the Google native embedding route.
The plugin sends RETRIEVAL_QUERY or RETRIEVAL_DOCUMENT without changing the input text.
The existing retrieval prefixes for gemini-embedding-2-preview stay unchanged.

Deployment prerequisite

Do not merge this PR until production Tokener.ai routes gemini-embedding-001 through the native Google Gemini upstream.
The Google OpenAI-compatible endpoint rejects task_type.
Merging plugin changes into this repository's main branch triggers the Marketplace upload workflow.

Release Notes

Gemini embedding queries and documents retain their selected retrieval purpose.

Change Type

  • LLM plugin

Testing

The existing plugin test suite passed with 656 tests and three expected failures.
The real Dify invocation through Gateway and pinned LiteLLM reached Google with the corresponding taskType for both purposes.
Both Google calls returned vectors with 3,072 dimensions.
Production deployment and Marketplace publication remain unverified.

Version

Bump the plugin manifest from 0.4.2 to 0.4.3.

Signed-off-by: samzong <samzong.lu@gmail.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant