LLMRails | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsAleph AlphaAwaDBAzureOpenAIBaidu QianfanBedrockBGE on Hugging FaceClarifaiCohereDashScopeDeepInfraEDEN AIElasticsearchEmbaasERNIE Embedding-V1Fake EmbeddingsGoogle Vertex AI PaLMGPT4AllGradientHugging FaceInstructEmbeddingsJinaLlama-cppLLMRailsLocalAIMiniMaxModelScopeMosaicMLNLP CloudOllamaOpenAISageMakerSelf HostedSentence TransformersSpaCyTensorflowHubXorbits inference (Xinference)Vector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsText embedding modelsLLMRailsLLMRailsLet's load the LLMRails Embeddings class.To use LLMRails embedding you need to pass api key by argument or set it in environment with LLM_RAILS_API_KEY key.
To gey API Key you need to sign up in https://console.llmrails.com/signup and then go to https://console.llmrails.com/api-keys and copy key from there after creating one key in platform.from langchain.embeddings import LLMRailsEmbeddingsembeddings = LLMRailsEmbeddings(model='embedding-english-v1') # or embedding-multi-v1text = "This is a test document."To generate embeddings, you can either query an invidivual text, or you can query a list of texts.query_result = embeddings.embed_query(text)query_result[:5]    [-0.09996652603149414,     0.015568195842206478,     0.17670190334320068,     0.16521021723747253,     0.21193109452724457]doc_result = embeddings.embed_documents([text])doc_result[0][:5]    [-0.04242777079343796,     0.016536075621843338,     0.10052520781755447,     0.18272875249385834,     0.2079043835401535]PreviousLlama-cppNextLocalAICommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Let's load the LLMRails Embeddings class.
Let's load the LLMRails Embeddings class. ->: LLMRails | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsAleph AlphaAwaDBAzureOpenAIBaidu QianfanBedrockBGE on Hugging FaceClarifaiCohereDashScopeDeepInfraEDEN AIElasticsearchEmbaasERNIE Embedding-V1Fake EmbeddingsGoogle Vertex AI PaLMGPT4AllGradientHugging FaceInstructEmbeddingsJinaLlama-cppLLMRailsLocalAIMiniMaxModelScopeMosaicMLNLP CloudOllamaOpenAISageMakerSelf HostedSentence TransformersSpaCyTensorflowHubXorbits inference (Xinference)Vector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsText embedding modelsLLMRailsLLMRailsLet's load the LLMRails Embeddings class.To use LLMRails embedding you need to pass api key by argument or set it in environment with LLM_RAILS_API_KEY key.
To gey API Key you need to sign up in https://console.llmrails.com/signup and then go to https://console.llmrails.com/api-keys and copy key from there after creating one key in platform.from langchain.embeddings import LLMRailsEmbeddingsembeddings = LLMRailsEmbeddings(model='embedding-english-v1') # or embedding-multi-v1text = "This is a test document."To generate embeddings, you can either query an invidivual text, or you can query a list of texts.query_result = embeddings.embed_query(text)query_result[:5]    [-0.09996652603149414,     0.015568195842206478,     0.17670190334320068,     0.16521021723747253,     0.21193109452724457]doc_result = embeddings.embed_documents([text])doc_result[0][:5]    [-0.04242777079343796,     0.016536075621843338,     0.10052520781755447,     0.18272875249385834,     0.2079043835401535]PreviousLlama-cppNextLocalAICommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.