OpenAI LLM class:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings(openai_api_key="...")Otherwise you can initialize without any params:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings()embed_documents‚ÄãEmbed list of texts‚Äãembeddings = embeddings_model.embed_documents(    [        "Hi there!",        "Oh, hello!",        "What's your name?",        "My friends call me World",        "Hello World!"    ])len(embeddings), len(embeddings[0])(5, 1536)embed_query‚ÄãEmbed single query‚ÄãEmbed a single piece of text for the purpose of comparing to other embedded pieces of texts.embedded_query = embeddings_model.embed_query("What was the name mentioned in the conversation?")embedded_query[:5][0.0053587136790156364, -0.0004999046213924885, 0.038883671164512634, -0.003001077566295862, -0.00900818221271038]PreviousLost in the middle: The problem with long contextsNextCachingGet startedSetupembed_documentsembed_queryCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Head to Integrations for documentation on built-in integrations with text embedding model providers.
Head to Integrations for documentation on built-in integrations with text embedding model providers. ->: OpenAI LLM class:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings(openai_api_key="...")Otherwise you can initialize without any params:from langchain.embeddings import OpenAIEmbeddingsembeddings_model = OpenAIEmbeddings()embed_documents‚ÄãEmbed list of texts‚Äãembeddings = embeddings_model.embed_documents(    [        "Hi there!",        "Oh, hello!",        "What's your name?",        "My friends call me World",        "Hello World!"    ])len(embeddings), len(embeddings[0])(5, 1536)embed_query‚ÄãEmbed single query‚ÄãEmbed a single piece of text for the purpose of comparing to other embedded pieces of texts.embedded_query = embeddings_model.embed_query("What was the name mentioned in the conversation?")embedded_query[:5][0.0053587136790156364, -0.0004999046213924885, 0.038883671164512634, -0.003001077566295862, -0.00900818221271038]PreviousLost in the middle: The problem with long contextsNextCachingGet startedSetupembed_documentsembed_queryCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.