Skip to content
LlamaIndex 文档版本 跟随上游 源快照 5783c858 更新于 2026-10-18

如果你在 Colab 中打开这个 Notebook,可能需要先安装 LlamaIndex 🦙。

%pip install llama-index-embeddings-llm-rails
!pip install llama-index
# imports

from llama_index.embeddings.llm_rails import LLMRailsEmbedding
# get credentials and create embeddings

import os

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!"
)

BytesRouter 是社区翻译站点,所有译文仅供参考,一切以官方英文原文为准。