Metal
本頁涵蓋如何在 LangChain 中使用 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")
API 參考:MetalRetriever