|
19 | 19 | import com.sap.ai.sdk.grounding.model.DocumentKeyValueListPair; |
20 | 20 | import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; |
21 | 21 | import com.sap.ai.sdk.grounding.model.EmbeddingConfig; |
| 22 | +import com.sap.ai.sdk.grounding.model.GetPipeline; |
22 | 23 | import com.sap.ai.sdk.grounding.model.KeyValueListPair; |
| 24 | +import com.sap.ai.sdk.grounding.model.MSSharePointPipelineGetResponse; |
23 | 25 | import com.sap.ai.sdk.grounding.model.RetrievalSearchFilter; |
24 | 26 | import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; |
| 27 | +import com.sap.ai.sdk.grounding.model.S3PipelineGetResponse; |
| 28 | +import com.sap.ai.sdk.grounding.model.SFTPPipelineGetResponse; |
25 | 29 | import com.sap.ai.sdk.grounding.model.SearchConfiguration; |
26 | 30 | import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; |
27 | 31 | import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; |
@@ -63,8 +67,15 @@ Object getAllPipelines( |
63 | 67 | if ("json".equals(format)) { |
64 | 68 | return pipelines; |
65 | 69 | } |
66 | | - final var ids = List.of(); |
67 | | - // pipelines.getResources().stream().map(getPipeline::getId).collect(joining(", ")); |
| 70 | + final var ids = new ArrayList<>(); |
| 71 | + for (GetPipeline resource : pipelines.getResources()) { |
| 72 | + switch (resource.getType().toString()) { |
| 73 | + case "MSSharePoint" -> ids.add(((MSSharePointPipelineGetResponse) resource).getId()); |
| 74 | + case "S3" -> ids.add(((S3PipelineGetResponse) resource).getId()); |
| 75 | + case "SFTP" -> ids.add(((SFTPPipelineGetResponse) resource).getId()); |
| 76 | + default -> log.warn("Unknown pipeline type: {}", resource.getType()); |
| 77 | + } |
| 78 | + } |
68 | 79 | return "Found pipelines with ids: " + ids; |
69 | 80 | } |
70 | 81 |
|
|
0 commit comments