Skip to content
Snippets Groups Projects
Unverified Commit fe08d045 authored by Marcus Schiesser's avatar Marcus Schiesser Committed by GitHub
Browse files

fix: llamacloud retrieval with multiple pipelines (#1309)

parent 59c5e5c3
No related branches found
No related tags found
No related merge requests found
---
"llamaindex": patch
---
Fix LlamaCloud retrieval with multiple pipelines
...@@ -61,7 +61,7 @@ export class LlamaCloudRetriever extends BaseRetriever { ...@@ -61,7 +61,7 @@ export class LlamaCloudRetriever extends BaseRetriever {
await PipelinesService.searchPipelinesApiV1PipelinesGet({ await PipelinesService.searchPipelinesApiV1PipelinesGet({
query: { query: {
project_id: await getProjectId(this.projectName, this.organizationId), project_id: await getProjectId(this.projectName, this.organizationId),
project_name: this.pipelineName, pipeline_name: this.pipelineName,
}, },
throwOnError: true, throwOnError: true,
}); });
...@@ -72,25 +72,11 @@ export class LlamaCloudRetriever extends BaseRetriever { ...@@ -72,25 +72,11 @@ export class LlamaCloudRetriever extends BaseRetriever {
); );
} }
const { data: pipeline } =
await PipelinesService.getPipelineApiV1PipelinesPipelineIdGet({
path: {
pipeline_id: pipelines[0]!.id,
},
throwOnError: true,
});
if (!pipeline) {
throw new Error(
`No pipeline found with name ${this.pipelineName} in project ${this.projectName}`,
);
}
const { data: results } = const { data: results } =
await PipelinesService.runSearchApiV1PipelinesPipelineIdRetrievePost({ await PipelinesService.runSearchApiV1PipelinesPipelineIdRetrievePost({
throwOnError: true, throwOnError: true,
path: { path: {
pipeline_id: pipeline.id, pipeline_id: pipelines[0]!.id,
}, },
body: { body: {
...this.retrieveParams, ...this.retrieveParams,
......
...@@ -40,9 +40,9 @@ export async function getProjectId( ...@@ -40,9 +40,9 @@ export async function getProjectId(
): Promise<string> { ): Promise<string> {
const { data: projects } = await ProjectsService.listProjectsApiV1ProjectsGet( const { data: projects } = await ProjectsService.listProjectsApiV1ProjectsGet(
{ {
path: { query: {
project_name: projectName, project_name: projectName,
organization_id: organizationId, organization_id: organizationId ?? null,
}, },
throwOnError: true, throwOnError: true,
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment