Skip to content

Commit

Permalink
remove java21 API for backporting to 2.x (#2682)
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws authored Jul 19, 2024
1 parent 2062a7a commit 6ff84c1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public MLModelTool(Client client, String modelId, String responseField) {
outputParser = o -> {
try {
List<ModelTensors> mlModelOutputs = (List<ModelTensors>) o;
Map<String, ?> dataAsMap = mlModelOutputs.getFirst().getMlModelTensors().getFirst().getDataAsMap();
Map<String, ?> 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);
Expand Down

0 comments on commit 6ff84c1

Please sign in to comment.