跳到主要内容
Open on GitHub

Metal

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

什么是 Metal?

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

Screenshot of the Metal dashboard showing the Browse Index feature with sample data.

快速开始

首先创建一个 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")
API 参考:MetalRetriever

此页是否对您有帮助?