diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java index 98672841d7..37b58b84ff 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java @@ -9,6 +9,7 @@ import lombok.Builder; import lombok.Getter; import lombok.experimental.FieldDefaults; +import org.opensearch.Version; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.ml.common.annotation.InputDataSet; @@ -28,6 +29,8 @@ public class TextDocsInputDataSet extends MLInputDataset{ private List docs; + private static final Version MINIMAL_SUPPORTED_VERSION_FOR_MULTI_MODAL = Version.V_2_11_0; + @Builder(toBuilder = true) public TextDocsInputDataSet(List docs, ModelResultFilter resultFilter) { super(MLInputDataType.TEXT_DOCS); @@ -41,10 +44,15 @@ public TextDocsInputDataSet(List docs, ModelResultFilter resultFilter) { public TextDocsInputDataSet(StreamInput streamInput) throws IOException { super(MLInputDataType.TEXT_DOCS); - docs = new ArrayList<>(); - int size = streamInput.readInt(); - for (int i=0; i(); + int size = streamInput.readInt(); + for (int i=0; i