Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or Docker Desktop.
- To use LangChain within MindsDB, install the required dependencies following this instruction.
Setup
Create an AI/ML engine from the LangChain Embedding handler.embedding as an engine and providing your OpenAI API key.
engineis a required parameter. It defines the AI engine, as created with theCREATE ML_ENGINEstatement, to be used.classis a required parameter. It defines the model provider, such as"OpenAI"or"HuggingFace".modelis a required parameter. It defined the embedding model, such astext-embedding-3-small.openai_api_keyis a required parameter when using OpenAI as a provider.input_columnsis an optional parameter. It defines the column(s) to be processed by the embedding model.
Usage
The following usage examples utilizeembedding to create a model with the CREATE MODEL statement.
- Using the OpenAI models:
- Using the HuggingFace models:
DESCRIBE command and look at the status column.