feat(components): add Forge embeddings node#6469
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new ForgeEmbedding component, integrating Voxell Forge's OpenAI-compatible API to generate text embeddings. It includes the model definitions in models.json, the implementation of the ForgeEmbedding node class, unit tests, and an SVG icon. A review comment identifies an issue where setting stripNewLines to false is ignored due to a truthiness check, and suggests checking for undefined instead to correctly respect the user's preference.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| } | ||
| } | ||
|
|
||
| if (stripNewLines) obj.stripNewLines = stripNewLines |
There was a problem hiding this comment.
If stripNewLines is explicitly set to false by the user, the condition if (stripNewLines) will evaluate to false, and obj.stripNewLines will not be set. This causes the underlying OpenAIEmbeddings to fall back to its default value of true.
To ensure that false is respected, check if stripNewLines is not undefined instead.
| if (stripNewLines) obj.stripNewLines = stripNewLines | |
| if (stripNewLines !== undefined) obj.stripNewLines = stripNewLines |
What changed
This PR adds a new Forge embeddings node to Flowise.
Changes included:
Forge Embeddingnode underpackages/components@langchain/openaiOpenAIEmbeddings, since Forge exposes an OpenAI-compatible embeddings API (POST /v1/embeddings, OpenAI request/response shape)configuration.baseURL = 'https://api.voxell.ai/v1'openAIApicredential (users put their Forge API key in the OpenAI API key field — no new credential schema)modelNametoforge-pro; supported models also surfaced inmodels.json:forge-turbo(1024d)forge-pro(2560d)forge-ultra-4k(4096d)stripNewLines,batchSize,timeout,dimensions,encodingFormatWhy this change is needed
Forge is an OpenAI-compatible embeddings provider. Today users can reach it through the OpenAI Custom Embedding node by manually overriding the base path, but there is no first-class node. This adds a small, self-contained node that follows the existing embeddings pattern (closely mirrors
OpenAIEmbeddingCustom) so the endpoint, default model, and model list are preconfigured.User impact
Users can now:
dimensions,batchSize, etc.) without code changesTests / validation
Validated locally with:
pnpm installpnpm --filter flowise-components build(tsc + gulp; icon copied to dist)pnpm --filter flowise-components test -- ForgeEmbeddingprettier --checkon the new files andmodels.jsonNote: validation covers build and unit tests only; no live call to the Forge API was made as part of this PR.
Notes for reviewers
This PR intentionally keeps scope small:
openAIApi)openAIApicredential, so the API key is entered in the OpenAI API key field — flagging since that credential-reuse UX is slightly unusual