OpenAI Embeddings Node
This node in LiteGraph generates embeddings for input text using OpenAI’s embedding models. Embeddings are dense vector representations of text that capture semantic meaning and can be used for various downstream tasks like similarity comparison, clustering, and classification.
Inputs and Outputs
Input: Accepts ‘string’ input representing the text to generate embeddings for.
Output: Outputs an ‘array’ containing the generated embeddings.
Properties
Model: Choose from available embedding models like ‘text-embedding-ada-002’, ‘text-embedding-ada-002-v2’, ‘text-embedding-babbage-001’, ‘text-embedding-curie-001’, ‘text-embedding-davinci-001’, ‘text-embedding-davinci-002’.
Secret: API key for accessing OpenAI services.
Functionalities
The node sends a request to the OpenAI API with the selected model and input text to generate embeddings. The generated embeddings are then output as an array.
Widgets
Model Selector: Choose the embedding model to use.
Secret Selector: Select the API key for access.
Usage
1. Connect a string input representing the text to generate embeddings for.
2. Choose the desired embedding model and provide the API key.
3. The node processes the input text and outputs the generated embeddings as an array.
4. The generated embeddings can be used for various downstream tasks like similarity comparison, clustering, or as input to other machine learning models.