Azure Blob 存储容器
¥Azure Blob Storage Container
仅在 Node.js 上可用。
¥Only available on Node.js.
本概述介绍如何将 Azure Blob 存储中的容器加载到 LangChain 文档中。
¥This covers how to load a container on Azure Blob Storage into LangChain documents.
设置
¥Setup
要运行此加载器,你需要已设置好 Unstructured,并准备好在可用的 URL 端点上使用。它也可以配置为本地运行。
¥To run this loader, you'll need to have Unstructured already set up and ready to use at an available URL endpoint. It can also be configured to run locally.
查看 此处 文档,了解如何执行此操作。
¥See the docs here for information on how to do that.
你还需要安装官方 Azure Storage Blob 客户端库:
¥You'll also need to install the official Azure Storage Blob client library:
- npm
- Yarn
- pnpm
npm install @langchain/community @langchain/core @azure/storage-blob
yarn add @langchain/community @langchain/core @azure/storage-blob
pnpm add @langchain/community @langchain/core @azure/storage-blob
用法
¥Usage
配置非结构化文件后,你可以使用 Azure Blob 存储容器加载器加载文件,然后将其转换为文档。
¥Once Unstructured is configured, you can use the Azure Blob Storage Container loader to load files and then convert them into a Document.
import { AzureBlobStorageContainerLoader } from "@langchain/community/document_loaders/web/azure_blob_storage_container";
const loader = new AzureBlobStorageContainerLoader({
azureConfig: {
connectionString: "",
container: "container_name",
},
unstructuredConfig: {
apiUrl: "http://localhost:8000/general/v0/general",
apiKey: "", // this will be soon required
},
});
const docs = await loader.load();
console.log(docs);
API Reference:
- AzureBlobStorageContainerLoader from
@langchain/community/document_loaders/web/azure_blob_storage_container