Skip to content
Snippets Groups Projects
Commit ea5038e4 authored by Yi Ding's avatar Yi Ding
Browse files

disable PDF reader for now

Looks like it causes an issue with the esm package
parent b0122077
No related branches found
No related tags found
No related merge requests found
---
"llamaindex": patch
---
Disabling PDF loader for now to fix module import
...@@ -2,7 +2,6 @@ import { Document } from "../Node"; ...@@ -2,7 +2,6 @@ import { Document } from "../Node";
import { BaseReader } from "./base"; import { BaseReader } from "./base";
import { GenericFileSystem } from "../storage/FileSystem"; import { GenericFileSystem } from "../storage/FileSystem";
import { DEFAULT_FS } from "../storage/constants"; import { DEFAULT_FS } from "../storage/constants";
import { default as pdfParse } from "pdf-parse";
import _ from "lodash"; import _ from "lodash";
/** /**
...@@ -13,8 +12,6 @@ export class PDFReader implements BaseReader { ...@@ -13,8 +12,6 @@ export class PDFReader implements BaseReader {
file: string, file: string,
fs: GenericFileSystem = DEFAULT_FS fs: GenericFileSystem = DEFAULT_FS
): Promise<Document[]> { ): Promise<Document[]> {
let dataBuffer = (await fs.readFile(file)) as any; throw new Error("not implemented");
const data = await pdfParse(dataBuffer);
return [new Document({ text: data.text, id_: file })];
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment