跳到主要內容
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

此頁面是否對您有幫助?