diff --git a/common/src/main/java/org/opensearch/ml/common/connector/functions/postprocess/BedrockBatchJobArnPostProcessFunction.java b/common/src/main/java/org/opensearch/ml/common/connector/functions/postprocess/BedrockBatchJobArnPostProcessFunction.java index 3b42f1c089..7ecaf15f32 100644 --- a/common/src/main/java/org/opensearch/ml/common/connector/functions/postprocess/BedrockBatchJobArnPostProcessFunction.java +++ b/common/src/main/java/org/opensearch/ml/common/connector/functions/postprocess/BedrockBatchJobArnPostProcessFunction.java @@ -10,19 +10,20 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; public class BedrockBatchJobArnPostProcessFunction extends ConnectorPostProcessFunction> { @Override public void validate(Object input) { - if (!(input instanceof List)) { - throw new IllegalArgumentException("Post process function input is not a List."); + if (!(input instanceof Map)) { + throw new IllegalArgumentException("Post process function input is not a Map."); } - List outerList = (List) input; + Map jobInfo = (Map) input; - if (!outerList.isEmpty() && !(((List) input).get(0) instanceof Number)) { - throw new IllegalArgumentException("The embedding should be a non-empty List containing Float values."); + if (!(jobInfo.containsKey("jobArn"))) { + throw new IllegalArgumentException("Bedrock batch job arn missing."); } }