From b4eccee1431bfe9950eb01b37f183e7435c6130a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 00:07:26 +0000 Subject: [PATCH] Re-generate client code using latest OpenSearch API specification (2026-01-12) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko --- .../client/opensearch/ml/ActionType.java | 44 + .../ml/AddAgenticMemoryRequest.java | 609 +++++++++++ .../ml/AddAgenticMemoryResponse.java | 210 ++++ .../client/opensearch/ml/Content.java | 249 +++++ .../ml/CreateMemoryContainerRequest.java | 278 +++++ .../ml/CreateMemoryContainerResponse.java | 200 ++++ .../CreateMemoryContainerSessionRequest.java | 400 +++++++ .../CreateMemoryContainerSessionResponse.java | 214 ++++ .../ml/DeleteAgenticMemoryQueryRequest.java | 279 +++++ .../ml/DeleteAgenticMemoryQueryResponse.java | 767 ++++++++++++++ .../ml/DeleteAgenticMemoryRequest.java | 225 ++++ .../ml/DeleteAgenticMemoryResponse.java | 132 +++ .../ml/DeleteMemoryContainerRequest.java | 258 +++++ .../ml/DeleteMemoryContainerResponse.java | 132 +++ .../opensearch/ml/ExecuteToolRequest.java | 258 +++++ .../opensearch/ml/ExecuteToolResponse.java | 198 ++++ .../ml/GetAgenticMemoryRequest.java | 221 ++++ .../ml/GetAgenticMemoryResponse.java | 982 ++++++++++++++++++ .../ml/GetMemoryContainerRequest.java | 169 +++ .../ml/GetMemoryContainerResponse.java | 367 +++++++ .../opensearch/ml/GetMessageResponse.java | 106 ++ .../client/opensearch/ml/Index.java | 261 +++++ .../client/opensearch/ml/IndexSettings.java | 347 +++++++ .../ml/MemoryContainerConfiguration.java | 652 ++++++++++++ .../opensearch/ml/MemoryIndexSettings.java | 171 +++ .../client/opensearch/ml/MemoryType.java | 43 + .../client/opensearch/ml/Message.java | 106 ++ .../ml/OpenSearchMlAsyncClient.java | 230 ++++ .../opensearch/ml/OpenSearchMlClient.java | 224 ++++ .../client/opensearch/ml/Output.java | 25 +- .../client/opensearch/ml/Owner.java | 41 +- .../client/opensearch/ml/PayloadType.java | 42 + .../client/opensearch/ml/Strategy.java | 347 +++++++ .../opensearch/ml/StrategyConfiguration.java | 250 +++++ .../client/opensearch/ml/StrategyType.java | 44 + .../client/opensearch/ml/ToolName.java | 8 +- .../ml/UpdateAgenticMemoryRequest.java | 739 +++++++++++++ .../ml/UpdateAgenticMemoryResponse.java | 132 +++ .../ml/UpdateMemoryContainerRequest.java | 315 ++++++ .../ml/UpdateMemoryContainerResponse.java | 132 +++ java-codegen/opensearch-openapi.yaml | 936 ++++++++++++++++- .../client/codegen/CodeGenerator.java | 2 + 42 files changed, 11330 insertions(+), 15 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ActionType.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Content.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Index.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/IndexSettings.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryContainerConfiguration.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryIndexSettings.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryType.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/PayloadType.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Strategy.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyConfiguration.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyType.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerResponse.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ActionType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ActionType.java new file mode 100644 index 0000000000..c9b660d234 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ActionType.java @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: ml.ActionType + +/** + * The type of operation. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum ActionType implements JsonEnum { + Add("ADD"), + + Delete("DELETE"), + + Update("UPDATE"); + + private final String jsonValue; + + ActionType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(ActionType.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryRequest.java new file mode 100644 index 0000000000..f9985228f1 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryRequest.java @@ -0,0 +1,609 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.add_agentic_memory.Request + +/** + * Add agentic memory to a memory container. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class AddAgenticMemoryRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String binaryData; + + @Nullable + private final Boolean infer; + + @Nonnull + private final String memoryContainerId; + + @Nonnull + private final List messages; + + @Nonnull + private final Map metadata; + + @Nonnull + private final Map namespace; + + @Nullable + private final String payloadType; + + @Nonnull + private final Map structuredData; + + @Nonnull + private final Map tags; + + // --------------------------------------------------------------------------------------------- + + private AddAgenticMemoryRequest(Builder builder) { + super(builder); + this.binaryData = builder.binaryData; + this.infer = builder.infer; + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.messages = ApiTypeHelper.unmodifiable(builder.messages); + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.namespace = ApiTypeHelper.unmodifiable(builder.namespace); + this.payloadType = builder.payloadType; + this.structuredData = ApiTypeHelper.unmodifiable(builder.structuredData); + this.tags = ApiTypeHelper.unmodifiable(builder.tags); + } + + public static AddAgenticMemoryRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Binary data content encoded as Base64 string. + *

+ * API name: {@code binary_data} + *

+ */ + @Nullable + public final String binaryData() { + return this.binaryData; + } + + /** + * Whether to use LLM to extract key information. + *

+ * API name: {@code infer} + *

+ */ + @Nullable + public final Boolean infer() { + return this.infer; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code messages} + */ + @Nonnull + public final List messages() { + return this.messages; + } + + /** + * API name: {@code metadata} + */ + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code namespace} + */ + @Nonnull + public final Map namespace() { + return this.namespace; + } + + /** + * The type of payload. + *

+ * API name: {@code payload_type} + *

+ */ + @Nullable + public final String payloadType() { + return this.payloadType; + } + + /** + * API name: {@code structured_data} + */ + @Nonnull + public final Map structuredData() { + return this.structuredData; + } + + /** + * API name: {@code tags} + */ + @Nonnull + public final Map tags() { + return this.tags; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.binaryData != null) { + generator.writeKey("binary_data"); + generator.write(this.binaryData); + } + + if (this.infer != null) { + generator.writeKey("infer"); + generator.write(this.infer); + } + + if (ApiTypeHelper.isDefined(this.messages)) { + generator.writeKey("messages"); + generator.writeStartArray(); + for (Message item0 : this.messages) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.metadata)) { + generator.writeKey("metadata"); + generator.writeStartObject(); + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.namespace)) { + generator.writeKey("namespace"); + generator.writeStartObject(); + for (Map.Entry item0 : this.namespace.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.payloadType != null) { + generator.writeKey("payload_type"); + generator.write(this.payloadType); + } + + if (ApiTypeHelper.isDefined(this.structuredData)) { + generator.writeKey("structured_data"); + generator.writeStartObject(); + for (Map.Entry item0 : this.structuredData.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.tags)) { + generator.writeKey("tags"); + generator.writeStartObject(); + for (Map.Entry item0 : this.tags.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link AddAgenticMemoryRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private String binaryData; + @Nullable + private Boolean infer; + private String memoryContainerId; + @Nullable + private List messages; + @Nullable + private Map metadata; + @Nullable + private Map namespace; + @Nullable + private String payloadType; + @Nullable + private Map structuredData; + @Nullable + private Map tags; + + public Builder() {} + + private Builder(AddAgenticMemoryRequest o) { + super(o); + this.binaryData = o.binaryData; + this.infer = o.infer; + this.memoryContainerId = o.memoryContainerId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.payloadType = o.payloadType; + this.structuredData = _mapCopy(o.structuredData); + this.tags = _mapCopy(o.tags); + } + + private Builder(Builder o) { + super(o); + this.binaryData = o.binaryData; + this.infer = o.infer; + this.memoryContainerId = o.memoryContainerId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.payloadType = o.payloadType; + this.structuredData = _mapCopy(o.structuredData); + this.tags = _mapCopy(o.tags); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Binary data content encoded as Base64 string. + *

+ * API name: {@code binary_data} + *

+ */ + @Nonnull + public final Builder binaryData(@Nullable String value) { + this.binaryData = value; + return this; + } + + /** + * Whether to use LLM to extract key information. + *

+ * API name: {@code infer} + *

+ */ + @Nonnull + public final Builder infer(@Nullable Boolean value) { + this.infer = value; + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds all elements of list to messages. + *

+ */ + @Nonnull + public final Builder messages(List list) { + this.messages = _listAddAll(this.messages, list); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds one or more values to messages. + *

+ */ + @Nonnull + public final Builder messages(Message value, Message... values) { + this.messages = _listAdd(this.messages, value, values); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds a value to messages using a builder lambda. + *

+ */ + @Nonnull + public final Builder messages(Function> fn) { + return messages(fn.apply(new Message.Builder()).build()); + } + + /** + * API name: {@code metadata} + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * API name: {@code metadata} + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds all elements of map to namespace. + *

+ */ + @Nonnull + public final Builder namespace(Map map) { + this.namespace = _mapPutAll(this.namespace, map); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds an entry to namespace. + *

+ */ + @Nonnull + public final Builder namespace(String key, JsonData value) { + this.namespace = _mapPut(this.namespace, key, value); + return this; + } + + /** + * The type of payload. + *

+ * API name: {@code payload_type} + *

+ */ + @Nonnull + public final Builder payloadType(@Nullable String value) { + this.payloadType = value; + return this; + } + + /** + * API name: {@code structured_data} + * + *

+ * Adds all elements of map to structuredData. + *

+ */ + @Nonnull + public final Builder structuredData(Map map) { + this.structuredData = _mapPutAll(this.structuredData, map); + return this; + } + + /** + * API name: {@code structured_data} + * + *

+ * Adds an entry to structuredData. + *

+ */ + @Nonnull + public final Builder structuredData(String key, JsonData value) { + this.structuredData = _mapPut(this.structuredData, key, value); + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds all elements of map to tags. + *

+ */ + @Nonnull + public final Builder tags(Map map) { + this.tags = _mapPutAll(this.tags, map); + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds an entry to tags. + *

+ */ + @Nonnull + public final Builder tags(String key, JsonData value) { + this.tags = _mapPut(this.tags, key, value); + return this; + } + + /** + * Builds a {@link AddAgenticMemoryRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public AddAgenticMemoryRequest build() { + _checkSingleUse(); + + return new AddAgenticMemoryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AddAgenticMemoryRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + AddAgenticMemoryRequest::setupAddAgenticMemoryRequestDeserializer + ); + + protected static void setupAddAgenticMemoryRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::binaryData, JsonpDeserializer.stringDeserializer(), "binary_data"); + op.add(Builder::infer, JsonpDeserializer.booleanDeserializer(), "infer"); + op.add(Builder::messages, JsonpDeserializer.arrayDeserializer(Message._DESERIALIZER), "messages"); + op.add(Builder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); + op.add(Builder::namespace, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "namespace"); + op.add(Builder::payloadType, JsonpDeserializer.stringDeserializer(), "payload_type"); + op.add(Builder::structuredData, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "structured_data"); + op.add(Builder::tags, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "tags"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.add_agentic_memory}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories"); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + AddAgenticMemoryResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.binaryData); + result = 31 * result + Objects.hashCode(this.infer); + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + Objects.hashCode(this.messages); + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.namespace); + result = 31 * result + Objects.hashCode(this.payloadType); + result = 31 * result + Objects.hashCode(this.structuredData); + result = 31 * result + Objects.hashCode(this.tags); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AddAgenticMemoryRequest other = (AddAgenticMemoryRequest) o; + return Objects.equals(this.binaryData, other.binaryData) + && Objects.equals(this.infer, other.infer) + && this.memoryContainerId.equals(other.memoryContainerId) + && Objects.equals(this.messages, other.messages) + && Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.namespace, other.namespace) + && Objects.equals(this.payloadType, other.payloadType) + && Objects.equals(this.structuredData, other.structuredData) + && Objects.equals(this.tags, other.tags); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryResponse.java new file mode 100644 index 0000000000..a77e59e776 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/AddAgenticMemoryResponse.java @@ -0,0 +1,210 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.add_agentic_memory.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AddAgenticMemoryResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String sessionId; + + @Nullable + private final String workingMemoryId; + + // --------------------------------------------------------------------------------------------- + + private AddAgenticMemoryResponse(Builder builder) { + this.sessionId = builder.sessionId; + this.workingMemoryId = builder.workingMemoryId; + } + + public static AddAgenticMemoryResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Session ID associated with the memory. + *

+ * API name: {@code session_id} + *

+ */ + @Nullable + public final String sessionId() { + return this.sessionId; + } + + /** + * The ID for the creating working memory entry. + *

+ * API name: {@code working_memory_id} + *

+ */ + @Nullable + public final String workingMemoryId() { + return this.workingMemoryId; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.sessionId != null) { + generator.writeKey("session_id"); + generator.write(this.sessionId); + } + + if (this.workingMemoryId != null) { + generator.writeKey("working_memory_id"); + generator.write(this.workingMemoryId); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link AddAgenticMemoryResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String sessionId; + @Nullable + private String workingMemoryId; + + public Builder() {} + + private Builder(AddAgenticMemoryResponse o) { + this.sessionId = o.sessionId; + this.workingMemoryId = o.workingMemoryId; + } + + private Builder(Builder o) { + this.sessionId = o.sessionId; + this.workingMemoryId = o.workingMemoryId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Session ID associated with the memory. + *

+ * API name: {@code session_id} + *

+ */ + @Nonnull + public final Builder sessionId(@Nullable String value) { + this.sessionId = value; + return this; + } + + /** + * The ID for the creating working memory entry. + *

+ * API name: {@code working_memory_id} + *

+ */ + @Nonnull + public final Builder workingMemoryId(@Nullable String value) { + this.workingMemoryId = value; + return this; + } + + /** + * Builds a {@link AddAgenticMemoryResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public AddAgenticMemoryResponse build() { + _checkSingleUse(); + + return new AddAgenticMemoryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AddAgenticMemoryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + AddAgenticMemoryResponse::setupAddAgenticMemoryResponseDeserializer + ); + + protected static void setupAddAgenticMemoryResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::sessionId, JsonpDeserializer.stringDeserializer(), "session_id"); + op.add(Builder::workingMemoryId, JsonpDeserializer.stringDeserializer(), "working_memory_id"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.sessionId); + result = 31 * result + Objects.hashCode(this.workingMemoryId); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AddAgenticMemoryResponse other = (AddAgenticMemoryResponse) o; + return Objects.equals(this.sessionId, other.sessionId) && Objects.equals(this.workingMemoryId, other.workingMemoryId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Content.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Content.java new file mode 100644 index 0000000000..21acc3a541 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Content.java @@ -0,0 +1,249 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.Content + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Content implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Map metadata; + + @Nullable + private final String text; + + @Nullable + private final String type; + + // --------------------------------------------------------------------------------------------- + + private Content(Builder builder) { + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.text = builder.text; + this.type = builder.type; + } + + public static Content of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code text} + */ + @Nullable + public final String text() { + return this.text; + } + + /** + * API name: {@code type} + */ + @Nullable + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.text != null) { + generator.writeKey("text"); + generator.write(this.text); + } + + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Content}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map metadata; + @Nullable + private String text; + @Nullable + private String type; + + public Builder() {} + + private Builder(Content o) { + this.metadata = _mapCopy(o.metadata); + this.text = o.text; + this.type = o.type; + } + + private Builder(Builder o) { + this.metadata = _mapCopy(o.metadata); + this.text = o.text; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code text} + */ + @Nonnull + public final Builder text(@Nullable String value) { + this.text = value; + return this; + } + + /** + * API name: {@code type} + */ + @Nonnull + public final Builder type(@Nullable String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link Content}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Content build() { + _checkSingleUse(); + + return new Content(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Content} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Content::setupContentDeserializer + ); + + protected static void setupContentDeserializer(ObjectDeserializer op) { + op.add(Builder::text, JsonpDeserializer.stringDeserializer(), "text"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.text); + result = 31 * result + Objects.hashCode(this.type); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Content other = (Content) o; + return Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.text, other.text) + && Objects.equals(this.type, other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerRequest.java new file mode 100644 index 0000000000..94f722bb1e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerRequest.java @@ -0,0 +1,278 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.create_memory_container.Request + +/** + * Create a memory container. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class CreateMemoryContainerRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final MemoryContainerConfiguration configuration; + + @Nullable + private final String description; + + @Nonnull + private final String name; + + // --------------------------------------------------------------------------------------------- + + private CreateMemoryContainerRequest(Builder builder) { + super(builder); + this.configuration = ApiTypeHelper.requireNonNull(builder.configuration, this, "configuration"); + this.description = builder.description; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + } + + public static CreateMemoryContainerRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code configuration} + */ + @Nonnull + public final MemoryContainerConfiguration configuration() { + return this.configuration; + } + + /** + * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final String name() { + return this.name; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("configuration"); + this.configuration.serialize(generator, mapper); + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + + generator.writeKey("name"); + generator.write(this.name); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link CreateMemoryContainerRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + private MemoryContainerConfiguration configuration; + @Nullable + private String description; + private String name; + + public Builder() {} + + private Builder(CreateMemoryContainerRequest o) { + super(o); + this.configuration = o.configuration; + this.description = o.description; + this.name = o.name; + } + + private Builder(Builder o) { + super(o); + this.configuration = o.configuration; + this.description = o.description; + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(MemoryContainerConfiguration value) { + this.configuration = value; + return this; + } + + /** + * Required - API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(Function> fn) { + return configuration(fn.apply(new MemoryContainerConfiguration.Builder()).build()); + } + + /** + * API name: {@code description} + */ + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Builds a {@link CreateMemoryContainerRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public CreateMemoryContainerRequest build() { + _checkSingleUse(); + + return new CreateMemoryContainerRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateMemoryContainerRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateMemoryContainerRequest::setupCreateMemoryContainerRequestDeserializer + ); + + protected static void setupCreateMemoryContainerRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::configuration, MemoryContainerConfiguration._DESERIALIZER, "configuration"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.create_memory_container}". + */ + public static final Endpoint _ENDPOINT = + new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_ml/memory_containers/_create", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + CreateMemoryContainerResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.configuration.hashCode(); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + this.name.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CreateMemoryContainerRequest other = (CreateMemoryContainerRequest) o; + return this.configuration.equals(other.configuration) + && Objects.equals(this.description, other.description) + && this.name.equals(other.name); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerResponse.java new file mode 100644 index 0000000000..7adabc3357 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerResponse.java @@ -0,0 +1,200 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.create_memory_container.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CreateMemoryContainerResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String memoryContainerId; + + @Nullable + private final String status; + + // --------------------------------------------------------------------------------------------- + + private CreateMemoryContainerResponse(Builder builder) { + this.memoryContainerId = builder.memoryContainerId; + this.status = builder.status; + } + + public static CreateMemoryContainerResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code memory_container_id} + */ + @Nullable + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code status} + */ + @Nullable + public final String status() { + return this.status; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.memoryContainerId != null) { + generator.writeKey("memory_container_id"); + generator.write(this.memoryContainerId); + } + + if (this.status != null) { + generator.writeKey("status"); + generator.write(this.status); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link CreateMemoryContainerResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String memoryContainerId; + @Nullable + private String status; + + public Builder() {} + + private Builder(CreateMemoryContainerResponse o) { + this.memoryContainerId = o.memoryContainerId; + this.status = o.status; + } + + private Builder(Builder o) { + this.memoryContainerId = o.memoryContainerId; + this.status = o.status; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(@Nullable String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code status} + */ + @Nonnull + public final Builder status(@Nullable String value) { + this.status = value; + return this; + } + + /** + * Builds a {@link CreateMemoryContainerResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public CreateMemoryContainerResponse build() { + _checkSingleUse(); + + return new CreateMemoryContainerResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateMemoryContainerResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateMemoryContainerResponse::setupCreateMemoryContainerResponseDeserializer + ); + + protected static void setupCreateMemoryContainerResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::memoryContainerId, JsonpDeserializer.stringDeserializer(), "memory_container_id"); + op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.memoryContainerId); + result = 31 * result + Objects.hashCode(this.status); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CreateMemoryContainerResponse other = (CreateMemoryContainerResponse) o; + return Objects.equals(this.memoryContainerId, other.memoryContainerId) && Objects.equals(this.status, other.status); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionRequest.java new file mode 100644 index 0000000000..d85fa7c4d7 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionRequest.java @@ -0,0 +1,400 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.create_memory_container_session.Request + +/** + * Create session in a memory container. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class CreateMemoryContainerSessionRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final String memoryContainerId; + + @Nonnull + private final Map metadata; + + @Nonnull + private final Map namespace; + + @Nullable + private final String sessionId; + + @Nullable + private final String summary; + + // --------------------------------------------------------------------------------------------- + + private CreateMemoryContainerSessionRequest(Builder builder) { + super(builder); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.namespace = ApiTypeHelper.unmodifiable(builder.namespace); + this.sessionId = builder.sessionId; + this.summary = builder.summary; + } + + public static CreateMemoryContainerSessionRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code metadata} + */ + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code namespace} + */ + @Nonnull + public final Map namespace() { + return this.namespace; + } + + /** + * Custom session ID. + *

+ * API name: {@code session_id} + *

+ */ + @Nullable + public final String sessionId() { + return this.sessionId; + } + + /** + * Session summary or description. + *

+ * API name: {@code summary} + *

+ */ + @Nullable + public final String summary() { + return this.summary; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.metadata)) { + generator.writeKey("metadata"); + generator.writeStartObject(); + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.namespace)) { + generator.writeKey("namespace"); + generator.writeStartObject(); + for (Map.Entry item0 : this.namespace.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.sessionId != null) { + generator.writeKey("session_id"); + generator.write(this.sessionId); + } + + if (this.summary != null) { + generator.writeKey("summary"); + generator.write(this.summary); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link CreateMemoryContainerSessionRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + private String memoryContainerId; + @Nullable + private Map metadata; + @Nullable + private Map namespace; + @Nullable + private String sessionId; + @Nullable + private String summary; + + public Builder() {} + + private Builder(CreateMemoryContainerSessionRequest o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.sessionId = o.sessionId; + this.summary = o.summary; + } + + private Builder(Builder o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.sessionId = o.sessionId; + this.summary = o.summary; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code metadata} + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * API name: {@code metadata} + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds all elements of map to namespace. + *

+ */ + @Nonnull + public final Builder namespace(Map map) { + this.namespace = _mapPutAll(this.namespace, map); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds an entry to namespace. + *

+ */ + @Nonnull + public final Builder namespace(String key, JsonData value) { + this.namespace = _mapPut(this.namespace, key, value); + return this; + } + + /** + * Custom session ID. + *

+ * API name: {@code session_id} + *

+ */ + @Nonnull + public final Builder sessionId(@Nullable String value) { + this.sessionId = value; + return this; + } + + /** + * Session summary or description. + *

+ * API name: {@code summary} + *

+ */ + @Nonnull + public final Builder summary(@Nullable String value) { + this.summary = value; + return this; + } + + /** + * Builds a {@link CreateMemoryContainerSessionRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public CreateMemoryContainerSessionRequest build() { + _checkSingleUse(); + + return new CreateMemoryContainerSessionRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateMemoryContainerSessionRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateMemoryContainerSessionRequest::setupCreateMemoryContainerSessionRequestDeserializer + ); + + protected static void setupCreateMemoryContainerSessionRequestDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); + op.add(Builder::namespace, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "namespace"); + op.add(Builder::sessionId, JsonpDeserializer.stringDeserializer(), "session_id"); + op.add(Builder::summary, JsonpDeserializer.stringDeserializer(), "summary"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.create_memory_container_session}". + */ + public static final Endpoint _ENDPOINT = + new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories/sessions"); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + CreateMemoryContainerSessionResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.namespace); + result = 31 * result + Objects.hashCode(this.sessionId); + result = 31 * result + Objects.hashCode(this.summary); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CreateMemoryContainerSessionRequest other = (CreateMemoryContainerSessionRequest) o; + return this.memoryContainerId.equals(other.memoryContainerId) + && Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.namespace, other.namespace) + && Objects.equals(this.sessionId, other.sessionId) + && Objects.equals(this.summary, other.summary); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionResponse.java new file mode 100644 index 0000000000..5891801885 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateMemoryContainerSessionResponse.java @@ -0,0 +1,214 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.create_memory_container_session.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CreateMemoryContainerSessionResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String sessionId; + + @Nullable + private final String status; + + // --------------------------------------------------------------------------------------------- + + private CreateMemoryContainerSessionResponse(Builder builder) { + this.sessionId = builder.sessionId; + this.status = builder.status; + } + + public static CreateMemoryContainerSessionResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The ID of the created session. + *

+ * API name: {@code session_id} + *

+ */ + @Nullable + public final String sessionId() { + return this.sessionId; + } + + /** + * Satus of the creation operation. + *

+ * API name: {@code status} + *

+ */ + @Nullable + public final String status() { + return this.status; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.sessionId != null) { + generator.writeKey("session_id"); + generator.write(this.sessionId); + } + + if (this.status != null) { + generator.writeKey("status"); + generator.write(this.status); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link CreateMemoryContainerSessionResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String sessionId; + @Nullable + private String status; + + public Builder() {} + + private Builder(CreateMemoryContainerSessionResponse o) { + this.sessionId = o.sessionId; + this.status = o.status; + } + + private Builder(Builder o) { + this.sessionId = o.sessionId; + this.status = o.status; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The ID of the created session. + *

+ * API name: {@code session_id} + *

+ */ + @Nonnull + public final Builder sessionId(@Nullable String value) { + this.sessionId = value; + return this; + } + + /** + * Satus of the creation operation. + *

+ * API name: {@code status} + *

+ */ + @Nonnull + public final Builder status(@Nullable String value) { + this.status = value; + return this; + } + + /** + * Builds a {@link CreateMemoryContainerSessionResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public CreateMemoryContainerSessionResponse build() { + _checkSingleUse(); + + return new CreateMemoryContainerSessionResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateMemoryContainerSessionResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CreateMemoryContainerSessionResponse::setupCreateMemoryContainerSessionResponseDeserializer + ); + + protected static void setupCreateMemoryContainerSessionResponseDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::sessionId, JsonpDeserializer.stringDeserializer(), "session_id"); + op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.sessionId); + result = 31 * result + Objects.hashCode(this.status); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CreateMemoryContainerSessionResponse other = (CreateMemoryContainerSessionResponse) o; + return Objects.equals(this.sessionId, other.sessionId) && Objects.equals(this.status, other.status); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryRequest.java new file mode 100644 index 0000000000..5be20816b0 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryRequest.java @@ -0,0 +1,279 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.opensearch._types.query_dsl.Query; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_agentic_memory_query.Request + +/** + * Delete multiple memories using a query to match specific criteria. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class DeleteAgenticMemoryQueryRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final String memoryContainerId; + + @Nullable + private final Query query; + + @Nonnull + private final MemoryType type; + + // --------------------------------------------------------------------------------------------- + + private DeleteAgenticMemoryQueryRequest(Builder builder) { + super(builder); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.query = builder.query; + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static DeleteAgenticMemoryQueryRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final MemoryType type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteAgenticMemoryQueryRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + private String memoryContainerId; + @Nullable + private Query query; + private MemoryType type; + + public Builder() {} + + private Builder(DeleteAgenticMemoryQueryRequest o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + this.query = o.query; + this.type = o.type; + } + + private Builder(Builder o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + this.query = o.query; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(MemoryType value) { + this.type = value; + return this; + } + + /** + * Builds a {@link DeleteAgenticMemoryQueryRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteAgenticMemoryQueryRequest build() { + _checkSingleUse(); + + return new DeleteAgenticMemoryQueryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteAgenticMemoryQueryRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteAgenticMemoryQueryRequest::setupDeleteAgenticMemoryQueryRequestDeserializer + ); + + protected static void setupDeleteAgenticMemoryQueryRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::query, Query._DESERIALIZER, "query"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.delete_agentic_memory_query}". + */ + public static final Endpoint _ENDPOINT = + new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories/"); + SimpleEndpoint.pathEncode(request.type.jsonValue(), buf); + buf.append("/_delete_by_query"); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + DeleteAgenticMemoryQueryResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + Objects.hashCode(this.query); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + DeleteAgenticMemoryQueryRequest other = (DeleteAgenticMemoryQueryRequest) o; + return this.memoryContainerId.equals(other.memoryContainerId) + && Objects.equals(this.query, other.query) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryResponse.java new file mode 100644 index 0000000000..7e48c5a23b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryQueryResponse.java @@ -0,0 +1,767 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.BulkByScrollFailure; +import org.opensearch.client.opensearch._types.Retries; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_agentic_memory_query.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteAgenticMemoryQueryResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long batches; + + @Nullable + private final Long created; + + @Nullable + private final Long deleted; + + @Nonnull + private final List failures; + + @Nullable + private final Long noops; + + @Nullable + private final Float requestsPerSecond; + + @Nullable + private final String result; + + @Nullable + private final Retries retries; + + @Nullable + private final Long throttledMillis; + + @Nullable + private final Long throttledUntilMillis; + + @Nullable + private final Boolean timedOut; + + @Nullable + private final Long took; + + @Nullable + private final Long total; + + @Nullable + private final Long updated; + + @Nullable + private final Long versionConflicts; + + // --------------------------------------------------------------------------------------------- + + private DeleteAgenticMemoryQueryResponse(Builder builder) { + this.batches = builder.batches; + this.created = builder.created; + this.deleted = builder.deleted; + this.failures = ApiTypeHelper.unmodifiable(builder.failures); + this.noops = builder.noops; + this.requestsPerSecond = builder.requestsPerSecond; + this.result = builder.result; + this.retries = builder.retries; + this.throttledMillis = builder.throttledMillis; + this.throttledUntilMillis = builder.throttledUntilMillis; + this.timedOut = builder.timedOut; + this.took = builder.took; + this.total = builder.total; + this.updated = builder.updated; + this.versionConflicts = builder.versionConflicts; + } + + public static DeleteAgenticMemoryQueryResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Number of batches processed. + *

+ * API name: {@code batches} + *

+ */ + @Nullable + public final Long batches() { + return this.batches; + } + + /** + * Number of documents created. + *

+ * API name: {@code created} + *

+ */ + @Nullable + public final Long created() { + return this.created; + } + + /** + * Number of documents deleted. + *

+ * API name: {@code deleted} + *

+ */ + @Nullable + public final Long deleted() { + return this.deleted; + } + + /** + * Any failures occurred during the operation. + *

+ * API name: {@code failures} + *

+ */ + @Nonnull + public final List failures() { + return this.failures; + } + + /** + * Number of no-operation updates. + *

+ * API name: {@code noops} + *

+ */ + @Nullable + public final Long noops() { + return this.noops; + } + + /** + * Number of requests processed per second. + *

+ * API name: {@code requests_per_second} + *

+ */ + @Nullable + public final Float requestsPerSecond() { + return this.requestsPerSecond; + } + + /** + * The result of delete operation. + *

+ * API name: {@code result} + *

+ */ + @Nullable + public final String result() { + return this.result; + } + + /** + * API name: {@code retries} + */ + @Nullable + public final Retries retries() { + return this.retries; + } + + /** + * Time that the request was throttled. + *

+ * API name: {@code throttled_millis} + *

+ */ + @Nullable + public final Long throttledMillis() { + return this.throttledMillis; + } + + /** + * Time until throttling is lifted. + *

+ * API name: {@code throttled_until_millis} + *

+ */ + @Nullable + public final Long throttledUntilMillis() { + return this.throttledUntilMillis; + } + + /** + * Whether the request timed out. + *

+ * API name: {@code timed_out} + *

+ */ + @Nullable + public final Boolean timedOut() { + return this.timedOut; + } + + /** + * Time taken to execute the request. + *

+ * API name: {@code took} + *

+ */ + @Nullable + public final Long took() { + return this.took; + } + + /** + * Total number of documents processed. + *

+ * API name: {@code total} + *

+ */ + @Nullable + public final Long total() { + return this.total; + } + + /** + * Number of documents updated. + *

+ * API name: {@code updated} + *

+ */ + @Nullable + public final Long updated() { + return this.updated; + } + + /** + * Number of version conflicts encountered. + *

+ * API name: {@code version_conflicts} + *

+ */ + @Nullable + public final Long versionConflicts() { + return this.versionConflicts; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.batches != null) { + generator.writeKey("batches"); + generator.write(this.batches); + } + + if (this.created != null) { + generator.writeKey("created"); + generator.write(this.created); + } + + if (this.deleted != null) { + generator.writeKey("deleted"); + generator.write(this.deleted); + } + + if (ApiTypeHelper.isDefined(this.failures)) { + generator.writeKey("failures"); + generator.writeStartArray(); + for (BulkByScrollFailure item0 : this.failures) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.noops != null) { + generator.writeKey("noops"); + generator.write(this.noops); + } + + if (this.requestsPerSecond != null) { + generator.writeKey("requests_per_second"); + generator.write(this.requestsPerSecond); + } + + if (this.result != null) { + generator.writeKey("result"); + generator.write(this.result); + } + + if (this.retries != null) { + generator.writeKey("retries"); + this.retries.serialize(generator, mapper); + } + + if (this.throttledMillis != null) { + generator.writeKey("throttled_millis"); + generator.write(this.throttledMillis); + } + + if (this.throttledUntilMillis != null) { + generator.writeKey("throttled_until_millis"); + generator.write(this.throttledUntilMillis); + } + + if (this.timedOut != null) { + generator.writeKey("timed_out"); + generator.write(this.timedOut); + } + + if (this.took != null) { + generator.writeKey("took"); + generator.write(this.took); + } + + if (this.total != null) { + generator.writeKey("total"); + generator.write(this.total); + } + + if (this.updated != null) { + generator.writeKey("updated"); + generator.write(this.updated); + } + + if (this.versionConflicts != null) { + generator.writeKey("version_conflicts"); + generator.write(this.versionConflicts); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteAgenticMemoryQueryResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long batches; + @Nullable + private Long created; + @Nullable + private Long deleted; + @Nullable + private List failures; + @Nullable + private Long noops; + @Nullable + private Float requestsPerSecond; + @Nullable + private String result; + @Nullable + private Retries retries; + @Nullable + private Long throttledMillis; + @Nullable + private Long throttledUntilMillis; + @Nullable + private Boolean timedOut; + @Nullable + private Long took; + @Nullable + private Long total; + @Nullable + private Long updated; + @Nullable + private Long versionConflicts; + + public Builder() {} + + private Builder(DeleteAgenticMemoryQueryResponse o) { + this.batches = o.batches; + this.created = o.created; + this.deleted = o.deleted; + this.failures = _listCopy(o.failures); + this.noops = o.noops; + this.requestsPerSecond = o.requestsPerSecond; + this.result = o.result; + this.retries = o.retries; + this.throttledMillis = o.throttledMillis; + this.throttledUntilMillis = o.throttledUntilMillis; + this.timedOut = o.timedOut; + this.took = o.took; + this.total = o.total; + this.updated = o.updated; + this.versionConflicts = o.versionConflicts; + } + + private Builder(Builder o) { + this.batches = o.batches; + this.created = o.created; + this.deleted = o.deleted; + this.failures = _listCopy(o.failures); + this.noops = o.noops; + this.requestsPerSecond = o.requestsPerSecond; + this.result = o.result; + this.retries = o.retries; + this.throttledMillis = o.throttledMillis; + this.throttledUntilMillis = o.throttledUntilMillis; + this.timedOut = o.timedOut; + this.took = o.took; + this.total = o.total; + this.updated = o.updated; + this.versionConflicts = o.versionConflicts; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Number of batches processed. + *

+ * API name: {@code batches} + *

+ */ + @Nonnull + public final Builder batches(@Nullable Long value) { + this.batches = value; + return this; + } + + /** + * Number of documents created. + *

+ * API name: {@code created} + *

+ */ + @Nonnull + public final Builder created(@Nullable Long value) { + this.created = value; + return this; + } + + /** + * Number of documents deleted. + *

+ * API name: {@code deleted} + *

+ */ + @Nonnull + public final Builder deleted(@Nullable Long value) { + this.deleted = value; + return this; + } + + /** + * Any failures occurred during the operation. + *

+ * API name: {@code failures} + *

+ * + *

+ * Adds all elements of list to failures. + *

+ */ + @Nonnull + public final Builder failures(List list) { + this.failures = _listAddAll(this.failures, list); + return this; + } + + /** + * Any failures occurred during the operation. + *

+ * API name: {@code failures} + *

+ * + *

+ * Adds one or more values to failures. + *

+ */ + @Nonnull + public final Builder failures(BulkByScrollFailure value, BulkByScrollFailure... values) { + this.failures = _listAdd(this.failures, value, values); + return this; + } + + /** + * Any failures occurred during the operation. + *

+ * API name: {@code failures} + *

+ * + *

+ * Adds a value to failures using a builder lambda. + *

+ */ + @Nonnull + public final Builder failures(Function> fn) { + return failures(fn.apply(new BulkByScrollFailure.Builder()).build()); + } + + /** + * Number of no-operation updates. + *

+ * API name: {@code noops} + *

+ */ + @Nonnull + public final Builder noops(@Nullable Long value) { + this.noops = value; + return this; + } + + /** + * Number of requests processed per second. + *

+ * API name: {@code requests_per_second} + *

+ */ + @Nonnull + public final Builder requestsPerSecond(@Nullable Float value) { + this.requestsPerSecond = value; + return this; + } + + /** + * The result of delete operation. + *

+ * API name: {@code result} + *

+ */ + @Nonnull + public final Builder result(@Nullable String value) { + this.result = value; + return this; + } + + /** + * API name: {@code retries} + */ + @Nonnull + public final Builder retries(@Nullable Retries value) { + this.retries = value; + return this; + } + + /** + * API name: {@code retries} + */ + @Nonnull + public final Builder retries(Function> fn) { + return retries(fn.apply(new Retries.Builder()).build()); + } + + /** + * Time that the request was throttled. + *

+ * API name: {@code throttled_millis} + *

+ */ + @Nonnull + public final Builder throttledMillis(@Nullable Long value) { + this.throttledMillis = value; + return this; + } + + /** + * Time until throttling is lifted. + *

+ * API name: {@code throttled_until_millis} + *

+ */ + @Nonnull + public final Builder throttledUntilMillis(@Nullable Long value) { + this.throttledUntilMillis = value; + return this; + } + + /** + * Whether the request timed out. + *

+ * API name: {@code timed_out} + *

+ */ + @Nonnull + public final Builder timedOut(@Nullable Boolean value) { + this.timedOut = value; + return this; + } + + /** + * Time taken to execute the request. + *

+ * API name: {@code took} + *

+ */ + @Nonnull + public final Builder took(@Nullable Long value) { + this.took = value; + return this; + } + + /** + * Total number of documents processed. + *

+ * API name: {@code total} + *

+ */ + @Nonnull + public final Builder total(@Nullable Long value) { + this.total = value; + return this; + } + + /** + * Number of documents updated. + *

+ * API name: {@code updated} + *

+ */ + @Nonnull + public final Builder updated(@Nullable Long value) { + this.updated = value; + return this; + } + + /** + * Number of version conflicts encountered. + *

+ * API name: {@code version_conflicts} + *

+ */ + @Nonnull + public final Builder versionConflicts(@Nullable Long value) { + this.versionConflicts = value; + return this; + } + + /** + * Builds a {@link DeleteAgenticMemoryQueryResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteAgenticMemoryQueryResponse build() { + _checkSingleUse(); + + return new DeleteAgenticMemoryQueryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteAgenticMemoryQueryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteAgenticMemoryQueryResponse::setupDeleteAgenticMemoryQueryResponseDeserializer + ); + + protected static void setupDeleteAgenticMemoryQueryResponseDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::batches, JsonpDeserializer.longDeserializer(), "batches"); + op.add(Builder::created, JsonpDeserializer.longDeserializer(), "created"); + op.add(Builder::deleted, JsonpDeserializer.longDeserializer(), "deleted"); + op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(BulkByScrollFailure._DESERIALIZER), "failures"); + op.add(Builder::noops, JsonpDeserializer.longDeserializer(), "noops"); + op.add(Builder::requestsPerSecond, JsonpDeserializer.floatDeserializer(), "requests_per_second"); + op.add(Builder::result, JsonpDeserializer.stringDeserializer(), "result"); + op.add(Builder::retries, Retries._DESERIALIZER, "retries"); + op.add(Builder::throttledMillis, JsonpDeserializer.longDeserializer(), "throttled_millis"); + op.add(Builder::throttledUntilMillis, JsonpDeserializer.longDeserializer(), "throttled_until_millis"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + op.add(Builder::total, JsonpDeserializer.longDeserializer(), "total"); + op.add(Builder::updated, JsonpDeserializer.longDeserializer(), "updated"); + op.add(Builder::versionConflicts, JsonpDeserializer.longDeserializer(), "version_conflicts"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.batches); + result = 31 * result + Objects.hashCode(this.created); + result = 31 * result + Objects.hashCode(this.deleted); + result = 31 * result + Objects.hashCode(this.failures); + result = 31 * result + Objects.hashCode(this.noops); + result = 31 * result + Objects.hashCode(this.requestsPerSecond); + result = 31 * result + Objects.hashCode(this.result); + result = 31 * result + Objects.hashCode(this.retries); + result = 31 * result + Objects.hashCode(this.throttledMillis); + result = 31 * result + Objects.hashCode(this.throttledUntilMillis); + result = 31 * result + Objects.hashCode(this.timedOut); + result = 31 * result + Objects.hashCode(this.took); + result = 31 * result + Objects.hashCode(this.total); + result = 31 * result + Objects.hashCode(this.updated); + result = 31 * result + Objects.hashCode(this.versionConflicts); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + DeleteAgenticMemoryQueryResponse other = (DeleteAgenticMemoryQueryResponse) o; + return Objects.equals(this.batches, other.batches) + && Objects.equals(this.created, other.created) + && Objects.equals(this.deleted, other.deleted) + && Objects.equals(this.failures, other.failures) + && Objects.equals(this.noops, other.noops) + && Objects.equals(this.requestsPerSecond, other.requestsPerSecond) + && Objects.equals(this.result, other.result) + && Objects.equals(this.retries, other.retries) + && Objects.equals(this.throttledMillis, other.throttledMillis) + && Objects.equals(this.throttledUntilMillis, other.throttledUntilMillis) + && Objects.equals(this.timedOut, other.timedOut) + && Objects.equals(this.took, other.took) + && Objects.equals(this.total, other.total) + && Objects.equals(this.updated, other.updated) + && Objects.equals(this.versionConflicts, other.versionConflicts); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryRequest.java new file mode 100644 index 0000000000..d4a3487e0a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryRequest.java @@ -0,0 +1,225 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_agentic_memory.Request + +/** + * Delete a specific memory by its type and ID. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class DeleteAgenticMemoryRequest extends RequestBase + implements + ToCopyableBuilder { + + @Nonnull + private final String id; + + @Nonnull + private final String memoryContainerId; + + @Nonnull + private final MemoryType type; + + // --------------------------------------------------------------------------------------------- + + private DeleteAgenticMemoryRequest(Builder builder) { + super(builder); + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static DeleteAgenticMemoryRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final String id() { + return this.id; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final MemoryType type() { + return this.type; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteAgenticMemoryRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + private String id; + private String memoryContainerId; + private MemoryType type; + + public Builder() {} + + private Builder(DeleteAgenticMemoryRequest o) { + super(o); + this.id = o.id; + this.memoryContainerId = o.memoryContainerId; + this.type = o.type; + } + + private Builder(Builder o) { + super(o); + this.id = o.id; + this.memoryContainerId = o.memoryContainerId; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(MemoryType value) { + this.type = value; + return this; + } + + /** + * Builds a {@link DeleteAgenticMemoryRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteAgenticMemoryRequest build() { + _checkSingleUse(); + + return new DeleteAgenticMemoryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.delete_agentic_memory}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "DELETE", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories/"); + SimpleEndpoint.pathEncode(request.type.jsonValue(), buf); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + DeleteAgenticMemoryResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.id.hashCode(); + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + DeleteAgenticMemoryRequest other = (DeleteAgenticMemoryRequest) o; + return this.id.equals(other.id) && this.memoryContainerId.equals(other.memoryContainerId) && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryResponse.java new file mode 100644 index 0000000000..fb0ffcee64 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgenticMemoryResponse.java @@ -0,0 +1,132 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_agentic_memory.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteAgenticMemoryResponse extends WriteResponseBase + implements + ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private DeleteAgenticMemoryResponse(Builder builder) { + super(builder); + } + + public static DeleteAgenticMemoryResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteAgenticMemoryResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteAgenticMemoryResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteAgenticMemoryResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteAgenticMemoryResponse build() { + _checkSingleUse(); + + return new DeleteAgenticMemoryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteAgenticMemoryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteAgenticMemoryResponse::setupDeleteAgenticMemoryResponseDeserializer + ); + + protected static void setupDeleteAgenticMemoryResponseDeserializer(ObjectDeserializer op) { + setupWriteResponseBaseDeserializer(op); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + return true; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerRequest.java new file mode 100644 index 0000000000..7a0dd3c975 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerRequest.java @@ -0,0 +1,258 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_memory_container.Request + +/** + * Delete a memory container. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class DeleteMemoryContainerRequest extends RequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Boolean deleteAllMemories; + + @Nonnull + private final List deleteMemories; + + @Nonnull + private final String memoryContainerId; + + // --------------------------------------------------------------------------------------------- + + private DeleteMemoryContainerRequest(Builder builder) { + super(builder); + this.deleteAllMemories = builder.deleteAllMemories; + this.deleteMemories = ApiTypeHelper.unmodifiable(builder.deleteMemories); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + } + + public static DeleteMemoryContainerRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code delete_all_memories} + */ + @Nullable + public final Boolean deleteAllMemories() { + return this.deleteAllMemories; + } + + /** + * API name: {@code delete_memories} + */ + @Nonnull + public final List deleteMemories() { + return this.deleteMemories; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteMemoryContainerRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private Boolean deleteAllMemories; + @Nullable + private List deleteMemories; + private String memoryContainerId; + + public Builder() {} + + private Builder(DeleteMemoryContainerRequest o) { + super(o); + this.deleteAllMemories = o.deleteAllMemories; + this.deleteMemories = _listCopy(o.deleteMemories); + this.memoryContainerId = o.memoryContainerId; + } + + private Builder(Builder o) { + super(o); + this.deleteAllMemories = o.deleteAllMemories; + this.deleteMemories = _listCopy(o.deleteMemories); + this.memoryContainerId = o.memoryContainerId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code delete_all_memories} + */ + @Nonnull + public final Builder deleteAllMemories(@Nullable Boolean value) { + this.deleteAllMemories = value; + return this; + } + + /** + * API name: {@code delete_memories} + * + *

+ * Adds all elements of list to deleteMemories. + *

+ */ + @Nonnull + public final Builder deleteMemories(List list) { + this.deleteMemories = _listAddAll(this.deleteMemories, list); + return this; + } + + /** + * API name: {@code delete_memories} + * + *

+ * Adds one or more values to deleteMemories. + *

+ */ + @Nonnull + public final Builder deleteMemories(MemoryType value, MemoryType... values) { + this.deleteMemories = _listAdd(this.deleteMemories, value, values); + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * Builds a {@link DeleteMemoryContainerRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteMemoryContainerRequest build() { + _checkSingleUse(); + + return new DeleteMemoryContainerRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.deleteAllMemories != null) { + params.put("delete_all_memories", String.valueOf(this.deleteAllMemories)); + } + if (ApiTypeHelper.isDefined(this.deleteMemories)) { + params.put("delete_memories", this.deleteMemories.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + } + + /** + * Endpoint "{@code ml.delete_memory_container}". + */ + public static final Endpoint _ENDPOINT = + new SimpleEndpoint<>( + // Request method + request -> "DELETE", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + DeleteMemoryContainerResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.deleteAllMemories); + result = 31 * result + Objects.hashCode(this.deleteMemories); + result = 31 * result + this.memoryContainerId.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + DeleteMemoryContainerRequest other = (DeleteMemoryContainerRequest) o; + return Objects.equals(this.deleteAllMemories, other.deleteAllMemories) + && Objects.equals(this.deleteMemories, other.deleteMemories) + && this.memoryContainerId.equals(other.memoryContainerId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerResponse.java new file mode 100644 index 0000000000..7f1b319d5b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteMemoryContainerResponse.java @@ -0,0 +1,132 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.delete_memory_container.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class DeleteMemoryContainerResponse extends WriteResponseBase + implements + ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private DeleteMemoryContainerResponse(Builder builder) { + super(builder); + } + + public static DeleteMemoryContainerResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link DeleteMemoryContainerResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteMemoryContainerResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteMemoryContainerResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public DeleteMemoryContainerResponse build() { + _checkSingleUse(); + + return new DeleteMemoryContainerResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteMemoryContainerResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DeleteMemoryContainerResponse::setupDeleteMemoryContainerResponseDeserializer + ); + + protected static void setupDeleteMemoryContainerResponseDeserializer(ObjectDeserializer op) { + setupWriteResponseBaseDeserializer(op); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + return true; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolRequest.java new file mode 100644 index 0000000000..62b5e47933 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolRequest.java @@ -0,0 +1,258 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.execute_tool.Request + +/** + * Execute a tool. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class ExecuteToolRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final Map parameters; + + @Nonnull + private final ToolName toolName; + + // --------------------------------------------------------------------------------------------- + + private ExecuteToolRequest(Builder builder) { + super(builder); + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); + this.toolName = ApiTypeHelper.requireNonNull(builder.toolName, this, "toolName"); + } + + public static ExecuteToolRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code parameters} + */ + @Nonnull + public final Map parameters() { + return this.parameters; + } + + /** + * Required - API name: {@code tool_name} + */ + @Nonnull + public final ToolName toolName() { + return this.toolName; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ExecuteToolRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Map parameters; + private ToolName toolName; + + public Builder() {} + + private Builder(ExecuteToolRequest o) { + super(o); + this.parameters = _mapCopy(o.parameters); + this.toolName = o.toolName; + } + + private Builder(Builder o) { + super(o); + this.parameters = _mapCopy(o.parameters); + this.toolName = o.toolName; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + @Nonnull + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + @Nonnull + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * Required - API name: {@code tool_name} + */ + @Nonnull + public final Builder toolName(ToolName value) { + this.toolName = value; + return this; + } + + /** + * Builds a {@link ExecuteToolRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ExecuteToolRequest build() { + _checkSingleUse(); + + return new ExecuteToolRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExecuteToolRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ExecuteToolRequest::setupExecuteToolRequestDeserializer + ); + + protected static void setupExecuteToolRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.execute_tool}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/tools/_execute/"); + SimpleEndpoint.pathEncode(request.toolName.jsonValue(), buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + ExecuteToolResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.parameters); + result = 31 * result + this.toolName.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ExecuteToolRequest other = (ExecuteToolRequest) o; + return Objects.equals(this.parameters, other.parameters) && this.toolName.equals(other.toolName); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolResponse.java new file mode 100644 index 0000000000..8c509d6b34 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteToolResponse.java @@ -0,0 +1,198 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.execute_tool.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ExecuteToolResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final List inferenceResults; + + // --------------------------------------------------------------------------------------------- + + private ExecuteToolResponse(Builder builder) { + this.inferenceResults = ApiTypeHelper.unmodifiable(builder.inferenceResults); + } + + public static ExecuteToolResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code inference_results} + */ + @Nonnull + public final List inferenceResults() { + return this.inferenceResults; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.inferenceResults)) { + generator.writeKey("inference_results"); + generator.writeStartArray(); + for (InferenceResults item0 : this.inferenceResults) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ExecuteToolResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List inferenceResults; + + public Builder() {} + + private Builder(ExecuteToolResponse o) { + this.inferenceResults = _listCopy(o.inferenceResults); + } + + private Builder(Builder o) { + this.inferenceResults = _listCopy(o.inferenceResults); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code inference_results} + * + *

+ * Adds all elements of list to inferenceResults. + *

+ */ + @Nonnull + public final Builder inferenceResults(List list) { + this.inferenceResults = _listAddAll(this.inferenceResults, list); + return this; + } + + /** + * API name: {@code inference_results} + * + *

+ * Adds one or more values to inferenceResults. + *

+ */ + @Nonnull + public final Builder inferenceResults(InferenceResults value, InferenceResults... values) { + this.inferenceResults = _listAdd(this.inferenceResults, value, values); + return this; + } + + /** + * API name: {@code inference_results} + * + *

+ * Adds a value to inferenceResults using a builder lambda. + *

+ */ + @Nonnull + public final Builder inferenceResults(Function> fn) { + return inferenceResults(fn.apply(new InferenceResults.Builder()).build()); + } + + /** + * Builds a {@link ExecuteToolResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ExecuteToolResponse build() { + _checkSingleUse(); + + return new ExecuteToolResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExecuteToolResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ExecuteToolResponse::setupExecuteToolResponseDeserializer + ); + + protected static void setupExecuteToolResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::inferenceResults, JsonpDeserializer.arrayDeserializer(InferenceResults._DESERIALIZER), "inference_results"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.inferenceResults); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ExecuteToolResponse other = (ExecuteToolResponse) o; + return Objects.equals(this.inferenceResults, other.inferenceResults); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryRequest.java new file mode 100644 index 0000000000..48125f5018 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryRequest.java @@ -0,0 +1,221 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.get_agentic_memory.Request + +/** + * Get a specific memory by its type and ID. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class GetAgenticMemoryRequest extends RequestBase + implements + ToCopyableBuilder { + + @Nonnull + private final String id; + + @Nonnull + private final String memoryContainerId; + + @Nonnull + private final MemoryType type; + + // --------------------------------------------------------------------------------------------- + + private GetAgenticMemoryRequest(Builder builder) { + super(builder); + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static GetAgenticMemoryRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final String id() { + return this.id; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final MemoryType type() { + return this.type; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link GetAgenticMemoryRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + private String id; + private String memoryContainerId; + private MemoryType type; + + public Builder() {} + + private Builder(GetAgenticMemoryRequest o) { + super(o); + this.id = o.id; + this.memoryContainerId = o.memoryContainerId; + this.type = o.type; + } + + private Builder(Builder o) { + super(o); + this.id = o.id; + this.memoryContainerId = o.memoryContainerId; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(MemoryType value) { + this.type = value; + return this; + } + + /** + * Builds a {@link GetAgenticMemoryRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public GetAgenticMemoryRequest build() { + _checkSingleUse(); + + return new GetAgenticMemoryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.get_agentic_memory}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories/"); + SimpleEndpoint.pathEncode(request.type.jsonValue(), buf); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + GetAgenticMemoryResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.id.hashCode(); + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + GetAgenticMemoryRequest other = (GetAgenticMemoryRequest) o; + return this.id.equals(other.id) && this.memoryContainerId.equals(other.memoryContainerId) && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryResponse.java new file mode 100644 index 0000000000..6888ae2526 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetAgenticMemoryResponse.java @@ -0,0 +1,982 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.get_agentic_memory.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class GetAgenticMemoryResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final ActionType action; + + @Nonnull + private final Map after; + + @Nonnull + private final Map before; + + @Nullable + private final Long createdTime; + + @Nullable + private final Boolean infer; + + @Nullable + private final Long lastUpdatedTime; + + @Nullable + private final String memory; + + @Nullable + private final String memoryContainerId; + + @Nonnull + private final List memoryEmbedding; + + @Nullable + private final String memoryId; + + @Nonnull + private final List messages; + + @Nonnull + private final Map metadata; + + @Nonnull + private final Map namespace; + + @Nullable + private final Long namespaceSize; + + @Nullable + private final String ownerId; + + @Nullable + private final PayloadType payloadType; + + @Nullable + private final String strategyId; + + @Nullable + private final StrategyType strategyType; + + @Nonnull + private final Map tags; + + // --------------------------------------------------------------------------------------------- + + private GetAgenticMemoryResponse(Builder builder) { + this.action = builder.action; + this.after = ApiTypeHelper.unmodifiable(builder.after); + this.before = ApiTypeHelper.unmodifiable(builder.before); + this.createdTime = builder.createdTime; + this.infer = builder.infer; + this.lastUpdatedTime = builder.lastUpdatedTime; + this.memory = builder.memory; + this.memoryContainerId = builder.memoryContainerId; + this.memoryEmbedding = ApiTypeHelper.unmodifiable(builder.memoryEmbedding); + this.memoryId = builder.memoryId; + this.messages = ApiTypeHelper.unmodifiable(builder.messages); + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.namespace = ApiTypeHelper.unmodifiable(builder.namespace); + this.namespaceSize = builder.namespaceSize; + this.ownerId = builder.ownerId; + this.payloadType = builder.payloadType; + this.strategyId = builder.strategyId; + this.strategyType = builder.strategyType; + this.tags = ApiTypeHelper.unmodifiable(builder.tags); + } + + public static GetAgenticMemoryResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code action} + */ + @Nullable + public final ActionType action() { + return this.action; + } + + /** + * API name: {@code after} + */ + @Nonnull + public final Map after() { + return this.after; + } + + /** + * API name: {@code before} + */ + @Nonnull + public final Map before() { + return this.before; + } + + /** + * The created time. + *

+ * API name: {@code created_time} + *

+ */ + @Nullable + public final Long createdTime() { + return this.createdTime; + } + + /** + * Whether inference was enabled. + *

+ * API name: {@code infer} + *

+ */ + @Nullable + public final Boolean infer() { + return this.infer; + } + + /** + * The last updated time. + *

+ * API name: {@code last_updated_time} + *

+ */ + @Nullable + public final Long lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * The extracted long-term memory fact. + *

+ * API name: {@code memory} + *

+ */ + @Nullable + public final String memory() { + return this.memory; + } + + /** + * The ID of the memory container. + *

+ * API name: {@code memory_container_id} + *

+ */ + @Nullable + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code memory_embedding} + */ + @Nonnull + public final List memoryEmbedding() { + return this.memoryEmbedding; + } + + /** + * The ID of the memory. + *

+ * API name: {@code memory_id} + *

+ */ + @Nullable + public final String memoryId() { + return this.memoryId; + } + + /** + * API name: {@code messages} + */ + @Nonnull + public final List messages() { + return this.messages; + } + + /** + * API name: {@code metadata} + */ + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code namespace} + */ + @Nonnull + public final Map namespace() { + return this.namespace; + } + + /** + * The number of namespaces. + *

+ * API name: {@code namespace_size} + *

+ */ + @Nullable + public final Long namespaceSize() { + return this.namespaceSize; + } + + /** + * The ID of the memory owner. + *

+ * API name: {@code owner_id} + *

+ */ + @Nullable + public final String ownerId() { + return this.ownerId; + } + + /** + * API name: {@code payload_type} + */ + @Nullable + public final PayloadType payloadType() { + return this.payloadType; + } + + /** + * The ID for the strategy instance. + *

+ * API name: {@code strategy_id} + *

+ */ + @Nullable + public final String strategyId() { + return this.strategyId; + } + + /** + * API name: {@code strategy_type} + */ + @Nullable + public final StrategyType strategyType() { + return this.strategyType; + } + + /** + * API name: {@code tags} + */ + @Nonnull + public final Map tags() { + return this.tags; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.action != null) { + generator.writeKey("action"); + this.action.serialize(generator, mapper); + } + + if (ApiTypeHelper.isDefined(this.after)) { + generator.writeKey("after"); + generator.writeStartObject(); + for (Map.Entry item0 : this.after.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.before)) { + generator.writeKey("before"); + generator.writeStartObject(); + for (Map.Entry item0 : this.before.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.createdTime != null) { + generator.writeKey("created_time"); + generator.write(this.createdTime); + } + + if (this.infer != null) { + generator.writeKey("infer"); + generator.write(this.infer); + } + + if (this.lastUpdatedTime != null) { + generator.writeKey("last_updated_time"); + generator.write(this.lastUpdatedTime); + } + + if (this.memory != null) { + generator.writeKey("memory"); + generator.write(this.memory); + } + + if (this.memoryContainerId != null) { + generator.writeKey("memory_container_id"); + generator.write(this.memoryContainerId); + } + + if (ApiTypeHelper.isDefined(this.memoryEmbedding)) { + generator.writeKey("memory_embedding"); + generator.writeStartArray(); + for (Double item0 : this.memoryEmbedding) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (this.memoryId != null) { + generator.writeKey("memory_id"); + generator.write(this.memoryId); + } + + if (ApiTypeHelper.isDefined(this.messages)) { + generator.writeKey("messages"); + generator.writeStartArray(); + for (Message item0 : this.messages) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.metadata)) { + generator.writeKey("metadata"); + generator.writeStartObject(); + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.namespace)) { + generator.writeKey("namespace"); + generator.writeStartObject(); + for (Map.Entry item0 : this.namespace.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.namespaceSize != null) { + generator.writeKey("namespace_size"); + generator.write(this.namespaceSize); + } + + if (this.ownerId != null) { + generator.writeKey("owner_id"); + generator.write(this.ownerId); + } + + if (this.payloadType != null) { + generator.writeKey("payload_type"); + this.payloadType.serialize(generator, mapper); + } + + if (this.strategyId != null) { + generator.writeKey("strategy_id"); + generator.write(this.strategyId); + } + + if (this.strategyType != null) { + generator.writeKey("strategy_type"); + this.strategyType.serialize(generator, mapper); + } + + if (ApiTypeHelper.isDefined(this.tags)) { + generator.writeKey("tags"); + generator.writeStartObject(); + for (Map.Entry item0 : this.tags.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link GetAgenticMemoryResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private ActionType action; + @Nullable + private Map after; + @Nullable + private Map before; + @Nullable + private Long createdTime; + @Nullable + private Boolean infer; + @Nullable + private Long lastUpdatedTime; + @Nullable + private String memory; + @Nullable + private String memoryContainerId; + @Nullable + private List memoryEmbedding; + @Nullable + private String memoryId; + @Nullable + private List messages; + @Nullable + private Map metadata; + @Nullable + private Map namespace; + @Nullable + private Long namespaceSize; + @Nullable + private String ownerId; + @Nullable + private PayloadType payloadType; + @Nullable + private String strategyId; + @Nullable + private StrategyType strategyType; + @Nullable + private Map tags; + + public Builder() {} + + private Builder(GetAgenticMemoryResponse o) { + this.action = o.action; + this.after = _mapCopy(o.after); + this.before = _mapCopy(o.before); + this.createdTime = o.createdTime; + this.infer = o.infer; + this.lastUpdatedTime = o.lastUpdatedTime; + this.memory = o.memory; + this.memoryContainerId = o.memoryContainerId; + this.memoryEmbedding = _listCopy(o.memoryEmbedding); + this.memoryId = o.memoryId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.namespaceSize = o.namespaceSize; + this.ownerId = o.ownerId; + this.payloadType = o.payloadType; + this.strategyId = o.strategyId; + this.strategyType = o.strategyType; + this.tags = _mapCopy(o.tags); + } + + private Builder(Builder o) { + this.action = o.action; + this.after = _mapCopy(o.after); + this.before = _mapCopy(o.before); + this.createdTime = o.createdTime; + this.infer = o.infer; + this.lastUpdatedTime = o.lastUpdatedTime; + this.memory = o.memory; + this.memoryContainerId = o.memoryContainerId; + this.memoryEmbedding = _listCopy(o.memoryEmbedding); + this.memoryId = o.memoryId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.namespace = _mapCopy(o.namespace); + this.namespaceSize = o.namespaceSize; + this.ownerId = o.ownerId; + this.payloadType = o.payloadType; + this.strategyId = o.strategyId; + this.strategyType = o.strategyType; + this.tags = _mapCopy(o.tags); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code action} + */ + @Nonnull + public final Builder action(@Nullable ActionType value) { + this.action = value; + return this; + } + + /** + * API name: {@code after} + * + *

+ * Adds all elements of map to after. + *

+ */ + @Nonnull + public final Builder after(Map map) { + this.after = _mapPutAll(this.after, map); + return this; + } + + /** + * API name: {@code after} + * + *

+ * Adds an entry to after. + *

+ */ + @Nonnull + public final Builder after(String key, JsonData value) { + this.after = _mapPut(this.after, key, value); + return this; + } + + /** + * API name: {@code before} + * + *

+ * Adds all elements of map to before. + *

+ */ + @Nonnull + public final Builder before(Map map) { + this.before = _mapPutAll(this.before, map); + return this; + } + + /** + * API name: {@code before} + * + *

+ * Adds an entry to before. + *

+ */ + @Nonnull + public final Builder before(String key, JsonData value) { + this.before = _mapPut(this.before, key, value); + return this; + } + + /** + * The created time. + *

+ * API name: {@code created_time} + *

+ */ + @Nonnull + public final Builder createdTime(@Nullable Long value) { + this.createdTime = value; + return this; + } + + /** + * Whether inference was enabled. + *

+ * API name: {@code infer} + *

+ */ + @Nonnull + public final Builder infer(@Nullable Boolean value) { + this.infer = value; + return this; + } + + /** + * The last updated time. + *

+ * API name: {@code last_updated_time} + *

+ */ + @Nonnull + public final Builder lastUpdatedTime(@Nullable Long value) { + this.lastUpdatedTime = value; + return this; + } + + /** + * The extracted long-term memory fact. + *

+ * API name: {@code memory} + *

+ */ + @Nonnull + public final Builder memory(@Nullable String value) { + this.memory = value; + return this; + } + + /** + * The ID of the memory container. + *

+ * API name: {@code memory_container_id} + *

+ */ + @Nonnull + public final Builder memoryContainerId(@Nullable String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code memory_embedding} + * + *

+ * Adds all elements of list to memoryEmbedding. + *

+ */ + @Nonnull + public final Builder memoryEmbedding(List list) { + this.memoryEmbedding = _listAddAll(this.memoryEmbedding, list); + return this; + } + + /** + * API name: {@code memory_embedding} + * + *

+ * Adds one or more values to memoryEmbedding. + *

+ */ + @Nonnull + public final Builder memoryEmbedding(Double value, Double... values) { + this.memoryEmbedding = _listAdd(this.memoryEmbedding, value, values); + return this; + } + + /** + * The ID of the memory. + *

+ * API name: {@code memory_id} + *

+ */ + @Nonnull + public final Builder memoryId(@Nullable String value) { + this.memoryId = value; + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds all elements of list to messages. + *

+ */ + @Nonnull + public final Builder messages(List list) { + this.messages = _listAddAll(this.messages, list); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds one or more values to messages. + *

+ */ + @Nonnull + public final Builder messages(Message value, Message... values) { + this.messages = _listAdd(this.messages, value, values); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds a value to messages using a builder lambda. + *

+ */ + @Nonnull + public final Builder messages(Function> fn) { + return messages(fn.apply(new Message.Builder()).build()); + } + + /** + * API name: {@code metadata} + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * API name: {@code metadata} + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds all elements of map to namespace. + *

+ */ + @Nonnull + public final Builder namespace(Map map) { + this.namespace = _mapPutAll(this.namespace, map); + return this; + } + + /** + * API name: {@code namespace} + * + *

+ * Adds an entry to namespace. + *

+ */ + @Nonnull + public final Builder namespace(String key, JsonData value) { + this.namespace = _mapPut(this.namespace, key, value); + return this; + } + + /** + * The number of namespaces. + *

+ * API name: {@code namespace_size} + *

+ */ + @Nonnull + public final Builder namespaceSize(@Nullable Long value) { + this.namespaceSize = value; + return this; + } + + /** + * The ID of the memory owner. + *

+ * API name: {@code owner_id} + *

+ */ + @Nonnull + public final Builder ownerId(@Nullable String value) { + this.ownerId = value; + return this; + } + + /** + * API name: {@code payload_type} + */ + @Nonnull + public final Builder payloadType(@Nullable PayloadType value) { + this.payloadType = value; + return this; + } + + /** + * The ID for the strategy instance. + *

+ * API name: {@code strategy_id} + *

+ */ + @Nonnull + public final Builder strategyId(@Nullable String value) { + this.strategyId = value; + return this; + } + + /** + * API name: {@code strategy_type} + */ + @Nonnull + public final Builder strategyType(@Nullable StrategyType value) { + this.strategyType = value; + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds all elements of map to tags. + *

+ */ + @Nonnull + public final Builder tags(Map map) { + this.tags = _mapPutAll(this.tags, map); + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds an entry to tags. + *

+ */ + @Nonnull + public final Builder tags(String key, JsonData value) { + this.tags = _mapPut(this.tags, key, value); + return this; + } + + /** + * Builds a {@link GetAgenticMemoryResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public GetAgenticMemoryResponse build() { + _checkSingleUse(); + + return new GetAgenticMemoryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetAgenticMemoryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + GetAgenticMemoryResponse::setupGetAgenticMemoryResponseDeserializer + ); + + protected static void setupGetAgenticMemoryResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::action, ActionType._DESERIALIZER, "action"); + op.add(Builder::after, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "after"); + op.add(Builder::before, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "before"); + op.add(Builder::createdTime, JsonpDeserializer.longDeserializer(), "created_time"); + op.add(Builder::infer, JsonpDeserializer.booleanDeserializer(), "infer"); + op.add(Builder::lastUpdatedTime, JsonpDeserializer.longDeserializer(), "last_updated_time"); + op.add(Builder::memory, JsonpDeserializer.stringDeserializer(), "memory"); + op.add(Builder::memoryContainerId, JsonpDeserializer.stringDeserializer(), "memory_container_id"); + op.add(Builder::memoryEmbedding, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer()), "memory_embedding"); + op.add(Builder::memoryId, JsonpDeserializer.stringDeserializer(), "memory_id"); + op.add(Builder::messages, JsonpDeserializer.arrayDeserializer(Message._DESERIALIZER), "messages"); + op.add(Builder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); + op.add(Builder::namespace, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "namespace"); + op.add(Builder::namespaceSize, JsonpDeserializer.longDeserializer(), "namespace_size"); + op.add(Builder::ownerId, JsonpDeserializer.stringDeserializer(), "owner_id"); + op.add(Builder::payloadType, PayloadType._DESERIALIZER, "payload_type"); + op.add(Builder::strategyId, JsonpDeserializer.stringDeserializer(), "strategy_id"); + op.add(Builder::strategyType, StrategyType._DESERIALIZER, "strategy_type"); + op.add(Builder::tags, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "tags"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.action); + result = 31 * result + Objects.hashCode(this.after); + result = 31 * result + Objects.hashCode(this.before); + result = 31 * result + Objects.hashCode(this.createdTime); + result = 31 * result + Objects.hashCode(this.infer); + result = 31 * result + Objects.hashCode(this.lastUpdatedTime); + result = 31 * result + Objects.hashCode(this.memory); + result = 31 * result + Objects.hashCode(this.memoryContainerId); + result = 31 * result + Objects.hashCode(this.memoryEmbedding); + result = 31 * result + Objects.hashCode(this.memoryId); + result = 31 * result + Objects.hashCode(this.messages); + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.namespace); + result = 31 * result + Objects.hashCode(this.namespaceSize); + result = 31 * result + Objects.hashCode(this.ownerId); + result = 31 * result + Objects.hashCode(this.payloadType); + result = 31 * result + Objects.hashCode(this.strategyId); + result = 31 * result + Objects.hashCode(this.strategyType); + result = 31 * result + Objects.hashCode(this.tags); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + GetAgenticMemoryResponse other = (GetAgenticMemoryResponse) o; + return Objects.equals(this.action, other.action) + && Objects.equals(this.after, other.after) + && Objects.equals(this.before, other.before) + && Objects.equals(this.createdTime, other.createdTime) + && Objects.equals(this.infer, other.infer) + && Objects.equals(this.lastUpdatedTime, other.lastUpdatedTime) + && Objects.equals(this.memory, other.memory) + && Objects.equals(this.memoryContainerId, other.memoryContainerId) + && Objects.equals(this.memoryEmbedding, other.memoryEmbedding) + && Objects.equals(this.memoryId, other.memoryId) + && Objects.equals(this.messages, other.messages) + && Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.namespace, other.namespace) + && Objects.equals(this.namespaceSize, other.namespaceSize) + && Objects.equals(this.ownerId, other.ownerId) + && Objects.equals(this.payloadType, other.payloadType) + && Objects.equals(this.strategyId, other.strategyId) + && Objects.equals(this.strategyType, other.strategyType) + && Objects.equals(this.tags, other.tags); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerRequest.java new file mode 100644 index 0000000000..d48520bd6c --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerRequest.java @@ -0,0 +1,169 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.get_memory_container.Request + +/** + * Get a memory container. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class GetMemoryContainerRequest extends RequestBase + implements + ToCopyableBuilder { + + @Nonnull + private final String memoryContainerId; + + // --------------------------------------------------------------------------------------------- + + private GetMemoryContainerRequest(Builder builder) { + super(builder); + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + } + + public static GetMemoryContainerRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link GetMemoryContainerRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + private String memoryContainerId; + + public Builder() {} + + private Builder(GetMemoryContainerRequest o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + } + + private Builder(Builder o) { + super(o); + this.memoryContainerId = o.memoryContainerId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * Builds a {@link GetMemoryContainerRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public GetMemoryContainerRequest build() { + _checkSingleUse(); + + return new GetMemoryContainerRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.get_memory_container}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + GetMemoryContainerResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.memoryContainerId.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + GetMemoryContainerRequest other = (GetMemoryContainerRequest) o; + return this.memoryContainerId.equals(other.memoryContainerId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerResponse.java new file mode 100644 index 0000000000..a04a7b7122 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMemoryContainerResponse.java @@ -0,0 +1,367 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.get_memory_container.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class GetMemoryContainerResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final MemoryContainerConfiguration configuration; + + @Nullable + private final Long createdTime; + + @Nullable + private final String description; + + @Nullable + private final Long lastUpdatedTime; + + @Nullable + private final String name; + + @Nullable + private final Owner owner; + + // --------------------------------------------------------------------------------------------- + + private GetMemoryContainerResponse(Builder builder) { + this.configuration = builder.configuration; + this.createdTime = builder.createdTime; + this.description = builder.description; + this.lastUpdatedTime = builder.lastUpdatedTime; + this.name = builder.name; + this.owner = builder.owner; + } + + public static GetMemoryContainerResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code configuration} + */ + @Nullable + public final MemoryContainerConfiguration configuration() { + return this.configuration; + } + + /** + * The created time. + *

+ * API name: {@code created_time} + *

+ */ + @Nullable + public final Long createdTime() { + return this.createdTime; + } + + /** + * The memory container description. + *

+ * API name: {@code description} + *

+ */ + @Nullable + public final String description() { + return this.description; + } + + /** + * The last updated time. + *

+ * API name: {@code last_updated_time} + *

+ */ + @Nullable + public final Long lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * API name: {@code owner} + */ + @Nullable + public final Owner owner() { + return this.owner; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.configuration != null) { + generator.writeKey("configuration"); + this.configuration.serialize(generator, mapper); + } + + if (this.createdTime != null) { + generator.writeKey("created_time"); + generator.write(this.createdTime); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + + if (this.lastUpdatedTime != null) { + generator.writeKey("last_updated_time"); + generator.write(this.lastUpdatedTime); + } + + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); + } + + if (this.owner != null) { + generator.writeKey("owner"); + this.owner.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link GetMemoryContainerResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private MemoryContainerConfiguration configuration; + @Nullable + private Long createdTime; + @Nullable + private String description; + @Nullable + private Long lastUpdatedTime; + @Nullable + private String name; + @Nullable + private Owner owner; + + public Builder() {} + + private Builder(GetMemoryContainerResponse o) { + this.configuration = o.configuration; + this.createdTime = o.createdTime; + this.description = o.description; + this.lastUpdatedTime = o.lastUpdatedTime; + this.name = o.name; + this.owner = o.owner; + } + + private Builder(Builder o) { + this.configuration = o.configuration; + this.createdTime = o.createdTime; + this.description = o.description; + this.lastUpdatedTime = o.lastUpdatedTime; + this.name = o.name; + this.owner = o.owner; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(@Nullable MemoryContainerConfiguration value) { + this.configuration = value; + return this; + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(Function> fn) { + return configuration(fn.apply(new MemoryContainerConfiguration.Builder()).build()); + } + + /** + * The created time. + *

+ * API name: {@code created_time} + *

+ */ + @Nonnull + public final Builder createdTime(@Nullable Long value) { + this.createdTime = value; + return this; + } + + /** + * The memory container description. + *

+ * API name: {@code description} + *

+ */ + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + + /** + * The last updated time. + *

+ * API name: {@code last_updated_time} + *

+ */ + @Nonnull + public final Builder lastUpdatedTime(@Nullable Long value) { + this.lastUpdatedTime = value; + return this; + } + + /** + * API name: {@code name} + */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * API name: {@code owner} + */ + @Nonnull + public final Builder owner(@Nullable Owner value) { + this.owner = value; + return this; + } + + /** + * API name: {@code owner} + */ + @Nonnull + public final Builder owner(Function> fn) { + return owner(fn.apply(new Owner.Builder()).build()); + } + + /** + * Builds a {@link GetMemoryContainerResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public GetMemoryContainerResponse build() { + _checkSingleUse(); + + return new GetMemoryContainerResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetMemoryContainerResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + GetMemoryContainerResponse::setupGetMemoryContainerResponseDeserializer + ); + + protected static void setupGetMemoryContainerResponseDeserializer(ObjectDeserializer op) { + op.add(Builder::configuration, MemoryContainerConfiguration._DESERIALIZER, "configuration"); + op.add(Builder::createdTime, JsonpDeserializer.longDeserializer(), "created_time"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::lastUpdatedTime, JsonpDeserializer.longDeserializer(), "last_updated_time"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::owner, Owner._DESERIALIZER, "owner"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.configuration); + result = 31 * result + Objects.hashCode(this.createdTime); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + Objects.hashCode(this.lastUpdatedTime); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + Objects.hashCode(this.owner); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + GetMemoryContainerResponse other = (GetMemoryContainerResponse) o; + return Objects.equals(this.configuration, other.configuration) + && Objects.equals(this.createdTime, other.createdTime) + && Objects.equals(this.description, other.description) + && Objects.equals(this.lastUpdatedTime, other.lastUpdatedTime) + && Objects.equals(this.name, other.name) + && Objects.equals(this.owner, other.owner); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMessageResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMessageResponse.java index 1828051962..e644866f2c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMessageResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetMessageResponse.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -41,6 +42,9 @@ public class GetMessageResponse implements PlainJsonSerializable, ToCopyableBuil @Nonnull private final Map additionalInfo; + @Nonnull + private final List content; + @Nullable private final String createTime; @@ -65,6 +69,9 @@ public class GetMessageResponse implements PlainJsonSerializable, ToCopyableBuil @Nullable private final String response; + @Nullable + private final String role; + @Nullable private final Long traceNumber; @@ -72,6 +79,7 @@ public class GetMessageResponse implements PlainJsonSerializable, ToCopyableBuil private GetMessageResponse(Builder builder) { this.additionalInfo = ApiTypeHelper.unmodifiable(builder.additionalInfo); + this.content = ApiTypeHelper.unmodifiable(builder.content); this.createTime = builder.createTime; this.input = builder.input; this.memoryId = builder.memoryId; @@ -80,6 +88,7 @@ private GetMessageResponse(Builder builder) { this.parentMessageId = builder.parentMessageId; this.promptTemplate = builder.promptTemplate; this.response = builder.response; + this.role = builder.role; this.traceNumber = builder.traceNumber; } @@ -95,6 +104,14 @@ public final Map additionalInfo() { return this.additionalInfo; } + /** + * API name: {@code content} + */ + @Nonnull + public final List content() { + return this.content; + } + /** * The create time. *

@@ -177,6 +194,17 @@ public final String response() { return this.response; } + /** + * The role of the message. + *

+ * API name: {@code role} + *

+ */ + @Nullable + public final String role() { + return this.role; + } + /** * The trace number. *

@@ -209,6 +237,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (ApiTypeHelper.isDefined(this.content)) { + generator.writeKey("content"); + generator.writeStartArray(); + for (Content item0 : this.content) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + if (this.createTime != null) { generator.writeKey("create_time"); generator.write(this.createTime); @@ -249,6 +286,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.response); } + if (this.role != null) { + generator.writeKey("role"); + generator.write(this.role); + } + if (this.traceNumber != null) { generator.writeKey("trace_number"); generator.write(this.traceNumber); @@ -275,6 +317,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private Map additionalInfo; @Nullable + private List content; + @Nullable private String createTime; @Nullable private String input; @@ -291,12 +335,15 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private String response; @Nullable + private String role; + @Nullable private Long traceNumber; public Builder() {} private Builder(GetMessageResponse o) { this.additionalInfo = _mapCopy(o.additionalInfo); + this.content = _listCopy(o.content); this.createTime = o.createTime; this.input = o.input; this.memoryId = o.memoryId; @@ -305,11 +352,13 @@ private Builder(GetMessageResponse o) { this.parentMessageId = o.parentMessageId; this.promptTemplate = o.promptTemplate; this.response = o.response; + this.role = o.role; this.traceNumber = o.traceNumber; } private Builder(Builder o) { this.additionalInfo = _mapCopy(o.additionalInfo); + this.content = _listCopy(o.content); this.createTime = o.createTime; this.input = o.input; this.memoryId = o.memoryId; @@ -318,6 +367,7 @@ private Builder(Builder o) { this.parentMessageId = o.parentMessageId; this.promptTemplate = o.promptTemplate; this.response = o.response; + this.role = o.role; this.traceNumber = o.traceNumber; } @@ -353,6 +403,44 @@ public final Builder additionalInfo(String key, JsonData value) { return this; } + /** + * API name: {@code content} + * + *

+ * Adds all elements of list to content. + *

+ */ + @Nonnull + public final Builder content(List list) { + this.content = _listAddAll(this.content, list); + return this; + } + + /** + * API name: {@code content} + * + *

+ * Adds one or more values to content. + *

+ */ + @Nonnull + public final Builder content(Content value, Content... values) { + this.content = _listAdd(this.content, value, values); + return this; + } + + /** + * API name: {@code content} + * + *

+ * Adds a value to content using a builder lambda. + *

+ */ + @Nonnull + public final Builder content(Function> fn) { + return content(fn.apply(new Content.Builder()).build()); + } + /** * The create time. *

@@ -443,6 +531,18 @@ public final Builder response(@Nullable String value) { return this; } + /** + * The role of the message. + *

+ * API name: {@code role} + *

+ */ + @Nonnull + public final Builder role(@Nullable String value) { + this.role = value; + return this; + } + /** * The trace number. *

@@ -481,6 +581,7 @@ public GetMessageResponse build() { protected static void setupGetMessageResponseDeserializer(ObjectDeserializer op) { op.add(Builder::additionalInfo, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "additional_info"); + op.add(Builder::content, JsonpDeserializer.arrayDeserializer(Content._DESERIALIZER), "content"); op.add(Builder::createTime, JsonpDeserializer.stringDeserializer(), "create_time"); op.add(Builder::input, JsonpDeserializer.stringDeserializer(), "input"); op.add(Builder::memoryId, JsonpDeserializer.stringDeserializer(), "memory_id"); @@ -489,6 +590,7 @@ protected static void setupGetMessageResponseDeserializer(ObjectDeserializer { + + @Nonnull + private final Map metadata; + + @Nullable + private final String numberOfReplicas; + + @Nullable + private final String numberOfShards; + + // --------------------------------------------------------------------------------------------- + + private Index(Builder builder) { + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.numberOfReplicas = builder.numberOfReplicas; + this.numberOfShards = builder.numberOfShards; + } + + public static Index of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * The number of replicas. + *

+ * API name: {@code number_of_replicas} + *

+ */ + @Nullable + public final String numberOfReplicas() { + return this.numberOfReplicas; + } + + /** + * The number of shards. + *

+ * API name: {@code number_of_shards} + *

+ */ + @Nullable + public final String numberOfShards() { + return this.numberOfShards; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.numberOfReplicas != null) { + generator.writeKey("number_of_replicas"); + generator.write(this.numberOfReplicas); + } + + if (this.numberOfShards != null) { + generator.writeKey("number_of_shards"); + generator.write(this.numberOfShards); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Index}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map metadata; + @Nullable + private String numberOfReplicas; + @Nullable + private String numberOfShards; + + public Builder() {} + + private Builder(Index o) { + this.metadata = _mapCopy(o.metadata); + this.numberOfReplicas = o.numberOfReplicas; + this.numberOfShards = o.numberOfShards; + } + + private Builder(Builder o) { + this.metadata = _mapCopy(o.metadata); + this.numberOfReplicas = o.numberOfReplicas; + this.numberOfShards = o.numberOfShards; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * The number of replicas. + *

+ * API name: {@code number_of_replicas} + *

+ */ + @Nonnull + public final Builder numberOfReplicas(@Nullable String value) { + this.numberOfReplicas = value; + return this; + } + + /** + * The number of shards. + *

+ * API name: {@code number_of_shards} + *

+ */ + @Nonnull + public final Builder numberOfShards(@Nullable String value) { + this.numberOfShards = value; + return this; + } + + /** + * Builds a {@link Index}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Index build() { + _checkSingleUse(); + + return new Index(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Index} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Index::setupIndexDeserializer + ); + + protected static void setupIndexDeserializer(ObjectDeserializer op) { + op.add(Builder::numberOfReplicas, JsonpDeserializer.stringDeserializer(), "number_of_replicas"); + op.add(Builder::numberOfShards, JsonpDeserializer.stringDeserializer(), "number_of_shards"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.numberOfReplicas); + result = 31 * result + Objects.hashCode(this.numberOfShards); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Index other = (Index) o; + return Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.numberOfReplicas, other.numberOfReplicas) + && Objects.equals(this.numberOfShards, other.numberOfShards); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/IndexSettings.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/IndexSettings.java new file mode 100644 index 0000000000..09f48400fe --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/IndexSettings.java @@ -0,0 +1,347 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.IndexSettings + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettings implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final MemoryIndexSettings longTermMemoryHistoryIndex; + + @Nullable + private final MemoryIndexSettings longTermMemoryIndex; + + @Nonnull + private final Map metadata; + + @Nullable + private final MemoryIndexSettings sessionIndex; + + @Nullable + private final MemoryIndexSettings shortTermMemoryIndex; + + // --------------------------------------------------------------------------------------------- + + private IndexSettings(Builder builder) { + this.longTermMemoryHistoryIndex = builder.longTermMemoryHistoryIndex; + this.longTermMemoryIndex = builder.longTermMemoryIndex; + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.sessionIndex = builder.sessionIndex; + this.shortTermMemoryIndex = builder.shortTermMemoryIndex; + } + + public static IndexSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code long_term_memory_history_index} + */ + @Nullable + public final MemoryIndexSettings longTermMemoryHistoryIndex() { + return this.longTermMemoryHistoryIndex; + } + + /** + * API name: {@code long_term_memory_index} + */ + @Nullable + public final MemoryIndexSettings longTermMemoryIndex() { + return this.longTermMemoryIndex; + } + + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code session_index} + */ + @Nullable + public final MemoryIndexSettings sessionIndex() { + return this.sessionIndex; + } + + /** + * API name: {@code short_term_memory_index} + */ + @Nullable + public final MemoryIndexSettings shortTermMemoryIndex() { + return this.shortTermMemoryIndex; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.longTermMemoryHistoryIndex != null) { + generator.writeKey("long_term_memory_history_index"); + this.longTermMemoryHistoryIndex.serialize(generator, mapper); + } + + if (this.longTermMemoryIndex != null) { + generator.writeKey("long_term_memory_index"); + this.longTermMemoryIndex.serialize(generator, mapper); + } + + if (this.sessionIndex != null) { + generator.writeKey("session_index"); + this.sessionIndex.serialize(generator, mapper); + } + + if (this.shortTermMemoryIndex != null) { + generator.writeKey("short_term_memory_index"); + this.shortTermMemoryIndex.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettings}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private MemoryIndexSettings longTermMemoryHistoryIndex; + @Nullable + private MemoryIndexSettings longTermMemoryIndex; + @Nullable + private Map metadata; + @Nullable + private MemoryIndexSettings sessionIndex; + @Nullable + private MemoryIndexSettings shortTermMemoryIndex; + + public Builder() {} + + private Builder(IndexSettings o) { + this.longTermMemoryHistoryIndex = o.longTermMemoryHistoryIndex; + this.longTermMemoryIndex = o.longTermMemoryIndex; + this.metadata = _mapCopy(o.metadata); + this.sessionIndex = o.sessionIndex; + this.shortTermMemoryIndex = o.shortTermMemoryIndex; + } + + private Builder(Builder o) { + this.longTermMemoryHistoryIndex = o.longTermMemoryHistoryIndex; + this.longTermMemoryIndex = o.longTermMemoryIndex; + this.metadata = _mapCopy(o.metadata); + this.sessionIndex = o.sessionIndex; + this.shortTermMemoryIndex = o.shortTermMemoryIndex; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code long_term_memory_history_index} + */ + @Nonnull + public final Builder longTermMemoryHistoryIndex(@Nullable MemoryIndexSettings value) { + this.longTermMemoryHistoryIndex = value; + return this; + } + + /** + * API name: {@code long_term_memory_history_index} + */ + @Nonnull + public final Builder longTermMemoryHistoryIndex(Function> fn) { + return longTermMemoryHistoryIndex(fn.apply(new MemoryIndexSettings.Builder()).build()); + } + + /** + * API name: {@code long_term_memory_index} + */ + @Nonnull + public final Builder longTermMemoryIndex(@Nullable MemoryIndexSettings value) { + this.longTermMemoryIndex = value; + return this; + } + + /** + * API name: {@code long_term_memory_index} + */ + @Nonnull + public final Builder longTermMemoryIndex(Function> fn) { + return longTermMemoryIndex(fn.apply(new MemoryIndexSettings.Builder()).build()); + } + + /** + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code session_index} + */ + @Nonnull + public final Builder sessionIndex(@Nullable MemoryIndexSettings value) { + this.sessionIndex = value; + return this; + } + + /** + * API name: {@code session_index} + */ + @Nonnull + public final Builder sessionIndex(Function> fn) { + return sessionIndex(fn.apply(new MemoryIndexSettings.Builder()).build()); + } + + /** + * API name: {@code short_term_memory_index} + */ + @Nonnull + public final Builder shortTermMemoryIndex(@Nullable MemoryIndexSettings value) { + this.shortTermMemoryIndex = value; + return this; + } + + /** + * API name: {@code short_term_memory_index} + */ + @Nonnull + public final Builder shortTermMemoryIndex(Function> fn) { + return shortTermMemoryIndex(fn.apply(new MemoryIndexSettings.Builder()).build()); + } + + /** + * Builds a {@link IndexSettings}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettings build() { + _checkSingleUse(); + + return new IndexSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettings::setupIndexSettingsDeserializer + ); + + protected static void setupIndexSettingsDeserializer(ObjectDeserializer op) { + op.add(Builder::longTermMemoryHistoryIndex, MemoryIndexSettings._DESERIALIZER, "long_term_memory_history_index"); + op.add(Builder::longTermMemoryIndex, MemoryIndexSettings._DESERIALIZER, "long_term_memory_index"); + op.add(Builder::sessionIndex, MemoryIndexSettings._DESERIALIZER, "session_index"); + op.add(Builder::shortTermMemoryIndex, MemoryIndexSettings._DESERIALIZER, "short_term_memory_index"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.metadata == null) { + builder.metadata = new HashMap<>(); + } + builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.longTermMemoryHistoryIndex); + result = 31 * result + Objects.hashCode(this.longTermMemoryIndex); + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.sessionIndex); + result = 31 * result + Objects.hashCode(this.shortTermMemoryIndex); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettings other = (IndexSettings) o; + return Objects.equals(this.longTermMemoryHistoryIndex, other.longTermMemoryHistoryIndex) + && Objects.equals(this.longTermMemoryIndex, other.longTermMemoryIndex) + && Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.sessionIndex, other.sessionIndex) + && Objects.equals(this.shortTermMemoryIndex, other.shortTermMemoryIndex); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryContainerConfiguration.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryContainerConfiguration.java new file mode 100644 index 0000000000..c6b19994c4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryContainerConfiguration.java @@ -0,0 +1,652 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.MemoryContainerConfiguration + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class MemoryContainerConfiguration + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Boolean disableHistory; + + @Nullable + private final Boolean disableSession; + + @Nullable + private final Long embeddingDimension; + + @Nullable + private final String embeddingModelId; + + @Nullable + private final String embeddingModelType; + + @Nullable + private final String indexPrefix; + + @Nullable + private final IndexSettings indexSettings; + + @Nullable + private final String llmId; + + @Nullable + private final Long maxInferSize; + + @Nonnull + private final Map parameters; + + @Nonnull + private final List strategies; + + @Nullable + private final Boolean useSystemIndex; + + // --------------------------------------------------------------------------------------------- + + private MemoryContainerConfiguration(Builder builder) { + this.disableHistory = builder.disableHistory; + this.disableSession = builder.disableSession; + this.embeddingDimension = builder.embeddingDimension; + this.embeddingModelId = builder.embeddingModelId; + this.embeddingModelType = builder.embeddingModelType; + this.indexPrefix = builder.indexPrefix; + this.indexSettings = builder.indexSettings; + this.llmId = builder.llmId; + this.maxInferSize = builder.maxInferSize; + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); + this.strategies = ApiTypeHelper.unmodifiable(builder.strategies); + this.useSystemIndex = builder.useSystemIndex; + } + + public static MemoryContainerConfiguration of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Whether history will be persisted. + *

+ * API name: {@code disable_history} + *

+ */ + @Nullable + public final Boolean disableHistory() { + return this.disableHistory; + } + + /** + * Whether session will be persisted. + *

+ * API name: {@code disable_session} + *

+ */ + @Nullable + public final Boolean disableSession() { + return this.disableSession; + } + + /** + * The embedding dimension. + *

+ * API name: {@code embedding_dimension} + *

+ */ + @Nullable + public final Long embeddingDimension() { + return this.embeddingDimension; + } + + /** + * The embedding model ID. + *

+ * API name: {@code embedding_model_id} + *

+ */ + @Nullable + public final String embeddingModelId() { + return this.embeddingModelId; + } + + /** + * The embedding model type. + *

+ * API name: {@code embedding_model_type} + *

+ */ + @Nullable + public final String embeddingModelType() { + return this.embeddingModelType; + } + + /** + * Custom prefix for memory indices. + *

+ * API name: {@code index_prefix} + *

+ */ + @Nullable + public final String indexPrefix() { + return this.indexPrefix; + } + + /** + * API name: {@code index_settings} + */ + @Nullable + public final IndexSettings indexSettings() { + return this.indexSettings; + } + + /** + * The LLM ID. + *

+ * API name: {@code llm_id} + *

+ */ + @Nullable + public final String llmId() { + return this.llmId; + } + + /** + * The maximum number of similar memories retrieved during consolidation. + *

+ * API name: {@code max_infer_size} + *

+ */ + @Nullable + public final Long maxInferSize() { + return this.maxInferSize; + } + + /** + * API name: {@code parameters} + */ + @Nonnull + public final Map parameters() { + return this.parameters; + } + + /** + * API name: {@code strategies} + */ + @Nonnull + public final List strategies() { + return this.strategies; + } + + /** + * Whether to use system indices. + *

+ * API name: {@code use_system_index} + *

+ */ + @Nullable + public final Boolean useSystemIndex() { + return this.useSystemIndex; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.disableHistory != null) { + generator.writeKey("disable_history"); + generator.write(this.disableHistory); + } + + if (this.disableSession != null) { + generator.writeKey("disable_session"); + generator.write(this.disableSession); + } + + if (this.embeddingDimension != null) { + generator.writeKey("embedding_dimension"); + generator.write(this.embeddingDimension); + } + + if (this.embeddingModelId != null) { + generator.writeKey("embedding_model_id"); + generator.write(this.embeddingModelId); + } + + if (this.embeddingModelType != null) { + generator.writeKey("embedding_model_type"); + generator.write(this.embeddingModelType); + } + + if (this.indexPrefix != null) { + generator.writeKey("index_prefix"); + generator.write(this.indexPrefix); + } + + if (this.indexSettings != null) { + generator.writeKey("index_settings"); + this.indexSettings.serialize(generator, mapper); + } + + if (this.llmId != null) { + generator.writeKey("llm_id"); + generator.write(this.llmId); + } + + if (this.maxInferSize != null) { + generator.writeKey("max_infer_size"); + generator.write(this.maxInferSize); + } + + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.strategies)) { + generator.writeKey("strategies"); + generator.writeStartArray(); + for (Strategy item0 : this.strategies) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.useSystemIndex != null) { + generator.writeKey("use_system_index"); + generator.write(this.useSystemIndex); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link MemoryContainerConfiguration}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean disableHistory; + @Nullable + private Boolean disableSession; + @Nullable + private Long embeddingDimension; + @Nullable + private String embeddingModelId; + @Nullable + private String embeddingModelType; + @Nullable + private String indexPrefix; + @Nullable + private IndexSettings indexSettings; + @Nullable + private String llmId; + @Nullable + private Long maxInferSize; + @Nullable + private Map parameters; + @Nullable + private List strategies; + @Nullable + private Boolean useSystemIndex; + + public Builder() {} + + private Builder(MemoryContainerConfiguration o) { + this.disableHistory = o.disableHistory; + this.disableSession = o.disableSession; + this.embeddingDimension = o.embeddingDimension; + this.embeddingModelId = o.embeddingModelId; + this.embeddingModelType = o.embeddingModelType; + this.indexPrefix = o.indexPrefix; + this.indexSettings = o.indexSettings; + this.llmId = o.llmId; + this.maxInferSize = o.maxInferSize; + this.parameters = _mapCopy(o.parameters); + this.strategies = _listCopy(o.strategies); + this.useSystemIndex = o.useSystemIndex; + } + + private Builder(Builder o) { + this.disableHistory = o.disableHistory; + this.disableSession = o.disableSession; + this.embeddingDimension = o.embeddingDimension; + this.embeddingModelId = o.embeddingModelId; + this.embeddingModelType = o.embeddingModelType; + this.indexPrefix = o.indexPrefix; + this.indexSettings = o.indexSettings; + this.llmId = o.llmId; + this.maxInferSize = o.maxInferSize; + this.parameters = _mapCopy(o.parameters); + this.strategies = _listCopy(o.strategies); + this.useSystemIndex = o.useSystemIndex; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Whether history will be persisted. + *

+ * API name: {@code disable_history} + *

+ */ + @Nonnull + public final Builder disableHistory(@Nullable Boolean value) { + this.disableHistory = value; + return this; + } + + /** + * Whether session will be persisted. + *

+ * API name: {@code disable_session} + *

+ */ + @Nonnull + public final Builder disableSession(@Nullable Boolean value) { + this.disableSession = value; + return this; + } + + /** + * The embedding dimension. + *

+ * API name: {@code embedding_dimension} + *

+ */ + @Nonnull + public final Builder embeddingDimension(@Nullable Long value) { + this.embeddingDimension = value; + return this; + } + + /** + * The embedding model ID. + *

+ * API name: {@code embedding_model_id} + *

+ */ + @Nonnull + public final Builder embeddingModelId(@Nullable String value) { + this.embeddingModelId = value; + return this; + } + + /** + * The embedding model type. + *

+ * API name: {@code embedding_model_type} + *

+ */ + @Nonnull + public final Builder embeddingModelType(@Nullable String value) { + this.embeddingModelType = value; + return this; + } + + /** + * Custom prefix for memory indices. + *

+ * API name: {@code index_prefix} + *

+ */ + @Nonnull + public final Builder indexPrefix(@Nullable String value) { + this.indexPrefix = value; + return this; + } + + /** + * API name: {@code index_settings} + */ + @Nonnull + public final Builder indexSettings(@Nullable IndexSettings value) { + this.indexSettings = value; + return this; + } + + /** + * API name: {@code index_settings} + */ + @Nonnull + public final Builder indexSettings(Function> fn) { + return indexSettings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * The LLM ID. + *

+ * API name: {@code llm_id} + *

+ */ + @Nonnull + public final Builder llmId(@Nullable String value) { + this.llmId = value; + return this; + } + + /** + * The maximum number of similar memories retrieved during consolidation. + *

+ * API name: {@code max_infer_size} + *

+ */ + @Nonnull + public final Builder maxInferSize(@Nullable Long value) { + this.maxInferSize = value; + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds all elements of map to parameters. + *

+ */ + @Nonnull + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); + return this; + } + + /** + * API name: {@code parameters} + * + *

+ * Adds an entry to parameters. + *

+ */ + @Nonnull + public final Builder parameters(String key, JsonData value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; + } + + /** + * API name: {@code strategies} + * + *

+ * Adds all elements of list to strategies. + *

+ */ + @Nonnull + public final Builder strategies(List list) { + this.strategies = _listAddAll(this.strategies, list); + return this; + } + + /** + * API name: {@code strategies} + * + *

+ * Adds one or more values to strategies. + *

+ */ + @Nonnull + public final Builder strategies(Strategy value, Strategy... values) { + this.strategies = _listAdd(this.strategies, value, values); + return this; + } + + /** + * API name: {@code strategies} + * + *

+ * Adds a value to strategies using a builder lambda. + *

+ */ + @Nonnull + public final Builder strategies(Function> fn) { + return strategies(fn.apply(new Strategy.Builder()).build()); + } + + /** + * Whether to use system indices. + *

+ * API name: {@code use_system_index} + *

+ */ + @Nonnull + public final Builder useSystemIndex(@Nullable Boolean value) { + this.useSystemIndex = value; + return this; + } + + /** + * Builds a {@link MemoryContainerConfiguration}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public MemoryContainerConfiguration build() { + _checkSingleUse(); + + return new MemoryContainerConfiguration(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MemoryContainerConfiguration} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + MemoryContainerConfiguration::setupMemoryContainerConfigurationDeserializer + ); + + protected static void setupMemoryContainerConfigurationDeserializer(ObjectDeserializer op) { + op.add(Builder::disableHistory, JsonpDeserializer.booleanDeserializer(), "disable_history"); + op.add(Builder::disableSession, JsonpDeserializer.booleanDeserializer(), "disable_session"); + op.add(Builder::embeddingDimension, JsonpDeserializer.longDeserializer(), "embedding_dimension"); + op.add(Builder::embeddingModelId, JsonpDeserializer.stringDeserializer(), "embedding_model_id"); + op.add(Builder::embeddingModelType, JsonpDeserializer.stringDeserializer(), "embedding_model_type"); + op.add(Builder::indexPrefix, JsonpDeserializer.stringDeserializer(), "index_prefix"); + op.add(Builder::indexSettings, IndexSettings._DESERIALIZER, "index_settings"); + op.add(Builder::llmId, JsonpDeserializer.stringDeserializer(), "llm_id"); + op.add(Builder::maxInferSize, JsonpDeserializer.longDeserializer(), "max_infer_size"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); + op.add(Builder::strategies, JsonpDeserializer.arrayDeserializer(Strategy._DESERIALIZER), "strategies"); + op.add(Builder::useSystemIndex, JsonpDeserializer.booleanDeserializer(), "use_system_index"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.disableHistory); + result = 31 * result + Objects.hashCode(this.disableSession); + result = 31 * result + Objects.hashCode(this.embeddingDimension); + result = 31 * result + Objects.hashCode(this.embeddingModelId); + result = 31 * result + Objects.hashCode(this.embeddingModelType); + result = 31 * result + Objects.hashCode(this.indexPrefix); + result = 31 * result + Objects.hashCode(this.indexSettings); + result = 31 * result + Objects.hashCode(this.llmId); + result = 31 * result + Objects.hashCode(this.maxInferSize); + result = 31 * result + Objects.hashCode(this.parameters); + result = 31 * result + Objects.hashCode(this.strategies); + result = 31 * result + Objects.hashCode(this.useSystemIndex); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + MemoryContainerConfiguration other = (MemoryContainerConfiguration) o; + return Objects.equals(this.disableHistory, other.disableHistory) + && Objects.equals(this.disableSession, other.disableSession) + && Objects.equals(this.embeddingDimension, other.embeddingDimension) + && Objects.equals(this.embeddingModelId, other.embeddingModelId) + && Objects.equals(this.embeddingModelType, other.embeddingModelType) + && Objects.equals(this.indexPrefix, other.indexPrefix) + && Objects.equals(this.indexSettings, other.indexSettings) + && Objects.equals(this.llmId, other.llmId) + && Objects.equals(this.maxInferSize, other.maxInferSize) + && Objects.equals(this.parameters, other.parameters) + && Objects.equals(this.strategies, other.strategies) + && Objects.equals(this.useSystemIndex, other.useSystemIndex); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryIndexSettings.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryIndexSettings.java new file mode 100644 index 0000000000..ad04d232b2 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryIndexSettings.java @@ -0,0 +1,171 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.MemoryIndexSettings + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class MemoryIndexSettings implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Index index; + + // --------------------------------------------------------------------------------------------- + + private MemoryIndexSettings(Builder builder) { + this.index = builder.index; + } + + public static MemoryIndexSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code index} + */ + @Nullable + public final Index index() { + return this.index; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.index != null) { + generator.writeKey("index"); + this.index.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link MemoryIndexSettings}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Index index; + + public Builder() {} + + private Builder(MemoryIndexSettings o) { + this.index = o.index; + } + + private Builder(Builder o) { + this.index = o.index; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code index} + */ + @Nonnull + public final Builder index(@Nullable Index value) { + this.index = value; + return this; + } + + /** + * API name: {@code index} + */ + @Nonnull + public final Builder index(Function> fn) { + return index(fn.apply(new Index.Builder()).build()); + } + + /** + * Builds a {@link MemoryIndexSettings}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public MemoryIndexSettings build() { + _checkSingleUse(); + + return new MemoryIndexSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MemoryIndexSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + MemoryIndexSettings::setupMemoryIndexSettingsDeserializer + ); + + protected static void setupMemoryIndexSettingsDeserializer(ObjectDeserializer op) { + op.add(Builder::index, Index._DESERIALIZER, "index"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.index); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + MemoryIndexSettings other = (MemoryIndexSettings) o; + return Objects.equals(this.index, other.index); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryType.java new file mode 100644 index 0000000000..7774d9f73d --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/MemoryType.java @@ -0,0 +1,43 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: ml.MemoryType + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum MemoryType implements JsonEnum { + History("history"), + + LongTerm("long-term"), + + Sessions("sessions"), + + Working("working"); + + private final String jsonValue; + + MemoryType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(MemoryType.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Message.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Message.java index 8f9597f8e6..4224758da3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Message.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Message.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -41,6 +42,9 @@ public class Message implements PlainJsonSerializable, ToCopyableBuilder additionalInfo; + @Nonnull + private final List content; + @Nullable private final String createTime; @@ -65,6 +69,9 @@ public class Message implements PlainJsonSerializable, ToCopyableBuilder additionalInfo() { return this.additionalInfo; } + /** + * API name: {@code content} + */ + @Nonnull + public final List content() { + return this.content; + } + /** * The create time. *

@@ -177,6 +194,17 @@ public final String response() { return this.response; } + /** + * The role of the message. + *

+ * API name: {@code role} + *

+ */ + @Nullable + public final String role() { + return this.role; + } + /** * The trace number. *

@@ -209,6 +237,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (ApiTypeHelper.isDefined(this.content)) { + generator.writeKey("content"); + generator.writeStartArray(); + for (Content item0 : this.content) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + if (this.createTime != null) { generator.writeKey("create_time"); generator.write(this.createTime); @@ -249,6 +286,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.response); } + if (this.role != null) { + generator.writeKey("role"); + generator.write(this.role); + } + if (this.traceNumber != null) { generator.writeKey("trace_number"); generator.write(this.traceNumber); @@ -275,6 +317,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private Map additionalInfo; @Nullable + private List content; + @Nullable private String createTime; @Nullable private String input; @@ -291,12 +335,15 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private String response; @Nullable + private String role; + @Nullable private Long traceNumber; public Builder() {} private Builder(Message o) { this.additionalInfo = _mapCopy(o.additionalInfo); + this.content = _listCopy(o.content); this.createTime = o.createTime; this.input = o.input; this.memoryId = o.memoryId; @@ -305,11 +352,13 @@ private Builder(Message o) { this.parentMessageId = o.parentMessageId; this.promptTemplate = o.promptTemplate; this.response = o.response; + this.role = o.role; this.traceNumber = o.traceNumber; } private Builder(Builder o) { this.additionalInfo = _mapCopy(o.additionalInfo); + this.content = _listCopy(o.content); this.createTime = o.createTime; this.input = o.input; this.memoryId = o.memoryId; @@ -318,6 +367,7 @@ private Builder(Builder o) { this.parentMessageId = o.parentMessageId; this.promptTemplate = o.promptTemplate; this.response = o.response; + this.role = o.role; this.traceNumber = o.traceNumber; } @@ -353,6 +403,44 @@ public final Builder additionalInfo(String key, JsonData value) { return this; } + /** + * API name: {@code content} + * + *

+ * Adds all elements of list to content. + *

+ */ + @Nonnull + public final Builder content(List list) { + this.content = _listAddAll(this.content, list); + return this; + } + + /** + * API name: {@code content} + * + *

+ * Adds one or more values to content. + *

+ */ + @Nonnull + public final Builder content(Content value, Content... values) { + this.content = _listAdd(this.content, value, values); + return this; + } + + /** + * API name: {@code content} + * + *

+ * Adds a value to content using a builder lambda. + *

+ */ + @Nonnull + public final Builder content(Function> fn) { + return content(fn.apply(new Content.Builder()).build()); + } + /** * The create time. *

@@ -443,6 +531,18 @@ public final Builder response(@Nullable String value) { return this; } + /** + * The role of the message. + *

+ * API name: {@code role} + *

+ */ + @Nonnull + public final Builder role(@Nullable String value) { + this.role = value; + return this; + } + /** * The trace number. *

@@ -481,6 +581,7 @@ public Message build() { protected static void setupMessageDeserializer(ObjectDeserializer op) { op.add(Builder::additionalInfo, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "additional_info"); + op.add(Builder::content, JsonpDeserializer.arrayDeserializer(Content._DESERIALIZER), "content"); op.add(Builder::createTime, JsonpDeserializer.stringDeserializer(), "create_time"); op.add(Builder::input, JsonpDeserializer.stringDeserializer(), "input"); op.add(Builder::memoryId, JsonpDeserializer.stringDeserializer(), "memory_id"); @@ -489,6 +590,7 @@ protected static void setupMessageDeserializer(ObjectDeserializer addAgenticMemory(AddAgenticMemoryRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, AddAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Add agentic memory to a memory container. + * + * @param fn a function that initializes a builder to create the {@link AddAgenticMemoryRequest} + */ + public final CompletableFuture addAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return addAgenticMemory(fn.apply(new AddAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.create_connector /** @@ -110,6 +131,48 @@ public final CompletableFuture createMemory() throws IOExc return createMemory(new CreateMemoryRequest.Builder().build()); } + // ----- Endpoint: ml.create_memory_container + + /** + * Create a memory container. + */ + public CompletableFuture createMemoryContainer(CreateMemoryContainerRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, CreateMemoryContainerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Create a memory container. + * + * @param fn a function that initializes a builder to create the {@link CreateMemoryContainerRequest} + */ + public final CompletableFuture createMemoryContainer( + Function> fn + ) throws IOException, OpenSearchException { + return createMemoryContainer(fn.apply(new CreateMemoryContainerRequest.Builder()).build()); + } + + // ----- Endpoint: ml.create_memory_container_session + + /** + * Create session in a memory container. + */ + public CompletableFuture createMemoryContainerSession(CreateMemoryContainerSessionRequest request) + throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, CreateMemoryContainerSessionRequest._ENDPOINT, this.transportOptions); + } + + /** + * Create session in a memory container. + * + * @param fn a function that initializes a builder to create the {@link CreateMemoryContainerSessionRequest} + */ + public final CompletableFuture createMemoryContainerSession( + Function> fn + ) throws IOException, OpenSearchException { + return createMemoryContainerSession(fn.apply(new CreateMemoryContainerSessionRequest.Builder()).build()); + } + // ----- Endpoint: ml.create_message /** @@ -173,6 +236,48 @@ public final CompletableFuture deleteAgent( return deleteAgent(fn.apply(new DeleteAgentRequest.Builder()).build()); } + // ----- Endpoint: ml.delete_agentic_memory + + /** + * Delete a specific memory by its type and ID. + */ + public CompletableFuture deleteAgenticMemory(DeleteAgenticMemoryRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, DeleteAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete a specific memory by its type and ID. + * + * @param fn a function that initializes a builder to create the {@link DeleteAgenticMemoryRequest} + */ + public final CompletableFuture deleteAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return deleteAgenticMemory(fn.apply(new DeleteAgenticMemoryRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_agentic_memory_query + + /** + * Delete multiple memories using a query to match specific criteria. + */ + public CompletableFuture deleteAgenticMemoryQuery(DeleteAgenticMemoryQueryRequest request) + throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, DeleteAgenticMemoryQueryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete multiple memories using a query to match specific criteria. + * + * @param fn a function that initializes a builder to create the {@link DeleteAgenticMemoryQueryRequest} + */ + public final CompletableFuture deleteAgenticMemoryQuery( + Function> fn + ) throws IOException, OpenSearchException { + return deleteAgenticMemoryQuery(fn.apply(new DeleteAgenticMemoryQueryRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_connector /** @@ -235,6 +340,27 @@ public final CompletableFuture deleteMemory( return deleteMemory(fn.apply(new DeleteMemoryRequest.Builder()).build()); } + // ----- Endpoint: ml.delete_memory_container + + /** + * Delete a memory container. + */ + public CompletableFuture deleteMemoryContainer(DeleteMemoryContainerRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, DeleteMemoryContainerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete a memory container. + * + * @param fn a function that initializes a builder to create the {@link DeleteMemoryContainerRequest} + */ + public final CompletableFuture deleteMemoryContainer( + Function> fn + ) throws IOException, OpenSearchException { + return deleteMemoryContainer(fn.apply(new DeleteMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_model /** @@ -335,6 +461,26 @@ public final CompletableFuture executeAgent( return executeAgent(fn.apply(new ExecuteAgentRequest.Builder()).build()); } + // ----- Endpoint: ml.execute_tool + + /** + * Execute a tool. + */ + public CompletableFuture executeTool(ExecuteToolRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, ExecuteToolRequest._ENDPOINT, this.transportOptions); + } + + /** + * Execute a tool. + * + * @param fn a function that initializes a builder to create the {@link ExecuteToolRequest} + */ + public final CompletableFuture executeTool( + Function> fn + ) throws IOException, OpenSearchException { + return executeTool(fn.apply(new ExecuteToolRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_agent /** @@ -354,6 +500,27 @@ public final CompletableFuture getAgent(Function getAgenticMemory(GetAgenticMemoryRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, GetAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Get a specific memory by its type and ID. + * + * @param fn a function that initializes a builder to create the {@link GetAgenticMemoryRequest} + */ + public final CompletableFuture getAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return getAgenticMemory(fn.apply(new GetAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_all_memories /** @@ -487,6 +654,27 @@ public final CompletableFuture getMemory(Function getMemoryContainer(GetMemoryContainerRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, GetMemoryContainerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Get a memory container. + * + * @param fn a function that initializes a builder to create the {@link GetMemoryContainerRequest} + */ + public final CompletableFuture getMemoryContainer( + Function> fn + ) throws IOException, OpenSearchException { + return getMemoryContainer(fn.apply(new GetMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_message /** @@ -872,6 +1060,27 @@ public final CompletableFuture unloadModel() throws IOExcep return unloadModel(new UnloadModelRequest.Builder().build()); } + // ----- Endpoint: ml.update_agentic_memory + + /** + * Update a specific memory by its type and ID. + */ + public CompletableFuture updateAgenticMemory(UpdateAgenticMemoryRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, UpdateAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Update a specific memory by its type and ID. + * + * @param fn a function that initializes a builder to create the {@link UpdateAgenticMemoryRequest} + */ + public final CompletableFuture updateAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return updateAgenticMemory(fn.apply(new UpdateAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.update_connector /** @@ -934,6 +1143,27 @@ public final CompletableFuture updateMemory( return updateMemory(fn.apply(new UpdateMemoryRequest.Builder()).build()); } + // ----- Endpoint: ml.update_memory_container + + /** + * Update a memory container. + */ + public CompletableFuture updateMemoryContainer(UpdateMemoryContainerRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, UpdateMemoryContainerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Update a memory container. + * + * @param fn a function that initializes a builder to create the {@link UpdateMemoryContainerRequest} + */ + public final CompletableFuture updateMemoryContainer( + Function> fn + ) throws IOException, OpenSearchException { + return updateMemoryContainer(fn.apply(new UpdateMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.update_message /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java index 84927903c5..f8dbb0098d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java @@ -40,6 +40,26 @@ public OpenSearchMlClient withTransportOptions(@Nullable TransportOptions transp return new OpenSearchMlClient(this.transport, transportOptions); } + // ----- Endpoint: ml.add_agentic_memory + + /** + * Add agentic memory to a memory container. + */ + public AddAgenticMemoryResponse addAgenticMemory(AddAgenticMemoryRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, AddAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Add agentic memory to a memory container. + * + * @param fn a function that initializes a builder to create the {@link AddAgenticMemoryRequest} + */ + public final AddAgenticMemoryResponse addAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return addAgenticMemory(fn.apply(new AddAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.create_connector /** @@ -105,6 +125,48 @@ public final CreateMemoryResponse createMemory() throws IOException, OpenSearchE return createMemory(new CreateMemoryRequest.Builder().build()); } + // ----- Endpoint: ml.create_memory_container + + /** + * Create a memory container. + */ + public CreateMemoryContainerResponse createMemoryContainer(CreateMemoryContainerRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequest(request, CreateMemoryContainerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Create a memory container. + * + * @param fn a function that initializes a builder to create the {@link CreateMemoryContainerRequest} + */ + public final CreateMemoryContainerResponse createMemoryContainer( + Function> fn + ) throws IOException, OpenSearchException { + return createMemoryContainer(fn.apply(new CreateMemoryContainerRequest.Builder()).build()); + } + + // ----- Endpoint: ml.create_memory_container_session + + /** + * Create session in a memory container. + */ + public CreateMemoryContainerSessionResponse createMemoryContainerSession(CreateMemoryContainerSessionRequest request) + throws IOException, OpenSearchException { + return this.transport.performRequest(request, CreateMemoryContainerSessionRequest._ENDPOINT, this.transportOptions); + } + + /** + * Create session in a memory container. + * + * @param fn a function that initializes a builder to create the {@link CreateMemoryContainerSessionRequest} + */ + public final CreateMemoryContainerSessionResponse createMemoryContainerSession( + Function> fn + ) throws IOException, OpenSearchException { + return createMemoryContainerSession(fn.apply(new CreateMemoryContainerSessionRequest.Builder()).build()); + } + // ----- Endpoint: ml.create_message /** @@ -164,6 +226,47 @@ public final DeleteAgentResponse deleteAgent(Function> fn + ) throws IOException, OpenSearchException { + return deleteAgenticMemory(fn.apply(new DeleteAgenticMemoryRequest.Builder()).build()); + } + + // ----- Endpoint: ml.delete_agentic_memory_query + + /** + * Delete multiple memories using a query to match specific criteria. + */ + public DeleteAgenticMemoryQueryResponse deleteAgenticMemoryQuery(DeleteAgenticMemoryQueryRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequest(request, DeleteAgenticMemoryQueryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Delete multiple memories using a query to match specific criteria. + * + * @param fn a function that initializes a builder to create the {@link DeleteAgenticMemoryQueryRequest} + */ + public final DeleteAgenticMemoryQueryResponse deleteAgenticMemoryQuery( + Function> fn + ) throws IOException, OpenSearchException { + return deleteAgenticMemoryQuery(fn.apply(new DeleteAgenticMemoryQueryRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_connector /** @@ -222,6 +325,27 @@ public final DeleteMemoryResponse deleteMemory(Function> fn + ) throws IOException, OpenSearchException { + return deleteMemoryContainer(fn.apply(new DeleteMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.delete_model /** @@ -318,6 +442,25 @@ public final ExecuteAgentResponse executeAgent(Function> fn) + throws IOException, OpenSearchException { + return executeTool(fn.apply(new ExecuteToolRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_agent /** @@ -337,6 +480,26 @@ public final GetAgentResponse getAgent(Function> fn + ) throws IOException, OpenSearchException { + return getAgenticMemory(fn.apply(new GetAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_all_memories /** @@ -465,6 +628,26 @@ public final GetMemoryResponse getMemory(Function> fn + ) throws IOException, OpenSearchException { + return getMemoryContainer(fn.apply(new GetMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.get_message /** @@ -839,6 +1022,26 @@ public final UnloadModelResponse unloadModel() throws IOException, OpenSearchExc return unloadModel(new UnloadModelRequest.Builder().build()); } + // ----- Endpoint: ml.update_agentic_memory + + /** + * Update a specific memory by its type and ID. + */ + public UpdateAgenticMemoryResponse updateAgenticMemory(UpdateAgenticMemoryRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, UpdateAgenticMemoryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Update a specific memory by its type and ID. + * + * @param fn a function that initializes a builder to create the {@link UpdateAgenticMemoryRequest} + */ + public final UpdateAgenticMemoryResponse updateAgenticMemory( + Function> fn + ) throws IOException, OpenSearchException { + return updateAgenticMemory(fn.apply(new UpdateAgenticMemoryRequest.Builder()).build()); + } + // ----- Endpoint: ml.update_connector /** @@ -897,6 +1100,27 @@ public final UpdateMemoryResponse updateMemory(Function> fn + ) throws IOException, OpenSearchException { + return updateMemoryContainer(fn.apply(new UpdateMemoryContainerRequest.Builder()).build()); + } + // ----- Endpoint: ml.update_message /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java index 6ae769bb84..0a8793c5b3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java @@ -59,7 +59,7 @@ public class Output implements PlainJsonSerializable, ToCopyableBuilder data() { @@ -140,12 +140,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.byteBuffer.serialize(generator, mapper); } - generator.writeKey("data"); - generator.writeStartArray(); - for (Double item0 : this.data) { - generator.write(item0); + if (ApiTypeHelper.isDefined(this.data)) { + generator.writeKey("data"); + generator.writeStartArray(); + for (Double item0 : this.data) { + generator.write(item0); + } + generator.writeEnd(); } - generator.writeEnd(); if (this.dataType != null) { generator.writeKey("data_type"); @@ -191,6 +193,7 @@ public static Builder builder() { public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private ByteBuffer byteBuffer; + @Nullable private List data; @Nullable private MlResultDataType dataType; @@ -245,7 +248,7 @@ public final Builder byteBuffer(Function * Adds all elements of list to data. @@ -258,7 +261,7 @@ public final Builder data(List list) { } /** - * Required - API name: {@code data} + * API name: {@code data} * *

* Adds one or more values to data. @@ -366,7 +369,7 @@ protected static void setupOutputDeserializer(ObjectDeserializer public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.byteBuffer); - result = 31 * result + this.data.hashCode(); + result = 31 * result + Objects.hashCode(this.data); result = 31 * result + Objects.hashCode(this.dataType); result = 31 * result + Objects.hashCode(this.name); result = 31 * result + Objects.hashCode(this.result); @@ -380,7 +383,7 @@ public boolean equals(Object o) { if (o == null || this.getClass() != o.getClass()) return false; Output other = (Output) o; return Objects.equals(this.byteBuffer, other.byteBuffer) - && this.data.equals(other.data) + && Objects.equals(this.data, other.data) && Objects.equals(this.dataType, other.dataType) && Objects.equals(this.name, other.name) && Objects.equals(this.result, other.result) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java index 3075afda05..1400f95768 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java @@ -52,6 +52,9 @@ public class Owner implements PlainJsonSerializable, ToCopyableBuilder> fn) { @@ -118,6 +122,17 @@ public final String userRequestedTenant() { return this.userRequestedTenant; } + /** + * The user requested tenant access. + *

+ * API name: {@code user_requested_tenant_access} + *

+ */ + @Nullable + public final String userRequestedTenantAccess() { + return this.userRequestedTenantAccess; + } + /** * Serialize this object to JSON. */ @@ -163,6 +178,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("user_requested_tenant"); generator.write(this.userRequestedTenant); } + + if (this.userRequestedTenantAccess != null) { + generator.writeKey("user_requested_tenant_access"); + generator.write(this.userRequestedTenantAccess); + } } // --------------------------------------------------------------------------------------------- @@ -191,6 +211,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder private List roles; @Nullable private String userRequestedTenant; + @Nullable + private String userRequestedTenantAccess; public Builder() {} @@ -200,6 +222,7 @@ private Builder(Owner o) { this.name = o.name; this.roles = _listCopy(o.roles); this.userRequestedTenant = o.userRequestedTenant; + this.userRequestedTenantAccess = o.userRequestedTenantAccess; } private Builder(Builder o) { @@ -208,6 +231,7 @@ private Builder(Builder o) { this.name = o.name; this.roles = _listCopy(o.roles); this.userRequestedTenant = o.userRequestedTenant; + this.userRequestedTenantAccess = o.userRequestedTenantAccess; } @Override @@ -333,6 +357,18 @@ public final Builder userRequestedTenant(@Nullable String value) { return this; } + /** + * The user requested tenant access. + *

+ * API name: {@code user_requested_tenant_access} + *

+ */ + @Nonnull + public final Builder userRequestedTenantAccess(@Nullable String value) { + this.userRequestedTenantAccess = value; + return this; + } + /** * Builds a {@link Owner}. * @@ -367,6 +403,7 @@ protected static void setupOwnerDeserializer(ObjectDeserializer o op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(Builder::roles, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "roles"); op.add(Builder::userRequestedTenant, JsonpDeserializer.stringDeserializer(), "user_requested_tenant"); + op.add(Builder::userRequestedTenantAccess, JsonpDeserializer.stringDeserializer(), "user_requested_tenant_access"); } @Override @@ -377,6 +414,7 @@ public int hashCode() { result = 31 * result + this.name.hashCode(); result = 31 * result + Objects.hashCode(this.roles); result = 31 * result + Objects.hashCode(this.userRequestedTenant); + result = 31 * result + Objects.hashCode(this.userRequestedTenantAccess); return result; } @@ -389,6 +427,7 @@ public boolean equals(Object o) { && Objects.equals(this.customAttributeNames, other.customAttributeNames) && this.name.equals(other.name) && Objects.equals(this.roles, other.roles) - && Objects.equals(this.userRequestedTenant, other.userRequestedTenant); + && Objects.equals(this.userRequestedTenant, other.userRequestedTenant) + && Objects.equals(this.userRequestedTenantAccess, other.userRequestedTenantAccess); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PayloadType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PayloadType.java new file mode 100644 index 0000000000..2c7d936ca4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PayloadType.java @@ -0,0 +1,42 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: ml.PayloadType + +/** + * The type of payload. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum PayloadType implements JsonEnum { + Conversational("conversational"), + + Data("data"); + + private final String jsonValue; + + PayloadType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(PayloadType.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Strategy.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Strategy.java new file mode 100644 index 0000000000..4974d8faf4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Strategy.java @@ -0,0 +1,347 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.Strategy + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Strategy implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final StrategyConfiguration configuration; + + @Nullable + private final Boolean enabled; + + @Nullable + private final String id; + + @Nonnull + private final List namespace; + + @Nullable + private final StrategyType type; + + // --------------------------------------------------------------------------------------------- + + private Strategy(Builder builder) { + this.configuration = builder.configuration; + this.enabled = builder.enabled; + this.id = builder.id; + this.namespace = ApiTypeHelper.unmodifiable(builder.namespace); + this.type = builder.type; + } + + public static Strategy of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code configuration} + */ + @Nullable + public final StrategyConfiguration configuration() { + return this.configuration; + } + + /** + * Whether to enable the strategy. + *

+ * API name: {@code enabled} + *

+ */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * The strategy ID. + *

+ * API name: {@code id} + *

+ */ + @Nullable + public final String id() { + return this.id; + } + + /** + * The namespace. + *

+ * API name: {@code namespace} + *

+ */ + @Nonnull + public final List namespace() { + return this.namespace; + } + + /** + * API name: {@code type} + */ + @Nullable + public final StrategyType type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.configuration != null) { + generator.writeKey("configuration"); + this.configuration.serialize(generator, mapper); + } + + if (this.enabled != null) { + generator.writeKey("enabled"); + generator.write(this.enabled); + } + + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); + } + + if (ApiTypeHelper.isDefined(this.namespace)) { + generator.writeKey("namespace"); + generator.writeStartArray(); + for (String item0 : this.namespace) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (this.type != null) { + generator.writeKey("type"); + this.type.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Strategy}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private StrategyConfiguration configuration; + @Nullable + private Boolean enabled; + @Nullable + private String id; + @Nullable + private List namespace; + @Nullable + private StrategyType type; + + public Builder() {} + + private Builder(Strategy o) { + this.configuration = o.configuration; + this.enabled = o.enabled; + this.id = o.id; + this.namespace = _listCopy(o.namespace); + this.type = o.type; + } + + private Builder(Builder o) { + this.configuration = o.configuration; + this.enabled = o.enabled; + this.id = o.id; + this.namespace = _listCopy(o.namespace); + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(@Nullable StrategyConfiguration value) { + this.configuration = value; + return this; + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(Function> fn) { + return configuration(fn.apply(new StrategyConfiguration.Builder()).build()); + } + + /** + * Whether to enable the strategy. + *

+ * API name: {@code enabled} + *

+ */ + @Nonnull + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * The strategy ID. + *

+ * API name: {@code id} + *

+ */ + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; + return this; + } + + /** + * The namespace. + *

+ * API name: {@code namespace} + *

+ * + *

+ * Adds all elements of list to namespace. + *

+ */ + @Nonnull + public final Builder namespace(List list) { + this.namespace = _listAddAll(this.namespace, list); + return this; + } + + /** + * The namespace. + *

+ * API name: {@code namespace} + *

+ * + *

+ * Adds one or more values to namespace. + *

+ */ + @Nonnull + public final Builder namespace(String value, String... values) { + this.namespace = _listAdd(this.namespace, value, values); + return this; + } + + /** + * API name: {@code type} + */ + @Nonnull + public final Builder type(@Nullable StrategyType value) { + this.type = value; + return this; + } + + /** + * Builds a {@link Strategy}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Strategy build() { + _checkSingleUse(); + + return new Strategy(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Strategy} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Strategy::setupStrategyDeserializer + ); + + protected static void setupStrategyDeserializer(ObjectDeserializer op) { + op.add(Builder::configuration, StrategyConfiguration._DESERIALIZER, "configuration"); + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::namespace, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "namespace"); + op.add(Builder::type, StrategyType._DESERIALIZER, "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.configuration); + result = 31 * result + Objects.hashCode(this.enabled); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.namespace); + result = 31 * result + Objects.hashCode(this.type); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Strategy other = (Strategy) o; + return Objects.equals(this.configuration, other.configuration) + && Objects.equals(this.enabled, other.enabled) + && Objects.equals(this.id, other.id) + && Objects.equals(this.namespace, other.namespace) + && Objects.equals(this.type, other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyConfiguration.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyConfiguration.java new file mode 100644 index 0000000000..b4ff3844f9 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyConfiguration.java @@ -0,0 +1,250 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.StrategyConfiguration + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class StrategyConfiguration + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String llmId; + + @Nullable + private final String llmResultPath; + + @Nullable + private final String systemPrompt; + + // --------------------------------------------------------------------------------------------- + + private StrategyConfiguration(Builder builder) { + this.llmId = builder.llmId; + this.llmResultPath = builder.llmResultPath; + this.systemPrompt = builder.systemPrompt; + } + + public static StrategyConfiguration of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The LLM ID for strategy. + *

+ * API name: {@code llm_id} + *

+ */ + @Nullable + public final String llmId() { + return this.llmId; + } + + /** + * JSONPath expression for extracting LLM results from responses. + *

+ * API name: {@code llm_result_path} + *

+ */ + @Nullable + public final String llmResultPath() { + return this.llmResultPath; + } + + /** + * Custom system prompt to override default strategy prompt. + *

+ * API name: {@code system_prompt} + *

+ */ + @Nullable + public final String systemPrompt() { + return this.systemPrompt; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.llmId != null) { + generator.writeKey("llm_id"); + generator.write(this.llmId); + } + + if (this.llmResultPath != null) { + generator.writeKey("llm_result_path"); + generator.write(this.llmResultPath); + } + + if (this.systemPrompt != null) { + generator.writeKey("system_prompt"); + generator.write(this.systemPrompt); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link StrategyConfiguration}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String llmId; + @Nullable + private String llmResultPath; + @Nullable + private String systemPrompt; + + public Builder() {} + + private Builder(StrategyConfiguration o) { + this.llmId = o.llmId; + this.llmResultPath = o.llmResultPath; + this.systemPrompt = o.systemPrompt; + } + + private Builder(Builder o) { + this.llmId = o.llmId; + this.llmResultPath = o.llmResultPath; + this.systemPrompt = o.systemPrompt; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The LLM ID for strategy. + *

+ * API name: {@code llm_id} + *

+ */ + @Nonnull + public final Builder llmId(@Nullable String value) { + this.llmId = value; + return this; + } + + /** + * JSONPath expression for extracting LLM results from responses. + *

+ * API name: {@code llm_result_path} + *

+ */ + @Nonnull + public final Builder llmResultPath(@Nullable String value) { + this.llmResultPath = value; + return this; + } + + /** + * Custom system prompt to override default strategy prompt. + *

+ * API name: {@code system_prompt} + *

+ */ + @Nonnull + public final Builder systemPrompt(@Nullable String value) { + this.systemPrompt = value; + return this; + } + + /** + * Builds a {@link StrategyConfiguration}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public StrategyConfiguration build() { + _checkSingleUse(); + + return new StrategyConfiguration(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link StrategyConfiguration} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + StrategyConfiguration::setupStrategyConfigurationDeserializer + ); + + protected static void setupStrategyConfigurationDeserializer(ObjectDeserializer op) { + op.add(Builder::llmId, JsonpDeserializer.stringDeserializer(), "llm_id"); + op.add(Builder::llmResultPath, JsonpDeserializer.stringDeserializer(), "llm_result_path"); + op.add(Builder::systemPrompt, JsonpDeserializer.stringDeserializer(), "system_prompt"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.llmId); + result = 31 * result + Objects.hashCode(this.llmResultPath); + result = 31 * result + Objects.hashCode(this.systemPrompt); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + StrategyConfiguration other = (StrategyConfiguration) o; + return Objects.equals(this.llmId, other.llmId) + && Objects.equals(this.llmResultPath, other.llmResultPath) + && Objects.equals(this.systemPrompt, other.systemPrompt); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyType.java new file mode 100644 index 0000000000..6354f5e4e0 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/StrategyType.java @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: ml.StrategyType + +/** + * The strategy type. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum StrategyType implements JsonEnum { + Semantic("SEMANTIC"), + + Summary("SUMMARY"), + + UserPreference("USER_PREFERENCE"); + + private final String jsonValue; + + StrategyType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(StrategyType.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolName.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolName.java index c2a32af31b..dd1000804a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolName.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolName.java @@ -41,8 +41,12 @@ public enum ToolName implements JsonEnum { PplTool("PPLTool"), + QueryPlanningTool("QueryPlanningTool"), + RagTool("RAGTool"), + ReadFromScratchPadTool("ReadFromScratchPadTool"), + SearchAlertsTool("SearchAlertsTool"), SearchAnomalyDetectorsTool("SearchAnomalyDetectorsTool"), @@ -55,7 +59,9 @@ public enum ToolName implements JsonEnum { VectorDbTool("VectorDBTool"), - VisualizationTool("VisualizationTool"); + VisualizationTool("VisualizationTool"), + + WriteToScratchPadTool("WriteToScratchPadTool"); private final String jsonValue; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryRequest.java new file mode 100644 index 0000000000..c055043dfd --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryRequest.java @@ -0,0 +1,739 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.update_agentic_memory.Request + +/** + * Update a specific memory by its type and ID. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class UpdateAgenticMemoryRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final Map additionalInfo; + + @Nonnull + private final Map agents; + + @Nonnull + private final Map binaryData; + + @Nonnull + private final String id; + + @Nullable + private final String memory; + + @Nonnull + private final String memoryContainerId; + + @Nonnull + private final List messages; + + @Nonnull + private final Map metadata; + + @Nonnull + private final Map structuredData; + + @Nullable + private final String summary; + + @Nonnull + private final Map tags; + + @Nonnull + private final MemoryType type; + + // --------------------------------------------------------------------------------------------- + + private UpdateAgenticMemoryRequest(Builder builder) { + super(builder); + this.additionalInfo = ApiTypeHelper.unmodifiable(builder.additionalInfo); + this.agents = ApiTypeHelper.unmodifiable(builder.agents); + this.binaryData = ApiTypeHelper.unmodifiable(builder.binaryData); + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.memory = builder.memory; + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.messages = ApiTypeHelper.unmodifiable(builder.messages); + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.structuredData = ApiTypeHelper.unmodifiable(builder.structuredData); + this.summary = builder.summary; + this.tags = ApiTypeHelper.unmodifiable(builder.tags); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static UpdateAgenticMemoryRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code additional_info} + */ + @Nonnull + public final Map additionalInfo() { + return this.additionalInfo; + } + + /** + * API name: {@code agents} + */ + @Nonnull + public final Map agents() { + return this.agents; + } + + /** + * API name: {@code binary_data} + */ + @Nonnull + public final Map binaryData() { + return this.binaryData; + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final String id() { + return this.id; + } + + /** + * The updated memory content. + *

+ * API name: {@code memory} + *

+ */ + @Nullable + public final String memory() { + return this.memory; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code messages} + */ + @Nonnull + public final List messages() { + return this.messages; + } + + /** + * API name: {@code metadata} + */ + @Nonnull + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code structured_data} + */ + @Nonnull + public final Map structuredData() { + return this.structuredData; + } + + /** + * The summary of the session. + *

+ * API name: {@code summary} + *

+ */ + @Nullable + public final String summary() { + return this.summary; + } + + /** + * API name: {@code tags} + */ + @Nonnull + public final Map tags() { + return this.tags; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final MemoryType type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.additionalInfo)) { + generator.writeKey("additional_info"); + generator.writeStartObject(); + for (Map.Entry item0 : this.additionalInfo.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.agents)) { + generator.writeKey("agents"); + generator.writeStartObject(); + for (Map.Entry item0 : this.agents.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.binaryData)) { + generator.writeKey("binary_data"); + generator.writeStartObject(); + for (Map.Entry item0 : this.binaryData.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.memory != null) { + generator.writeKey("memory"); + generator.write(this.memory); + } + + if (ApiTypeHelper.isDefined(this.messages)) { + generator.writeKey("messages"); + generator.writeStartArray(); + for (Message item0 : this.messages) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.metadata)) { + generator.writeKey("metadata"); + generator.writeStartObject(); + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.structuredData)) { + generator.writeKey("structured_data"); + generator.writeStartObject(); + for (Map.Entry item0 : this.structuredData.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.summary != null) { + generator.writeKey("summary"); + generator.write(this.summary); + } + + if (ApiTypeHelper.isDefined(this.tags)) { + generator.writeKey("tags"); + generator.writeStartObject(); + for (Map.Entry item0 : this.tags.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link UpdateAgenticMemoryRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private Map additionalInfo; + @Nullable + private Map agents; + @Nullable + private Map binaryData; + private String id; + @Nullable + private String memory; + private String memoryContainerId; + @Nullable + private List messages; + @Nullable + private Map metadata; + @Nullable + private Map structuredData; + @Nullable + private String summary; + @Nullable + private Map tags; + private MemoryType type; + + public Builder() {} + + private Builder(UpdateAgenticMemoryRequest o) { + super(o); + this.additionalInfo = _mapCopy(o.additionalInfo); + this.agents = _mapCopy(o.agents); + this.binaryData = _mapCopy(o.binaryData); + this.id = o.id; + this.memory = o.memory; + this.memoryContainerId = o.memoryContainerId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.structuredData = _mapCopy(o.structuredData); + this.summary = o.summary; + this.tags = _mapCopy(o.tags); + this.type = o.type; + } + + private Builder(Builder o) { + super(o); + this.additionalInfo = _mapCopy(o.additionalInfo); + this.agents = _mapCopy(o.agents); + this.binaryData = _mapCopy(o.binaryData); + this.id = o.id; + this.memory = o.memory; + this.memoryContainerId = o.memoryContainerId; + this.messages = _listCopy(o.messages); + this.metadata = _mapCopy(o.metadata); + this.structuredData = _mapCopy(o.structuredData); + this.summary = o.summary; + this.tags = _mapCopy(o.tags); + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code additional_info} + * + *

+ * Adds all elements of map to additionalInfo. + *

+ */ + @Nonnull + public final Builder additionalInfo(Map map) { + this.additionalInfo = _mapPutAll(this.additionalInfo, map); + return this; + } + + /** + * API name: {@code additional_info} + * + *

+ * Adds an entry to additionalInfo. + *

+ */ + @Nonnull + public final Builder additionalInfo(String key, JsonData value) { + this.additionalInfo = _mapPut(this.additionalInfo, key, value); + return this; + } + + /** + * API name: {@code agents} + * + *

+ * Adds all elements of map to agents. + *

+ */ + @Nonnull + public final Builder agents(Map map) { + this.agents = _mapPutAll(this.agents, map); + return this; + } + + /** + * API name: {@code agents} + * + *

+ * Adds an entry to agents. + *

+ */ + @Nonnull + public final Builder agents(String key, JsonData value) { + this.agents = _mapPut(this.agents, key, value); + return this; + } + + /** + * API name: {@code binary_data} + * + *

+ * Adds all elements of map to binaryData. + *

+ */ + @Nonnull + public final Builder binaryData(Map map) { + this.binaryData = _mapPutAll(this.binaryData, map); + return this; + } + + /** + * API name: {@code binary_data} + * + *

+ * Adds an entry to binaryData. + *

+ */ + @Nonnull + public final Builder binaryData(String key, JsonData value) { + this.binaryData = _mapPut(this.binaryData, key, value); + return this; + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * The updated memory content. + *

+ * API name: {@code memory} + *

+ */ + @Nonnull + public final Builder memory(@Nullable String value) { + this.memory = value; + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds all elements of list to messages. + *

+ */ + @Nonnull + public final Builder messages(List list) { + this.messages = _listAddAll(this.messages, list); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds one or more values to messages. + *

+ */ + @Nonnull + public final Builder messages(Message value, Message... values) { + this.messages = _listAdd(this.messages, value, values); + return this; + } + + /** + * API name: {@code messages} + * + *

+ * Adds a value to messages using a builder lambda. + *

+ */ + @Nonnull + public final Builder messages(Function> fn) { + return messages(fn.apply(new Message.Builder()).build()); + } + + /** + * API name: {@code metadata} + * + *

+ * Adds all elements of map to metadata. + *

+ */ + @Nonnull + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * API name: {@code metadata} + * + *

+ * Adds an entry to metadata. + *

+ */ + @Nonnull + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code structured_data} + * + *

+ * Adds all elements of map to structuredData. + *

+ */ + @Nonnull + public final Builder structuredData(Map map) { + this.structuredData = _mapPutAll(this.structuredData, map); + return this; + } + + /** + * API name: {@code structured_data} + * + *

+ * Adds an entry to structuredData. + *

+ */ + @Nonnull + public final Builder structuredData(String key, JsonData value) { + this.structuredData = _mapPut(this.structuredData, key, value); + return this; + } + + /** + * The summary of the session. + *

+ * API name: {@code summary} + *

+ */ + @Nonnull + public final Builder summary(@Nullable String value) { + this.summary = value; + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds all elements of map to tags. + *

+ */ + @Nonnull + public final Builder tags(Map map) { + this.tags = _mapPutAll(this.tags, map); + return this; + } + + /** + * API name: {@code tags} + * + *

+ * Adds an entry to tags. + *

+ */ + @Nonnull + public final Builder tags(String key, JsonData value) { + this.tags = _mapPut(this.tags, key, value); + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(MemoryType value) { + this.type = value; + return this; + } + + /** + * Builds a {@link UpdateAgenticMemoryRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public UpdateAgenticMemoryRequest build() { + _checkSingleUse(); + + return new UpdateAgenticMemoryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateAgenticMemoryRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + UpdateAgenticMemoryRequest::setupUpdateAgenticMemoryRequestDeserializer + ); + + protected static void setupUpdateAgenticMemoryRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::additionalInfo, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "additional_info"); + op.add(Builder::agents, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "agents"); + op.add(Builder::binaryData, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "binary_data"); + op.add(Builder::memory, JsonpDeserializer.stringDeserializer(), "memory"); + op.add(Builder::messages, JsonpDeserializer.arrayDeserializer(Message._DESERIALIZER), "messages"); + op.add(Builder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); + op.add(Builder::structuredData, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "structured_data"); + op.add(Builder::summary, JsonpDeserializer.stringDeserializer(), "summary"); + op.add(Builder::tags, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "tags"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.update_agentic_memory}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "PUT", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + buf.append("/memories/"); + SimpleEndpoint.pathEncode(request.type.jsonValue(), buf); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + UpdateAgenticMemoryResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.additionalInfo); + result = 31 * result + Objects.hashCode(this.agents); + result = 31 * result + Objects.hashCode(this.binaryData); + result = 31 * result + this.id.hashCode(); + result = 31 * result + Objects.hashCode(this.memory); + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + Objects.hashCode(this.messages); + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.structuredData); + result = 31 * result + Objects.hashCode(this.summary); + result = 31 * result + Objects.hashCode(this.tags); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + UpdateAgenticMemoryRequest other = (UpdateAgenticMemoryRequest) o; + return Objects.equals(this.additionalInfo, other.additionalInfo) + && Objects.equals(this.agents, other.agents) + && Objects.equals(this.binaryData, other.binaryData) + && this.id.equals(other.id) + && Objects.equals(this.memory, other.memory) + && this.memoryContainerId.equals(other.memoryContainerId) + && Objects.equals(this.messages, other.messages) + && Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.structuredData, other.structuredData) + && Objects.equals(this.summary, other.summary) + && Objects.equals(this.tags, other.tags) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryResponse.java new file mode 100644 index 0000000000..3f341b7372 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateAgenticMemoryResponse.java @@ -0,0 +1,132 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.update_agentic_memory.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class UpdateAgenticMemoryResponse extends WriteResponseBase + implements + ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private UpdateAgenticMemoryResponse(Builder builder) { + super(builder); + } + + public static UpdateAgenticMemoryResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link UpdateAgenticMemoryResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(UpdateAgenticMemoryResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Builds a {@link UpdateAgenticMemoryResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public UpdateAgenticMemoryResponse build() { + _checkSingleUse(); + + return new UpdateAgenticMemoryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateAgenticMemoryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + UpdateAgenticMemoryResponse::setupUpdateAgenticMemoryResponseDeserializer + ); + + protected static void setupUpdateAgenticMemoryResponseDeserializer(ObjectDeserializer op) { + setupWriteResponseBaseDeserializer(op); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + return true; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerRequest.java new file mode 100644 index 0000000000..2768bc3940 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerRequest.java @@ -0,0 +1,315 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.update_memory_container.Request + +/** + * Update a memory container. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class UpdateMemoryContainerRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final MemoryContainerConfiguration configuration; + + @Nullable + private final String description; + + @Nonnull + private final String memoryContainerId; + + @Nullable + private final String name; + + // --------------------------------------------------------------------------------------------- + + private UpdateMemoryContainerRequest(Builder builder) { + super(builder); + this.configuration = builder.configuration; + this.description = builder.description; + this.memoryContainerId = ApiTypeHelper.requireNonNull(builder.memoryContainerId, this, "memoryContainerId"); + this.name = builder.name; + } + + public static UpdateMemoryContainerRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code configuration} + */ + @Nullable + public final MemoryContainerConfiguration configuration() { + return this.configuration; + } + + /** + * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final String memoryContainerId() { + return this.memoryContainerId; + } + + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.configuration != null) { + generator.writeKey("configuration"); + this.configuration.serialize(generator, mapper); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link UpdateMemoryContainerRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private MemoryContainerConfiguration configuration; + @Nullable + private String description; + private String memoryContainerId; + @Nullable + private String name; + + public Builder() {} + + private Builder(UpdateMemoryContainerRequest o) { + super(o); + this.configuration = o.configuration; + this.description = o.description; + this.memoryContainerId = o.memoryContainerId; + this.name = o.name; + } + + private Builder(Builder o) { + super(o); + this.configuration = o.configuration; + this.description = o.description; + this.memoryContainerId = o.memoryContainerId; + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(@Nullable MemoryContainerConfiguration value) { + this.configuration = value; + return this; + } + + /** + * API name: {@code configuration} + */ + @Nonnull + public final Builder configuration(Function> fn) { + return configuration(fn.apply(new MemoryContainerConfiguration.Builder()).build()); + } + + /** + * API name: {@code description} + */ + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + + /** + * Required - API name: {@code memory_container_id} + */ + @Nonnull + public final Builder memoryContainerId(String value) { + this.memoryContainerId = value; + return this; + } + + /** + * API name: {@code name} + */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * Builds a {@link UpdateMemoryContainerRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public UpdateMemoryContainerRequest build() { + _checkSingleUse(); + + return new UpdateMemoryContainerRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateMemoryContainerRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + UpdateMemoryContainerRequest::setupUpdateMemoryContainerRequestDeserializer + ); + + protected static void setupUpdateMemoryContainerRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::configuration, MemoryContainerConfiguration._DESERIALIZER, "configuration"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.update_memory_container}". + */ + public static final Endpoint _ENDPOINT = + new SimpleEndpoint<>( + // Request method + request -> "PUT", + // Request path + request -> { + StringBuilder buf = new StringBuilder(); + buf.append("/_plugins/_ml/memory_containers/"); + SimpleEndpoint.pathEncode(request.memoryContainerId, buf); + return buf.toString(); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + UpdateMemoryContainerResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.configuration); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + this.memoryContainerId.hashCode(); + result = 31 * result + Objects.hashCode(this.name); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + UpdateMemoryContainerRequest other = (UpdateMemoryContainerRequest) o; + return Objects.equals(this.configuration, other.configuration) + && Objects.equals(this.description, other.description) + && this.memoryContainerId.equals(other.memoryContainerId) + && Objects.equals(this.name, other.name); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerResponse.java new file mode 100644 index 0000000000..e6d6c05b3f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UpdateMemoryContainerResponse.java @@ -0,0 +1,132 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ml.update_memory_container.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class UpdateMemoryContainerResponse extends WriteResponseBase + implements + ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private UpdateMemoryContainerResponse(Builder builder) { + super(builder); + } + + public static UpdateMemoryContainerResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link UpdateMemoryContainerResponse}. + */ + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(UpdateMemoryContainerResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Builds a {@link UpdateMemoryContainerResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public UpdateMemoryContainerResponse build() { + _checkSingleUse(); + + return new UpdateMemoryContainerResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateMemoryContainerResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + UpdateMemoryContainerResponse::setupUpdateMemoryContainerResponseDeserializer + ); + + protected static void setupUpdateMemoryContainerResponseDeserializer(ObjectDeserializer op) { + setupWriteResponseBaseDeserializer(op); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + return true; + } +} diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index efed1fcfff..0a241d0dbf 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -5960,6 +5960,234 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/memory_containers/_create: + post: + operationId: ml.create_memory_container.0 + x-operation-group: ml.create_memory_container + x-version-added: '3.3' + description: Create a memory container. + requestBody: + $ref: '#/components/requestBodies/ml.create_memory_container' + responses: + '200': + $ref: '#/components/responses/ml.create_memory_container___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/memory_containers/_search: + get: + operationId: ml.search_memory_container.1 + x-operation-group: ml.search_memory_container + x-version-added: '3.3' + description: Search memory containers. + requestBody: + $ref: '#/components/requestBodies/ml.search_memory_container' + responses: + '200': + $ref: '#/components/responses/ml.search_memory_container___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: ml.search_memory_container.0 + x-operation-group: ml.search_memory_container + x-version-added: '3.3' + description: Search memory containers. + requestBody: + $ref: '#/components/requestBodies/ml.search_memory_container' + responses: + '200': + $ref: '#/components/responses/ml.search_memory_container___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/memory_containers/{memory_container_id}: + delete: + operationId: ml.delete_memory_container.0 + x-operation-group: ml.delete_memory_container + x-version-added: '3.3' + description: Delete a memory container. + parameters: + - $ref: '#/components/parameters/ml.delete_memory_container___path.memory_container_id' + - $ref: '#/components/parameters/ml.delete_memory_container___query.delete_all_memories' + - $ref: '#/components/parameters/ml.delete_memory_container___query.delete_memories' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.delete_memory_container___200' + get: + operationId: ml.get_memory_container.0 + x-operation-group: ml.get_memory_container + x-version-added: '3.3' + description: Get a memory container. + parameters: + - $ref: '#/components/parameters/ml.get_memory_container___path.memory_container_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.get_memory_container___200' + put: + operationId: ml.update_memory_container.0 + x-operation-group: ml.update_memory_container + x-version-added: '3.3' + description: Update a memory container. + parameters: + - $ref: '#/components/parameters/ml.update_memory_container___path.memory_container_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.update_memory_container' + responses: + '200': + $ref: '#/components/responses/ml.update_memory_container___200' + /_plugins/_ml/memory_containers/{memory_container_id}/memories: + post: + operationId: ml.add_agentic_memory.0 + x-operation-group: ml.add_agentic_memory + x-version-added: '3.3' + description: Add agentic memory to a memory container. + parameters: + - $ref: '#/components/parameters/ml.add_agentic_memory___path.memory_container_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.add_agentic_memory' + responses: + '200': + $ref: '#/components/responses/ml.add_agentic_memory___200' + /_plugins/_ml/memory_containers/{memory_container_id}/memories/{type}/_delete_by_query: + post: + operationId: ml.delete_agentic_memory_query.0 + x-operation-group: ml.delete_agentic_memory_query + x-version-added: '3.3' + description: Delete multiple memories using a query to match specific criteria. + parameters: + - $ref: '#/components/parameters/ml.delete_agentic_memory_query___path.memory_container_id' + - $ref: '#/components/parameters/ml.delete_agentic_memory_query___path.type' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.delete_agentic_memory_query' + responses: + '200': + $ref: '#/components/responses/ml.delete_agentic_memory_query___200' + /_plugins/_ml/memory_containers/{memory_container_id}/memories/{type}/_search: + get: + operationId: ml.search_agentic_memory.0 + x-operation-group: ml.search_agentic_memory + x-version-added: '3.3' + description: Search for memories of a specific type within a memory container. + parameters: + - $ref: '#/components/parameters/ml.search_agentic_memory___path.memory_container_id' + - $ref: '#/components/parameters/ml.search_agentic_memory___path.type' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.search_agentic_memory' + responses: + '200': + $ref: '#/components/responses/ml.search_agentic_memory___200' + /_plugins/_ml/memory_containers/{memory_container_id}/memories/{type}/{id}: + delete: + operationId: ml.delete_agentic_memory.0 + x-operation-group: ml.delete_agentic_memory + x-version-added: '3.3' + description: Delete a specific memory by its type and ID. + parameters: + - $ref: '#/components/parameters/ml.delete_agentic_memory___path.id' + - $ref: '#/components/parameters/ml.delete_agentic_memory___path.memory_container_id' + - $ref: '#/components/parameters/ml.delete_agentic_memory___path.type' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.delete_agentic_memory___200' + get: + operationId: ml.get_agentic_memory.0 + x-operation-group: ml.get_agentic_memory + x-version-added: '3.3' + description: Get a specific memory by its type and ID. + parameters: + - $ref: '#/components/parameters/ml.get_agentic_memory___path.id' + - $ref: '#/components/parameters/ml.get_agentic_memory___path.memory_container_id' + - $ref: '#/components/parameters/ml.get_agentic_memory___path.type' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.get_agentic_memory___200' + put: + operationId: ml.update_agentic_memory.0 + x-operation-group: ml.update_agentic_memory + x-version-added: '3.3' + description: Update a specific memory by its type and ID. + parameters: + - $ref: '#/components/parameters/ml.update_agentic_memory___path.id' + - $ref: '#/components/parameters/ml.update_agentic_memory___path.memory_container_id' + - $ref: '#/components/parameters/ml.update_agentic_memory___path.type' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.update_agentic_memory' + responses: + '200': + $ref: '#/components/responses/ml.update_agentic_memory___200' + /_plugins/_ml/memory_containers/{memory_container_id}/memories/sessions: + post: + operationId: ml.create_memory_container_session.0 + x-operation-group: ml.create_memory_container_session + x-version-added: '3.3' + description: Create session in a memory container. + parameters: + - $ref: '#/components/parameters/ml.create_memory_container_session___path.memory_container_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.create_memory_container_session' + responses: + '200': + $ref: '#/components/responses/ml.create_memory_container_session___200' /_plugins/_ml/memory/_search: get: operationId: ml.search_memory.0 @@ -6773,6 +7001,24 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/tools/_execute/{tool_name}: + post: + operationId: ml.execute_tool.0 + x-operation-group: ml.execute_tool + x-version-added: '3.3' + description: Execute a tool. + parameters: + - $ref: '#/components/parameters/ml.execute_tool___path.tool_name' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.execute_tool' + responses: + '200': + $ref: '#/components/responses/ml.execute_tool___200' /_plugins/_ml/tools/{tool_name}: get: operationId: ml.get_tool.0 @@ -25995,6 +26241,12 @@ components: schema: $ref: '#/components/schemas/_common___Fields' style: form + ml.add_agentic_memory___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string ml.chunk_model___path.chunk_number: name: chunk_number in: path @@ -26014,6 +26266,12 @@ components: required: true schema: type: string + ml.create_memory_container_session___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string ml.create_message___path.memory_id: name: memory_id in: path @@ -26026,6 +26284,36 @@ components: required: true schema: type: string + ml.delete_agentic_memory_query___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.delete_agentic_memory_query___path.type: + name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ml._common___MemoryType' + ml.delete_agentic_memory___path.id: + name: id + in: path + required: true + schema: + type: string + ml.delete_agentic_memory___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.delete_agentic_memory___path.type: + name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ml._common___MemoryType' ml.delete_connector___path.connector_id: name: connector_id in: path @@ -26038,6 +26326,25 @@ components: required: true schema: type: string + ml.delete_memory_container___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.delete_memory_container___query.delete_all_memories: + name: delete_all_memories + in: query + schema: + type: boolean + default: false + ml.delete_memory_container___query.delete_memories: + name: delete_memories + in: query + schema: + type: array + items: + $ref: '#/components/schemas/ml._common___MemoryType' ml.delete_memory___path.memory_id: name: memory_id in: path @@ -26080,12 +26387,36 @@ components: required: true schema: $ref: '#/components/schemas/ml._common___FunctionName' + ml.execute_tool___path.tool_name: + name: tool_name + in: path + required: true + schema: + $ref: '#/components/schemas/ml._common___ToolName' ml.get_agent___path.agent_id: name: agent_id in: path required: true schema: type: string + ml.get_agentic_memory___path.id: + name: id + in: path + required: true + schema: + type: string + ml.get_agentic_memory___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.get_agentic_memory___path.type: + name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ml._common___MemoryType' ml.get_all_memories___query.max_results: name: max_results in: query @@ -26134,6 +26465,12 @@ components: required: true schema: type: string + ml.get_memory_container___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string ml.get_memory___path.memory_id: name: memory_id in: path @@ -26242,6 +26579,18 @@ components: required: true schema: type: string + ml.search_agentic_memory___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.search_agentic_memory___path.type: + name: type + in: path + required: true + schema: + type: string ml.search_message___path.memory_id: name: memory_id in: path @@ -26272,6 +26621,24 @@ components: required: true schema: type: string + ml.update_agentic_memory___path.id: + name: id + in: path + required: true + schema: + type: string + ml.update_agentic_memory___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string + ml.update_agentic_memory___path.type: + name: type + in: path + required: true + schema: + $ref: '#/components/schemas/ml._common___MemoryType' ml.update_connector___path.connector_id: name: connector_id in: path @@ -26284,6 +26651,12 @@ components: required: true schema: type: string + ml.update_memory_container___path.memory_container_id: + name: memory_container_id + in: path + required: true + schema: + type: string ml.update_memory___path.memory_id: name: memory_id in: path @@ -31065,6 +31438,35 @@ components: $ref: '#/components/schemas/_common___Ids' description: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. required: true + ml.add_agentic_memory: + content: + application/json: + schema: + type: object + properties: + messages: + type: array + items: + $ref: '#/components/schemas/ml._common___Message' + structured_data: + type: object + additionalProperties: true + binary_data: + type: string + description: Binary data content encoded as Base64 string. + payload_type: + type: string + description: The type of payload. + namespace: + $ref: '#/components/schemas/ml._common___Namespace' + metadata: + $ref: '#/components/schemas/ml._common___Metadata' + tags: + type: object + additionalProperties: true + infer: + type: boolean + description: Whether to use LLM to extract key information. ml.chunk_model: content: application/json: @@ -31126,6 +31528,37 @@ components: properties: name: $ref: '#/components/schemas/_common___Name' + ml.create_memory_container: + content: + application/json: + schema: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + description: + type: string + configuration: + $ref: '#/components/schemas/ml._common___MemoryContainerConfiguration' + required: + - configuration + - name + ml.create_memory_container_session: + content: + application/json: + schema: + type: object + properties: + session_id: + type: string + description: Custom session ID. + summary: + type: string + description: Session summary or description. + metadata: + $ref: '#/components/schemas/ml._common___Metadata' + namespace: + $ref: '#/components/schemas/ml._common___Namespace' ml.create_message: content: application/json: @@ -31185,6 +31618,14 @@ components: - name - total_chunks - version + ml.delete_agentic_memory_query: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' ml.execute_agent: content: application/json: @@ -31250,6 +31691,14 @@ components: items: type: number description: The metrics input. + ml.execute_tool: + content: + application/json: + schema: + type: object + properties: + parameters: + $ref: '#/components/schemas/ml._common___Parameters' ml.get_profile: content: application/json: @@ -31432,6 +31881,20 @@ components: - name - total_chunks - version + ml.search_agentic_memory: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + size: + type: integer + format: int64 + description: The number of memory containers to return. + sort: + $ref: '#/components/schemas/_common___Sort' ml.search_agents: content: application/json: @@ -31477,6 +31940,20 @@ components: sort: $ref: '#/components/schemas/_common___Sort' description: The sort order. + ml.search_memory_container: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + size: + type: integer + format: int64 + description: The number of memory containers to return. + sort: + $ref: '#/components/schemas/_common___Sort' ml.search_message: content: application/json: @@ -31597,6 +32074,38 @@ components: type: array items: $ref: '#/components/schemas/_common___Id' + ml.update_agentic_memory: + content: + application/json: + schema: + type: object + properties: + additional_info: + $ref: '#/components/schemas/ml._common___AdditionalInfo' + agents: + type: object + additionalProperties: true + binary_data: + type: object + additionalProperties: true + memory: + type: string + description: The updated memory content. + messages: + type: array + items: + $ref: '#/components/schemas/ml._common___Message' + metadata: + $ref: '#/components/schemas/ml._common___Metadata' + structured_data: + type: object + additionalProperties: true + summary: + type: string + description: The summary of the session. + tags: + type: object + additionalProperties: true ml.update_connector: content: application/json: @@ -31650,6 +32159,18 @@ components: properties: name: $ref: '#/components/schemas/_common___Name' + ml.update_memory_container: + content: + application/json: + schema: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + description: + type: string + configuration: + $ref: '#/components/schemas/ml._common___MemoryContainerConfiguration' ml.update_message: content: application/json: @@ -35352,6 +35873,19 @@ components: required: - docs description: '' + ml.add_agentic_memory___200: + content: + application/json: + schema: + type: object + properties: + session_id: + type: string + description: Session ID associated with the memory. + working_memory_id: + type: string + description: The ID for the creating working memory entry. + description: '' ml.chunk_model___200: content: application/json: @@ -35384,6 +35918,30 @@ components: status: $ref: '#/components/schemas/ml._common___Status' description: '' + ml.create_memory_container_session___200: + content: + application/json: + schema: + type: object + properties: + session_id: + type: string + description: The ID of the created session. + status: + type: string + description: Satus of the creation operation. + description: '' + ml.create_memory_container___200: + content: + application/json: + schema: + type: object + properties: + status: + type: string + memory_container_id: + type: string + description: '' ml.create_memory___200: content: application/json: @@ -35426,6 +35984,18 @@ components: schema: $ref: '#/components/schemas/_common___WriteResponseBase' description: '' + ml.delete_agentic_memory_query___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___DeleteAgenticMemoryResponse' + description: '' + ml.delete_agentic_memory___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___WriteResponseBase' + description: '' ml.delete_connector___200: content: application/json: @@ -35438,6 +36008,12 @@ components: schema: $ref: '#/components/schemas/_common___WriteResponseBase' description: '' + ml.delete_memory_container___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___WriteResponseBase' + description: '' ml.delete_memory___200: content: application/json: @@ -35496,12 +36072,24 @@ components: schema: $ref: '#/components/schemas/ml._common___ExecuteAlgorithmResponse' description: '' + ml.execute_tool___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___ExecuteToolResponse' + description: '' ml.get_agent___200: content: application/json: schema: $ref: '#/components/schemas/ml._common___GetAgentResponse' description: '' + ml.get_agentic_memory___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___GetAgenticMemoryResponse' + description: '' ml.get_all_memories___200: content: application/json: @@ -35563,6 +36151,12 @@ components: model_id: $ref: '#/components/schemas/_common___Name' description: '' + ml.get_memory_container___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___GetMemoryContainerResponse' + description: '' ml.get_memory___200: content: application/json: @@ -35713,6 +36307,12 @@ components: - status - task_id description: '' + ml.search_agentic_memory___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___SearchResponse' + description: '' ml.search_agents___200: content: application/json: @@ -35725,6 +36325,12 @@ components: schema: $ref: '#/components/schemas/ml._common___SearchConnectorsResponse' description: '' + ml.search_memory_container___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___SearchResponse' + description: '' ml.search_memory___200: content: application/json: @@ -35779,6 +36385,12 @@ components: schema: $ref: '#/components/schemas/ml._common___UnloadModelResponse' description: '' + ml.update_agentic_memory___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___WriteResponseBase' + description: '' ml.update_connector___200: content: application/json: @@ -35791,6 +36403,12 @@ components: schema: $ref: '#/components/schemas/_common___WriteResponseBase' description: '' + ml.update_memory_container___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___WriteResponseBase' + description: '' ml.update_memory___200: content: application/json: @@ -61676,6 +62294,13 @@ components: type: string post_process_function: type: string + ml._common___ActionType: + type: string + description: The type of operation. + enum: + - ADD + - DELETE + - UPDATE ml._common___AdditionalConfig: type: object properties: @@ -61797,6 +62422,14 @@ components: enum: - aws_sigv4 - http + ml._common___Content: + type: object + properties: + text: + type: string + type: + type: string + additionalProperties: true ml._common___Credential: type: object properties: @@ -61807,6 +62440,66 @@ components: session_token: type: string additionalProperties: true + ml._common___DeleteAgenticMemoryResponse: + type: object + properties: + took: + type: integer + format: int64 + description: Time taken to execute the request. + timed_out: + type: boolean + description: Whether the request timed out. + total: + type: integer + format: int64 + description: Total number of documents processed. + updated: + type: integer + format: int64 + description: Number of documents updated. + created: + type: integer + format: int64 + description: Number of documents created. + deleted: + type: integer + format: int64 + description: Number of documents deleted. + batches: + type: integer + format: int64 + description: Number of batches processed. + version_conflicts: + type: integer + format: int64 + description: Number of version conflicts encountered. + noops: + type: integer + format: int64 + description: Number of no-operation updates. + result: + type: string + description: The result of delete operation. + retries: + $ref: '#/components/schemas/_common___Retries' + throttled_millis: + type: integer + format: int64 + description: Time that the request was throttled. + requests_per_second: + type: number + format: float + description: Number of requests processed per second. + throttled_until_millis: + type: integer + format: int64 + description: Time until throttling is lifted. + failures: + type: array + description: Any failures occurred during the operation. + items: + $ref: '#/components/schemas/_common___BulkByScrollFailure' ml._common___Entity: type: object properties: @@ -61848,6 +62541,13 @@ components: result: type: number description: The result. + ml._common___ExecuteToolResponse: + type: object + properties: + inference_results: + type: array + items: + $ref: '#/components/schemas/ml._common___InferenceResults' ml._common___FunctionName: type: string description: The function name. @@ -61890,6 +62590,68 @@ components: - text_embedding - TEXT_SIMILARITY - text_similarity + ml._common___GetAgenticMemoryResponse: + type: object + properties: + action: + $ref: '#/components/schemas/ml._common___ActionType' + after: + type: object + additionalProperties: true + before: + type: object + additionalProperties: true + created_time: + type: integer + format: int64 + description: The created time. + infer: + type: boolean + description: Whether inference was enabled. + last_updated_time: + type: integer + format: int64 + description: The last updated time. + memory: + type: string + description: The extracted long-term memory fact. + memory_embedding: + type: array + items: + type: number + format: double + description: The output data. + memory_id: + type: string + description: The ID of the memory. + memory_container_id: + type: string + description: The ID of the memory container. + messages: + type: array + items: + $ref: '#/components/schemas/ml._common___Message' + metadata: + $ref: '#/components/schemas/ml._common___Metadata' + namespace: + $ref: '#/components/schemas/ml._common___Namespace' + namespace_size: + type: integer + format: int64 + description: The number of namespaces. + owner_id: + type: string + description: The ID of the memory owner. + payload_type: + $ref: '#/components/schemas/ml._common___PayloadType' + strategy_id: + type: string + description: The ID for the strategy instance. + strategy_type: + $ref: '#/components/schemas/ml._common___StrategyType' + tags: + type: object + additionalProperties: true ml._common___GetAgentResponse: type: object properties: @@ -61941,6 +62703,26 @@ components: type: integer format: int64 description: The last updated time. + ml._common___GetMemoryContainerResponse: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + description: + type: string + description: The memory container description. + owner: + $ref: '#/components/schemas/ml._common___Owner' + created_time: + type: integer + format: int64 + description: The created time. + last_updated_time: + type: integer + format: int64 + description: The last updated time. + configuration: + $ref: '#/components/schemas/ml._common___MemoryContainerConfiguration' ml._common___GetProfileResponse: type: object properties: @@ -62040,6 +62822,28 @@ components: required: - relation - value + ml._common___Index: + type: object + properties: + number_of_shards: + type: string + description: The number of shards. + number_of_replicas: + type: string + description: The number of replicas. + additionalProperties: true + ml._common___IndexSettings: + type: object + properties: + session_index: + $ref: '#/components/schemas/ml._common___MemoryIndexSettings' + short_term_memory_index: + $ref: '#/components/schemas/ml._common___MemoryIndexSettings' + long_term_memory_index: + $ref: '#/components/schemas/ml._common___MemoryIndexSettings' + long_term_memory_history_index: + $ref: '#/components/schemas/ml._common___MemoryIndexSettings' + additionalProperties: true ml._common___InferenceResults: type: object properties: @@ -62102,6 +62906,58 @@ components: description: The username of the user. additional_info: $ref: '#/components/schemas/ml._common___AdditionalInfo' + ml._common___MemoryContainerConfiguration: + type: object + properties: + embedding_model_type: + type: string + description: The embedding model type. + embedding_model_id: + type: string + description: The embedding model ID. + embedding_dimension: + type: integer + format: int64 + description: The embedding dimension. + llm_id: + type: string + description: The LLM ID. + index_prefix: + type: string + description: Custom prefix for memory indices. + use_system_index: + type: boolean + description: Whether to use system indices. + disable_history: + type: boolean + description: Whether history will be persisted. + disable_session: + type: boolean + description: Whether session will be persisted. + max_infer_size: + type: integer + format: int64 + description: The maximum number of similar memories retrieved during consolidation. + index_settings: + $ref: '#/components/schemas/ml._common___IndexSettings' + strategies: + type: array + items: + $ref: '#/components/schemas/ml._common___Strategy' + parameters: + $ref: '#/components/schemas/ml._common___Parameters' + ml._common___MemoryIndexSettings: + type: object + properties: + index: + $ref: '#/components/schemas/ml._common___Index' + ml._common___MemoryType: + type: string + enum: + - history + - long-term + - sessions + - working ml._common___Message: type: object properties: @@ -62144,6 +63000,16 @@ components: type: integer format: int64 description: The trace number. + role: + type: string + description: The role of the message. + content: + type: array + items: + $ref: '#/components/schemas/ml._common___Content' + ml._common___Metadata: + type: object + additionalProperties: true ml._common___MlIndexStatus: type: string enum: @@ -62385,6 +63251,9 @@ components: type: integer format: int64 description: The executing task count. + ml._common___Namespace: + type: object + additionalProperties: true ml._common___Node: type: object properties: @@ -62456,8 +63325,6 @@ components: result: type: string description: The output result. - required: - - data ml._common___Owner: type: object properties: @@ -62483,11 +63350,20 @@ components: - 'null' - string description: The user requested tenant. + user_requested_tenant_access: + type: string + description: The user requested tenant access. required: - name ml._common___Parameters: type: object additionalProperties: true + ml._common___PayloadType: + type: string + description: The type of payload. + enum: + - conversational + - data ml._common___PredictionResult: type: object properties: @@ -62906,6 +63782,22 @@ components: error: type: string description: The error message. + configuration: + $ref: '#/components/schemas/ml._common___MemoryContainerConfiguration' + payload_type: + $ref: '#/components/schemas/ml._common___PayloadType' + metadata: + $ref: '#/components/schemas/ml._common___Metadata' + namespace: + $ref: '#/components/schemas/ml._common___Namespace' + namespace_size: + type: integer + format: int64 + description: The number of namespaces. + owner_id: + type: string + description: The ID of the memory owner. + additionalProperties: true ml._common___Status: type: string description: The status. @@ -62916,6 +63808,43 @@ components: - CREATED - FAILED - RUNNING + ml._common___Strategy: + type: object + properties: + type: + $ref: '#/components/schemas/ml._common___StrategyType' + namespace: + type: array + items: + type: string + description: The namespace. + configuration: + $ref: '#/components/schemas/ml._common___StrategyConfiguration' + enabled: + type: boolean + description: Whether to enable the strategy. + id: + type: string + description: The strategy ID. + ml._common___StrategyConfiguration: + type: object + properties: + llm_result_path: + type: string + description: JSONPath expression for extracting LLM results from responses. + system_prompt: + type: string + description: Custom system prompt to override default strategy prompt. + llm_id: + type: string + description: The LLM ID for strategy. + ml._common___StrategyType: + type: string + description: The strategy type. + enum: + - SEMANTIC + - SUMMARY + - USER_PREFERENCE ml._common___Task: type: object properties: @@ -63015,7 +63944,9 @@ components: - MLModelTool - NeuralSparseSearchTool - PPLTool + - QueryPlanningTool - RAGTool + - ReadFromScratchPadTool - SearchAlertsTool - SearchAnomalyDetectorsTool - SearchAnomalyResultsTool @@ -63023,6 +63954,7 @@ components: - SearchMonitorsTool - VectorDBTool - VisualizationTool + - WriteToScratchPadTool ml._common___TrainParameters: type: object properties: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 5edf6ee0c7..8922629611 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -66,6 +66,8 @@ public class CodeGenerator { "search_agents", "search_connectors", "search_memory", + "search_memory_container", + "search_agentic_memory", "search_message", "search_model_group", "search_models",