diff --git a/packages/core/src/ingestion/IngestionPipeline.ts b/packages/core/src/ingestion/IngestionPipeline.ts index 775f1712359b828cd5b0f2ca36f27d0eb89f73c0..d93867ce24cf6fbf0b03767a51092aa613389cb6 100644 --- a/packages/core/src/ingestion/IngestionPipeline.ts +++ b/packages/core/src/ingestion/IngestionPipeline.ts @@ -94,20 +94,20 @@ export class IngestionPipeline { documents?: Document[], nodes?: BaseNode[], ): Promise<BaseNode[]> { - const inputNodes: BaseNode[] = []; + const inputNodes: BaseNode[][] = []; if (documents) { - inputNodes.push(...documents); + inputNodes.push(documents); } if (nodes) { - inputNodes.push(...nodes); + inputNodes.push(nodes); } if (this.documents) { - inputNodes.push(...this.documents); + inputNodes.push(this.documents); } if (this.reader) { - inputNodes.push(...(await this.reader.loadData())); + inputNodes.push(await this.reader.loadData()); } - return inputNodes; + return inputNodes.flat(); } async run(