Skip to content

Commit

Permalink
feat: 🧩 enhance PDF parser with image support
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Nov 17, 2024
1 parent 492d0fe commit ddc245c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/parsers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describe("parsers", () => {
})

test("PDF", async () => {
const result = await parsers.PDF({ filename: "src/rag/loremipsum.pdf" })
const result = await parsers.PDF({ filename: "./src/rag/loremipsum.pdf" })
console.log(result)
assert(result.file.content.includes("Lorem"))
})

Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/types/prompt_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,9 @@ interface Parsers {
PDF(
content: string | WorkspaceFile,
options?: ParsePDFOptions
): Promise<{ file: WorkspaceFile; pages: string[] } | undefined>
): Promise<
{ file: WorkspaceFile; pages: string[]; images?: Buffer[] } | undefined
>

/**
* Parses a .docx file
Expand Down

0 comments on commit ddc245c

Please sign in to comment.