From 6ff84c16a04ea32865c2976c7141cf9e44ef8897 Mon Sep 17 00:00:00 2001 From: qianheng Date: Sat, 20 Jul 2024 01:00:21 +0800 Subject: [PATCH] remove java21 API for backporting to 2.x (#2682) Signed-off-by: Heng Qian --- .../main/java/org/opensearch/ml/engine/tools/MLModelTool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/tools/MLModelTool.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/tools/MLModelTool.java index e943ea0ebc..1bcf6c9ef0 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/tools/MLModelTool.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/tools/MLModelTool.java @@ -69,7 +69,7 @@ public MLModelTool(Client client, String modelId, String responseField) { outputParser = o -> { try { List mlModelOutputs = (List) o; - Map dataAsMap = mlModelOutputs.getFirst().getMlModelTensors().getFirst().getDataAsMap(); + Map dataAsMap = mlModelOutputs.get(0).getMlModelTensors().get(0).getDataAsMap(); // Return the response field if it exists, otherwise return the whole response as json string. if (dataAsMap.containsKey(responseField)) { return dataAsMap.get(responseField);