VertexAIEmbeddingsWithStripNewLines (GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts)

Flowise · packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts · typescript · Apache-2.0
ai

Google Vertex AI embedding node that optionally strips newlines before embedding.

// Source: https://github.com/FlowiseAI/Flowise | License: Apache-2.0 | Copyright 2023-present FlowiseAI, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { GoogleVertexAIEmbeddingsInput, VertexAIEmbeddings } from '@langchain/google-vertexai'
import { buildGoogleCredentials } from '../../../src/google-utils'
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
import { MODEL_TYPE, getModels, getRegions } from '../../../src/modelLoader'
import { getBaseClasses } from '../../../src/utils'

class VertexAIEmbeddingsWithStripNewLines extends VertexAIEmbeddings {
    stripNewLines: boolean

    constructor(params: GoogleVertexAIEmbeddingsInput & { stripNewLines?: boolean }) {
        super(params)
        this.stripNe

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key