主题
概念
数据连接器(也叫 Reader)从各种数据来源与格式摄取数据,产出统一的 Document 表示(文本加上简单元数据)。
集成包
每个数据连接器都作为独立的包发布,因此你只需安装要用的那几个。完整集合位于 LlamaIndex 仓库的 readers 目录,每个包在 PyPI 上的名字都遵循 llama-index-readers-<source>。
使用方式
从这里开始:
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等文件。
更多细节见模块指南。