NotionReader
定义于:.build/typescript/packages/providers/notion/src/reader.ts:18
Notion页面会被递归检索并转换为文档对象。 Notion数据库也可以被加载,且序列化方法可以自定义。
[注意] 要使用此阅读器,必须提前创建Notion集成 详情请参阅此文档。
BaseReader<Document>
new NotionReader(
options):NotionReader
定义于:.build/typescript/packages/providers/notion/src/reader.ts:25
NotionReader 类的构造函数
NotionReaderOptions
阅读器的配置选项
NotionReader
toDocuments()
Section titled “toDocuments()”toDocuments(
pages):Document<Metadata>[]
定义于:.build/typescript/packages/providers/notion/src/reader.ts:34
将页面转换为文档对象数组
Page[]
要转换的Notion页面(loadPages的返回值)
Document<Metadata>[]
一个文档对象数组
loadPages()
Section titled “loadPages()”loadPages(
rootPageId):Promise<Page[]>
定义于:.build/typescript/packages/providers/notion/src/reader.ts:50
递归加载具有指定根页面ID的Notion页面。
rootPageId
Section titled “rootPageId”string
根 Notion 页面 ID
Promise<Page[]>
一个解析为页面对象的Promise(可通过toDocuments方法进行转换)
loadData()
Section titled “loadData()”loadData(
rootPageId):Promise<Document<Metadata>[]>
定义于:.build/typescript/packages/providers/notion/src/reader.ts:70
递归加载Notion页面并将其转换为文档对象数组
rootPageId
Section titled “rootPageId”string
根 Notion 页面 ID
Promise<Document<Metadata>[]>
一个解析为文档对象数组的 Promise
BaseReader.loadData