Chaindesk Retriever
此示例展示了如何在检索链中使用 Chaindesk Retriever 从 Chaindesk.ai 数据存储中检索文档。
¥This example shows how to use the Chaindesk Retriever in a retrieval chain to retrieve documents from a Chaindesk.ai datastore.
用法
¥Usage
tip
- npm
- Yarn
- pnpm
npm install @langchain/community @langchain/core
yarn add @langchain/community @langchain/core
pnpm add @langchain/community @langchain/core
import { ChaindeskRetriever } from "@langchain/community/retrievers/chaindesk";
const retriever = new ChaindeskRetriever({
datastoreId: "DATASTORE_ID",
apiKey: "CHAINDESK_API_KEY", // optional: needed for private datastores
topK: 8, // optional: default value is 3
});
const docs = await retriever.invoke("hello");
console.log(docs);
API Reference:
- ChaindeskRetriever from
@langchain/community/retrievers/chaindesk
相关
¥Related
检索器 概念指南
¥Retriever conceptual guide
检索器 操作指南
¥Retriever how-to guides