Skip to content

Commit

Permalink
fix: only download when file length > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
thucpn committed Jul 19, 2024
1 parent 6bdffd2 commit e736814
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ interface LlamaCloudFile {

export class LLamaCloudFileService {
public static async downloadFiles(nodes: NodeWithScore<Metadata>[]) {
console.log("Downloading files from LlamaCloud...");
const files = this.nodesToDownloadFiles(nodes);
if (!files.length) return;
console.log("Downloading files from LlamaCloud...");
for (const file of files) {
await this.downloadFile(file.pipelineId, file.fileName);
}
Expand Down

0 comments on commit e736814

Please sign in to comment.