跳到主要内容
兼容性仅在 Node.js 上可用。
本文介绍如何将 Azure 文件加载到 LangChain 文档中。

设置

要使用此加载器,您需要已经设置好 Unstructured 并可在可用的 URL 端点处使用。它也可以配置为在本地运行。 有关如何执行此操作的信息,请参阅此处的文档。 您还需要安装官方 Azure 存储 Blob 客户端库:
npm
npm install @langchain/community @langchain/core @azure/storage-blob

用法

配置 Unstructured 后,您可以使用 Azure Blob 存储文件加载器加载文件,然后将其转换为文档。
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: "https://:8000/general/v0/general",
    apiKey: "", // this will be soon required
  },
});

const docs = await loader.load();

console.log(docs);

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.