From 1115f83b8f360d04a79655916e694416d6a44438 Mon Sep 17 00:00:00 2001 From: Emanuel Ferreira <contatoferreirads@gmail.com> Date: Thu, 28 Mar 2024 15:31:18 -0300 Subject: [PATCH] fix: pipeline not found (#672) --- .changeset/long-mirrors-battle.md | 5 +++++ packages/core/src/cloud/LlamaCloudRetriever.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/long-mirrors-battle.md diff --git a/.changeset/long-mirrors-battle.md b/.changeset/long-mirrors-battle.md new file mode 100644 index 000000000..20e6370b1 --- /dev/null +++ b/.changeset/long-mirrors-battle.md @@ -0,0 +1,5 @@ +--- +"llamaindex": patch +--- + +fix: throw error when no pipelines exist for the retriever diff --git a/packages/core/src/cloud/LlamaCloudRetriever.ts b/packages/core/src/cloud/LlamaCloudRetriever.ts index 05f94f3ab..dc4147852 100644 --- a/packages/core/src/cloud/LlamaCloudRetriever.ts +++ b/packages/core/src/cloud/LlamaCloudRetriever.ts @@ -65,7 +65,7 @@ export class LlamaCloudRetriever implements BaseRetriever { projectName: this.projectName, pipelineName: this.pipelineName, }); - if (pipelines.length !== 1 && !pipelines[0].id) { + if (pipelines.length !== 1 && !pipelines[0]?.id) { throw new Error( `No pipeline found with name ${this.pipelineName} in project ${this.projectName}`, ); -- GitLab