|
8 | 8 | import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; |
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 | +import static org.opensearch.ml.common.CommonValue.VERSION_3_3_0; |
11 | 12 |
|
12 | 13 | import java.io.IOException; |
13 | 14 | import java.time.Instant; |
@@ -108,7 +109,7 @@ public MLAgentUpdateInput(StreamInput in) throws IOException { |
108 | 109 | Version streamInputVersion = in.getVersion(); |
109 | 110 | agentId = in.readString(); |
110 | 111 | name = in.readOptionalString(); |
111 | | - type = in.readOptionalString(); |
| 112 | + type = streamInputVersion.onOrAfter(VERSION_3_3_0) ? in.readOptionalString() : null; |
112 | 113 | description = in.readOptionalString(); |
113 | 114 | llmModelId = in.readOptionalString(); |
114 | 115 | if (in.readBoolean()) { |
@@ -192,7 +193,9 @@ public void writeTo(StreamOutput out) throws IOException { |
192 | 193 | Version streamOutputVersion = out.getVersion(); |
193 | 194 | out.writeString(agentId); |
194 | 195 | out.writeOptionalString(name); |
195 | | - out.writeOptionalString(type); |
| 196 | + if (streamOutputVersion.onOrAfter(VERSION_3_3_0)) { |
| 197 | + out.writeOptionalString(type); |
| 198 | + } |
196 | 199 | out.writeOptionalString(description); |
197 | 200 | out.writeOptionalString(llmModelId); |
198 | 201 | if (llmParameters != null && !llmParameters.isEmpty()) { |
|
0 commit comments