Node Details

  • Name: googlevertexaiEmbeddings
  • Type: GoogleVertexAIEmbeddings
  • Version: 2.0
  • Category: Embeddings

Base Classes

  • GoogleVertexAIEmbeddings
  • (Additional base classes from GoogleVertexAIEmbeddings)

Parameters

Credential (Optional)

  • Type: googleVertexAuth
  • Description: Google Vertex AI credential. Not required if using a GCP service like Cloud Run or if default credentials are installed on the local machine.

Inputs

  • Model Name:
    • Type: Asynchronous options
    • Default: “textembedding-gecko@001”
    • Load Method: listModels (retrieves available embedding models)

Initialization

The node initializes a GoogleVertexAIEmbeddings instance with the following potential configurations:

  • Google Application Credential File Path
  • Google Application Credential JSON
  • Project ID
  • Model Name

Usage

This node is typically used in workflows that require text embeddings, such as:

  • Semantic search
  • Text classification
  • Clustering
  • Recommendation systems

Implementation Details

  1. The node first retrieves credential data and input parameters.
  2. It then configures authentication options based on the provided credentials.
  3. A GoogleVertexAIEmbeddings instance is created with the specified model and authentication options.
  4. The initialized model is returned, ready to generate embeddings for input text.

Error Handling

The node includes error checks for:

  • Missing Google Application Credential
  • Conflicting credential inputs

Integration

This node is designed to work within a larger system, likely a workflow or pipeline for natural language processing tasks. It can be connected to other nodes that require text embeddings as input.

Notes

  • The node uses the @langchain/community library for the GoogleVertexAIEmbeddings implementation.
  • It supports dynamic loading of available embedding models.
  • The node is flexible in terms of authentication, supporting both file-based and JSON-based credentials.