Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt

Use this file to discover all available pages before exploring further.

兼容性说明仅适用于 Node.js 环境。
本文介绍如何将 Azure Blob 存储中的容器加载为 LangChain 文档。

环境设置

要运行此加载器,你需要先配置好 Unstructured 服务,并确保其可通过一个可用的 URL 端点访问。也可以配置为本地运行。 有关如何设置的信息,请参阅 Unstructured 文件加载器文档 你还需要安装官方的 Azure 存储 Blob 客户端库:
npm
npm install @langchain/community @langchain/core @azure/storage-blob

使用方法

配置好 Unstructured 后,你可以使用 Azure Blob 存储容器加载器来加载文件,并将其转换为文档。
import { AzureBlobStorageContainerLoader } from "@langchain/community/document_loaders/web/azure_blob_storage_container";

const loader = new AzureBlobStorageContainerLoader({
  azureConfig: {
    connectionString: "",
    container: "容器名称",
  },
  unstructuredConfig: {
    apiUrl: "http://localhost:8000/general/v0/general",
    apiKey: "", // 此字段即将成为必填项
  },
});

const docs = await loader.load();

console.log(docs);