Skip to content

Commit

Permalink
fix: Second try, BaseReader fixed in IngestionPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
KindOfAScam committed May 4, 2024
1 parent cb2b673 commit 3c0f03e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/core/src/ingestion/IngestionPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ export class IngestionPipeline {
inputNodes.push(this.documents);
}
if (this.reader) {
inputNodes.push(await this.reader.loadData());
try {
const loadedData = await this.reader.loadData();
if (Array.isArray(loadedData)) {
inputNodes.push(loadedData.flat()); // Ensure flat structure
} else {
inputNodes.push([loadedData]);
}
} catch (error) {
console.error(`Error loading data: ${error}`);
}
}
return inputNodes.flat();
}
Expand Down

0 comments on commit 3c0f03e

Please sign in to comment.