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.
Copy
Ask AI
from langchain_community.embeddings import LLMRailsEmbeddings
Copy
Ask AI
embeddings = LLMRailsEmbeddings(model="embedding-english-v1") # or embedding-multi-v1
Copy
Ask AI
text = "This is a test document."
To generate embeddings, you can either query an invidivual text, or you can query a list of texts.