|
9 | 9 | import static org.opensearch.ml.common.CommonValue.TENANT_ID_FIELD; |
10 | 10 | import static org.opensearch.ml.common.CommonValue.VERSION_2_19_0; |
11 | 11 | import static org.opensearch.ml.common.utils.StringUtils.getParameterMap; |
| 12 | +import static org.opensearch.ml.common.CommonValue.VERSION_3_3_0; |
12 | 13 |
|
13 | 14 | import java.io.IOException; |
14 | 15 | import java.time.Instant; |
@@ -109,7 +110,7 @@ public MLAgentUpdateInput(StreamInput in) throws IOException { |
109 | 110 | Version streamInputVersion = in.getVersion(); |
110 | 111 | agentId = in.readString(); |
111 | 112 | name = in.readOptionalString(); |
112 | | - type = in.readOptionalString(); |
| 113 | + type = streamInputVersion.onOrAfter(VERSION_3_3_0) ? in.readOptionalString() : null; |
113 | 114 | description = in.readOptionalString(); |
114 | 115 | llmModelId = in.readOptionalString(); |
115 | 116 | if (in.readBoolean()) { |
@@ -193,7 +194,9 @@ public void writeTo(StreamOutput out) throws IOException { |
193 | 194 | Version streamOutputVersion = out.getVersion(); |
194 | 195 | out.writeString(agentId); |
195 | 196 | out.writeOptionalString(name); |
196 | | - out.writeOptionalString(type); |
| 197 | + if (streamOutputVersion.onOrAfter(VERSION_3_3_0)) { |
| 198 | + out.writeOptionalString(type); |
| 199 | + } |
197 | 200 | out.writeOptionalString(description); |
198 | 201 | out.writeOptionalString(llmModelId); |
199 | 202 | if (llmParameters != null && !llmParameters.isEmpty()) { |
|
0 commit comments