Skip to main content

Metal

本页面介绍如何在 LangChain 中使用 Metal

什么是 Metal?

Metal 是一个为生产环境构建的托管检索和内存平台。轻松将数据索引到 Metal 中,并对其进行语义搜索和检索。

Metal 仪表板的截图,显示了带有示例数据的浏览索引功能。

快速开始

通过 创建一个 Metal 账户 开始。

然后,您可以轻松利用 MetalRetriever 类开始检索您的数据,以便进行语义搜索、提示上下文等。该类接受一个 Metal 实例和一个参数字典,以传递给 Metal API。

from langchain.retrievers import MetalRetriever
from metal_sdk.metal import Metal


metal = Metal("API_KEY", "CLIENT_ID", "INDEX_ID");
retriever = MetalRetriever(metal, params={"limit": 2})

docs = retriever.invoke("search term")

此页面是否有帮助?


您还可以留下详细的反馈 在 GitHub 上