Node Details

  • Name: OpenAIEmbeddingCustom_Embeddings
  • Type: OpenAIEmbeddingsCustom
  • Version: 2.0
  • Category: Embeddings

Base Classes

  • OpenAIEmbeddingsCustom
  • OpenAIEmbeddings (and its base classes)

Parameters

Credential (Required)

  • Type: openAIApi
  • Required Fields: openAIApiKey

Inputs

  1. Strip New Lines (optional)

    • Type: boolean
    • Description: Removes new line characters from the input text if set to true.
  2. Batch Size (optional)

    • Type: number
    • Description: Sets the number of texts to process in a single API call.
  3. Timeout (optional)

    • Type: number
    • Description: Sets the maximum time (in milliseconds) to wait for an API response.
  4. BasePath (optional)

    • Type: string
    • Description: Specifies a custom base URL for the OpenAI API.
  5. Model Name (optional)

    • Type: string
    • Description: Specifies the OpenAI model to use for generating embeddings.
  6. Dimensions (optional)

    • Type: number
    • Description: Sets the number of dimensions for the output embeddings.

Functionality

The node initializes an OpenAIEmbeddings instance with the provided parameters. It retrieves the OpenAI API key from the user’s credentials and applies any additional parameters specified in the node configuration. The resulting embeddings model can be used in downstream tasks that require text embeddings.

Use Cases

  • Text similarity comparison
  • Document clustering
  • Semantic search
  • Feature extraction for machine learning models
  • Content-based recommendation systems

Notes

  • This custom node allows for more fine-grained control over the embedding process compared to the standard OpenAI Embeddings node.
  • Users should be mindful of their API usage, as generating embeddings can consume a significant number of tokens.
  • The ‘dimensions’ parameter allows users to specify the size of the embedding vectors, which can be useful for compatibility with specific models or applications.