Skip to content

Enhance: Improve 'Strip New Lines' for Gemini/Vertex embedding effici…#5010

Merged
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
kpj2006:main
Aug 7, 2025
Merged

Enhance: Improve 'Strip New Lines' for Gemini/Vertex embedding effici…#5010
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
kpj2006:main

Conversation

@kpj2006
Copy link
Copy Markdown
Contributor

@kpj2006 kpj2006 commented Aug 3, 2025

✅ 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

@0xi4o
Copy link
Copy Markdown
Contributor

0xi4o commented Aug 6, 2025

@HenryHengZJ Tested this and it works. Good to merge.

@kpj2006 Thank you for your contribution!

screenshot-2025-08-06_12-02-24 screenshot-2025-08-06_12-01-08 screenshot-2025-08-06_11-54-17 screenshot-2025-08-06_11-45-33

@kpj2006
Copy link
Copy Markdown
Contributor Author

kpj2006 commented Aug 6, 2025

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!

Copy link
Copy Markdown
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@HenryHengZJ HenryHengZJ merged commit feb899a into FlowiseAI:main Aug 7, 2025
2 checks passed
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.

[FEATURE] Strip New Lines for Gemini and Vertex embedding

3 participants