!pip install llama-index

import os
from llama_index.embeddings.llm_rails import LLMRailsEmbedding

api_key = os.environ.get("API_KEY", "your-api-key")
model_id = os.environ.get("MODEL_ID", "your-model-id")


embed_model = LLMRailsEmbedding(model_id=model_id, api_key=api_key)

embeddings = embed_model.get_text_embedding("It is raining cats and dogs here!")