-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
notion.ts
29 lines (27 loc) · 961 Bytes
/
notion.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { DirectoryLoader, UnknownHandling } from "./directory.js";
import { TextLoader } from "./text.js";
import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion020MigrationWarning({
oldEntrypointName: "document_loaders/fs/notion",
newPackageName: "@langchain/community",
});
/**
* @deprecated - Import from "@langchain/community/document_loaders/fs/notion" instead. This entrypoint will be removed in 0.3.0.
*
* A class that extends the DirectoryLoader class. It represents a
* document loader that loads documents from a directory in the Notion
* format. It uses the TextLoader for loading '.md' files and ignores
* unknown file types.
*/
export class NotionLoader extends DirectoryLoader {
constructor(directoryPath: string) {
super(
directoryPath,
{
".md": (filePath) => new TextLoader(filePath),
},
true,
UnknownHandling.Ignore
);
}
}