Enhance: Improve 'Strip New Lines' for Gemini/Vertex embedding effici…#5010
Merged
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom Aug 7, 2025
Merged
Enhance: Improve 'Strip New Lines' for Gemini/Vertex embedding effici…#5010HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
Conversation
Contributor
|
@HenryHengZJ Tested this and it works. Good to merge. @kpj2006 Thank you for your contribution!
|
Contributor
Author
|
Hi @HenryHengZJ I noticed that you mentioned the PR has been tested and is good to merge — thank you! Just wanted to check in if there’s anything else needed from my side, or if there’s a reason the merge is pending. Appreciate your time and feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




✅ Summary
Fixes #1406 by adding an optional Strip New Lines parameter to the GoogleGenerativeAIEmbedding and GoogleVertexAIEmbedding nodes. This allows users to remove newlines (\n) from input texts before embedding generation, helping reduce token usage.
🛠️ Changes Made
-Added stripNewLines (boolean checkbox) input to both embedding nodes
-Created extended classes for:
GoogleGenerativeAIEmbeddings
GoogleVertexAIEmbeddings
-Overrode embedDocuments() and embedQuery() methods to:
Conditionally strip \n if the checkbox is enabled
-Integrated the new classes via baseClasses in each node config