跳至内容

数据连接器 (LlamaHub)#

概念#

数据连接器(又称Reader)从不同的数据源和数据格式中提取数据,并将其转换为简单的Document表示形式(文本和简单元数据)。

提示

在完成数据摄取后,您可以在其上构建Index,使用Query Engine进行提问,并通过Chat Engine进行对话。

LlamaHub#

我们的数据连接器通过LlamaHub 🦙提供。 LlamaHub是一个开源仓库,包含您可以轻松即插即用到任何LlamaIndex应用程序中的数据加载器。

使用模式#

开始使用:

from llama_index.core import download_loader

from llama_index.readers.google import GoogleDocsReader

loader = GoogleDocsReader()
documents = loader.load_data(document_ids=[...])

查看完整的使用模式指南获取更多详情。

模块#

一些示例数据连接器:

  • 本地文件目录(SimpleDirectoryReader)。支持解析多种文件类型:.pdf.jpg.png.docx等。
  • Notion (NotionPageReader)
  • Google Docs (GoogleDocsReader)
  • Slack (SlackReader)
  • Discord (DiscordReader)
  • Apify Actors (ApifyActor)。可以爬取网页、抓取网页内容、提取文本内容,下载包括.pdf.jpg.png.docx等格式的文件。

更多详情请参阅模块指南