A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python.langchain.com/docs/integrations/text_embedding/llm_rails below:

LLMRails | 🦜️🔗 LangChain

LLMRails

Let'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_community.embeddings import LLMRailsEmbeddings
embeddings = LLMRailsEmbeddings(model="embedding-english-v1")  
text = "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]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4