init_embeddings
Requires the integration package for the chosen model provider to be installed (e.g.,
pip install langchain-openai).Refer to the provider integration’s API reference for supported model parameters to use as **kwargs.The name of the model, e.g.
'openai:text-embedding-3-small'.You can also specify model and model provider in a single argument using '{model_provider}:{model}' format, e.g. 'openai:text-embedding-3-small'.The model provider if not specified as part of the model arg (see above).Supported
provider values and the corresponding integration package are:openai→langchain-openaiazure_openai→langchain-openaibedrock→langchain-awscohere→langchain-coheregoogle_vertexai→langchain-google-vertexaihuggingface→langchain-huggingfacemistralai→langchain-mistralaiollama→langchain-ollama
Additional model-specific parameters passed to the embedding model.These vary by provider. Refer to the specific model provider’s integration reference for all available parameters.
An
Embeddings instance that can generate embeddings for text.Examples
Added in
langchain 0.3.9Embeddings
langchain_core for convenience.
See the LangChain Core documentation for the full API reference.