Embedding models create a vector representation of a piece of text.This page documents integrations with various model providers that allow you to use embeddings in LangChain.
Copy
Ask AI
pip install -qU langchain-openai
Copy
Ask AI
import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import OpenAIEmbeddingsembeddings = OpenAIEmbeddings(model="text-embedding-3-large")