Skip to content

Commit 81b5d0b

Browse files
committed
fix File class issue on node 18
1 parent 43175bb commit 81b5d0b

File tree

1 file changed

+4
-3
lines changed
  • templates/components/vectordbs/typescript/llamacloud

1 file changed

+4
-3
lines changed

templates/components/vectordbs/typescript/llamacloud/generate.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ async function loadAndIndex() {
3232
for await (const filePath of walk(DATA_DIR)) {
3333
const buffer = await fs.readFile(filePath);
3434
const filename = path.basename(filePath);
35-
const file = new File([buffer], filename);
36-
await LLamaCloudFileService.addFileToPipeline(projectId, pipelineId, file, {
37-
private: "false",
35+
const blob = new Blob([buffer], { type: "application/octet-stream" });
36+
await LLamaCloudFileService.addFileToPipeline(projectId, pipelineId, blob, {
37+
private: false,
38+
filename: filename,
3839
});
3940
}
4041

0 commit comments

Comments
 (0)