Azure Blob 存储文件
¥Azure Blob Storage File
仅在 Node.js 上可用。
¥Only available on Node.js.
本概述如何将 Azure 文件加载到 LangChain 文档中。
¥This covers how to load an Azure File into LangChain documents.
设置
¥Setup
要使用此加载器,你需要已设置好 Unstructured 并准备好在可用的 URL 端点上使用。它也可以配置为本地运行。
¥To use 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 File loader to load files and then convert them into a 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:
- AzureBlobStorageFileLoader from
@langchain/community/document_loaders/web/azure_blob_storage_file