Skip to main content

Azure Blob Storage 文件

兼容性

仅适用于 Node.js。

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

准备工作

要使用此加载器,您需要已经设置好并可以使用 Unstructured,且可通过某个可用的 URL 端点访问。也可以配置为在本地运行。

有关如何操作的信息,请参阅此处的文档 here

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

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

使用方法

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

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 Reference:


Was this page helpful?


You can also leave detailed feedback on GitHub.