跳到主要内容

Azure Blob Storage 文件

兼容性

仅在 Node.js 上可用。

本文介绍了如何将 Azure 文件加载到 LangChain 文档中。

设置

要使用此加载器,您需要预先设置 Unstructured,并使其在可用的 URL 端点准备就绪。它也可以配置为在本地运行。

请参阅此处的文档,以获取有关如何执行此操作的信息。

您还需要安装官方的 Azure Storage Blob 客户端库

npm install @langchain/community @langchain/core @azure/storage-blob

用法

配置 Unstructured 后,您可以使用 Azure Blob Storage 文件加载器加载文件,然后将其转换为文档。

import { AzureBlobStorageFileLoader } from "@langchain/community/document_loaders/web/azure_blob_storage_file";

const loader = new AzureBlobStorageFileLoader({
azureConfig: {
connectionString: "",
container: "container_name",
blobName: "example.txt",
},
unstructuredConfig: {
apiUrl: "http://localhost:8000/general/v0/general",
apiKey: "", // this will be soon required
},
});

const docs = await loader.load();

console.log(docs);

API 参考


此页是否对您有帮助?


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