feat(core): improve read tool parity (#39126)
This commit is contained in:
parent
7d4de3d9e4
commit
65d2a4e00c
7 changed files with 97 additions and 13 deletions
|
|
@ -115,4 +115,21 @@ describe("ReadToolFileSystem", () => {
|
|||
)
|
||||
}),
|
||||
)
|
||||
|
||||
it.effect("reads PDFs as bounded media", () =>
|
||||
Effect.gen(function* () {
|
||||
const { fs, files, directory } = yield* fixture
|
||||
const file = path.join(directory, "document.pdf")
|
||||
yield* files.writeFileString(file, "%PDF-1.7\ncontent")
|
||||
|
||||
const result = yield* ReadToolFileSystem.read(fs, file, "document.pdf")
|
||||
|
||||
expect(result).toMatchObject({
|
||||
type: "file",
|
||||
content: Buffer.from("%PDF-1.7\ncontent").toString("base64"),
|
||||
encoding: "base64",
|
||||
mime: "application/pdf",
|
||||
})
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue