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

本 Notebook 展示如何使用 Netmind AI 生成嵌入。

访问 https://www.netmind.ai/ 并注册以获取 API 密钥。

设置

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

%pip install llama-index-embeddings-netmind
!pip install llama-index
# You can set the API key in the embeddings or env
# import os
# os.environ["NETMIND_API_KEY"] = "your-api-key"

from llama_index.embeddings.netmind import NetmindEmbedding

embed_model = NetmindEmbedding(
    model_name="BAAI/bge-m3", api_key="your-api-key"
)

获取嵌入

embeddings = embed_model.get_text_embedding("hello world")
print(len(embeddings))
1024
print(embeddings[:5])
[-0.04039396345615387, 0.03703497350215912, -0.02897450141608715, 0.016117244958877563, -0.03569157049059868]

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