
Node Details
- Name: OpenAIEmbedding_Embeddings
- Type: OpenAIEmbeddings
- Version: 4.0
- Category: Embeddings
Base Classes
- OpenAIEmbeddings
- (Additional base classes from OpenAIEmbeddings)
Parameters
Credential (Required)
- Label: Connect Credential
- Name: credential
- Type: credential
- Credential Names: openAIApi
Inputs
-
Model Name
- Type: asyncOptions
- Default: “text-embedding-ada-002”
- Description: The name of the OpenAI model to use for generating embeddings.
-
Strip New Lines (Optional)
- Type: boolean
- Description: Whether to remove new line characters from the input text.
-
Batch Size (Optional)
- Type: number
- Description: The number of texts to process in a single API call.
-
Timeout (Optional)
- Type: number
- Description: The maximum time (in milliseconds) to wait for the API response.
-
BasePath (Optional)
- Type: string
- Description: The base URL for API requests, useful for using alternative API endpoints.
-
Dimensions (Optional)
- Type: number
- Description: The number of dimensions for the output embedding vectors.
Functionality
- The node first loads the available embedding models using the
listModels
method. - During initialization, it processes the input parameters and credential data.
- It then creates an instance of OpenAIEmbeddings with the specified configuration.
- This instance can be used to generate embeddings for given text inputs.
Use Cases
- Text similarity comparison
- Document clustering
- Semantic search
- Input preparation for machine learning models
- Content recommendation systems
Notes
- The node uses the @langchain/openai package for interaction with the OpenAI API.
- It supports various additional parameters for fine-tuning the embedding process.
- The actual embedding generation occurs when the initialized node is used in a workflow.