From 5b4cdf60f562ff15a5241af4c06629b6bfdd1a61 Mon Sep 17 00:00:00 2001 From: Matthias Kuhr <52661546+MatKuhr@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:50:09 +0100 Subject: [PATCH] [Orchestration] OSS Generator Improvements (#158) * Simplifications and cleanup * Remove parsing for streaming --- orchestration/.openapi-generator-ignore | 4 - orchestration/pom.xml | 151 +++--- .../ConfigToRequestTransformer.java | 7 +- .../LLMModuleResultDeserializer.java | 69 +-- .../orchestration/OrchestrationClient.java | 7 +- .../model/AzureContentSafetyFilterConfig.java | 71 ++- .../client/model/CompletionPostRequest.java | 5 +- .../client/model/CompletionPostResponse.java | 5 +- .../CompletionPostResponseStreaming.java | 5 +- .../orchestration/client/model/DPIConfig.java | 145 +++--- .../client/model/DataRepositoryType.java | 51 -- .../client/model/DocumentGroundingFilter.java | 440 ------------------ .../GroundingFilterSearchConfiguration.java | 227 --------- .../client/model/GroundingModuleConfig.java | 208 --------- .../model/GroundingModuleConfigConfig.java | 233 ---------- ...oundingModuleConfigConfigFiltersInner.java | 27 -- .../client/model/KeyValueListPair.java | 180 ------- .../client/model/LLMModuleConfig.java | 5 +- .../client/model/LLMModuleResult.java | 18 +- .../ModuleResultsOutputUnmaskingInner.java | 20 +- ...strationV1EndpointsHealthz503Response.java | 165 ------- .../model/SearchDocumentKeyValueListPair.java | 230 --------- .../client/model/SearchSelectOptionEnum.java | 49 -- .../client/model/TemplateRef.java | 137 ------ .../client/model/TemplateRefByID.java | 137 ------ .../TemplateRefByScenarioNameVersion.java | 211 --------- .../client/model/TemplateRefTemplateRef.java | 27 -- .../client/model/TokenUsage.java | 5 +- .../LLMModuleResultDeserializerTest.java | 39 -- 29 files changed, 262 insertions(+), 2616 deletions(-) delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationV1EndpointsHealthz503Response.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java diff --git a/orchestration/.openapi-generator-ignore b/orchestration/.openapi-generator-ignore index 895273390..4efdb3f42 100644 --- a/orchestration/.openapi-generator-ignore +++ b/orchestration/.openapi-generator-ignore @@ -16,7 +16,3 @@ settings.gradle src/main/AndroidManifest.xml api/ .openapi-generator/ - - -src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResult.java -src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java diff --git a/orchestration/pom.xml b/orchestration/pom.xml index b0f473574..d3007a83e 100644 --- a/orchestration/pom.xml +++ b/orchestration/pom.xml @@ -85,6 +85,14 @@ org.slf4j slf4j-api + + javax.annotation + javax.annotation-api + + + com.google.guava + guava + @@ -118,73 +126,88 @@ mockito-core test - - - - org.openapitools - jackson-databind-nullable - - - javax.annotation - javax.annotation-api - - - com.google.guava - guava - - - - - org.openapitools - openapi-generator-maven-plugin - - - - generate - - generate-sources - - - ${project.basedir}/src/main/resources/spec/orchestration.yaml - ${project.basedir} - - java - - com.sap.ai.sdk.orchestration.client.model - com.sap.ai.sdk.orchestration.client.api - com.sap.ai.sdk.orchestration.client.invoker + + + generate + + false + + generate + + + + + + org.openapitools + openapi-generator-maven-plugin + + + + generate + + generate-sources + + + ${project.basedir}/src/main/resources/spec/orchestration.yaml + ${project.basedir} + + java + + com.sap.ai.sdk.orchestration.client.model + com.sap.ai.sdk.orchestration.client.api + com.sap.ai.sdk.orchestration.client.invoker - - - false - false - false - false - true - + + + false + false + false + false + true + - - - true - false - true - false - true - false - true - @com.google.common.annotations.Beta - - true - false - false - resttemplate - + + + true + false + true + false + true + false + true + @com.google.common.annotations.Beta + + true + false + false + resttemplate + + + + + + + maven-clean-plugin + + + + ${project.basedir}/src/main/java/com/sap/ai/sdk/orchestration/client + + **/* + + + - - - - - + + + delete-orchestration-generated-client + + + + + + + diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java index f6b63f433..b9d82ec00 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java @@ -43,7 +43,12 @@ static TemplatingModuleConfig toTemplateModuleConfig( * In this case, the request will fail, since the templating module will try to resolve the parameter. * To be fixed with https://github.tools.sap/AI/llm-orchestration/issues/662 */ - val messages = Option.of(template).map(t -> ((Template) t).getTemplate()).getOrElse(List::of); + val messages = + Option.of(template) + .filter(Template.class::isInstance) + .map(Template.class::cast) + .map(Template::getTemplate) + .getOrElse(List::of); val messagesWithPrompt = new ArrayList<>(messages); messagesWithPrompt.addAll(prompt.getMessages()); if (messagesWithPrompt.isEmpty()) { diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializer.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializer.java index b5ff73ec9..3a0e00309 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializer.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializer.java @@ -1,82 +1,45 @@ package com.sap.ai.sdk.orchestration; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.sap.ai.sdk.orchestration.client.model.LLMModuleResult; -import com.sap.ai.sdk.orchestration.client.model.LLMModuleResultStreaming; import com.sap.ai.sdk.orchestration.client.model.LLMModuleResultSynchronous; import java.io.IOException; +import java.io.Serial; import javax.annotation.Nonnull; +import lombok.val; /** * A deserializer for {@link LLMModuleResult} that determines the concrete implementation based on * the structure of the JSON object. */ -public class LLMModuleResultDeserializer extends StdDeserializer { +class LLMModuleResultDeserializer extends StdDeserializer { + // checkstyle requires a serialVersionUid since StdDeserializer implements Serializable + @Serial private static final long serialVersionUID = 1L; - public LLMModuleResultDeserializer() { + /** Default constructor. */ + LLMModuleResultDeserializer() { super(LLMModuleResult.class); } /** - * Deserialize the JSON object into one of the subtypes of the base type. - * - * + * Always deserialize into {@link LLMModuleResultSynchronous} since streaming isn't supported yet. * * @param parser The JSON parser. * @param context The deserialization context. * @return The deserialized object. * @throws IOException If an I/O error occurs. */ + @Nonnull @Override - public LLMModuleResult deserialize(JsonParser parser, @Nonnull DeserializationContext context) + public LLMModuleResult deserialize( + @Nonnull final JsonParser parser, @Nonnull final DeserializationContext context) throws IOException { + val mapper = (ObjectMapper) parser.getCodec(); + val rootNode = mapper.readTree(parser); - // Check if the target type is a concrete class - JavaType targetType = context.getContextualType(); - if (targetType != null && !LLMModuleResult.class.equals(targetType.getRawClass())) { - return delegateToDefaultDeserializer(parser, context, targetType); - } - - // Custom deserialization logic for LLMModuleResult interface - var mapper = (ObjectMapper) parser.getCodec(); - var rootNode = mapper.readTree(parser); - Class concreteClass = LLMModuleResultSynchronous.class; - - // Inspect the "choices" field - var choicesNode = rootNode.get("choices"); - if (choicesNode != null && choicesNode.isArray()) { - var firstChoice = (JsonNode) choicesNode.get(0); - if (firstChoice != null && firstChoice.has("delta")) { - concreteClass = LLMModuleResultStreaming.class; - } - } - - // Create a new parser for the root node - var rootParser = rootNode.traverse(mapper); - rootParser.nextToken(); // Advance to the first token - - // Use the default deserializer for the concrete class - return delegateToDefaultDeserializer(rootParser, context, mapper.constructType(concreteClass)); - } - - /** - * Delegate deserialization to the default deserializer for the given concrete type. - * - * @param parser The JSON parser. - * @param context The deserialization context. - * @param concreteType The concrete type to deserialize into. - * @return The deserialized object. - * @throws IOException If an I/O error occurs. - */ - private LLMModuleResult delegateToDefaultDeserializer( - JsonParser parser, DeserializationContext context, JavaType concreteType) throws IOException { - var defaultDeserializer = context.findRootValueDeserializer(concreteType); - return (LLMModuleResult) defaultDeserializer.deserialize(parser, context); + return mapper.readValue(rootNode.toString(), LLMModuleResultSynchronous.class); } } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java index 49bdb3ba9..62822653c 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java @@ -11,12 +11,11 @@ import com.sap.ai.sdk.orchestration.client.model.CompletionPostRequest; import com.sap.ai.sdk.orchestration.client.model.CompletionPostResponse; import com.sap.ai.sdk.orchestration.client.model.FilterConfig; -import com.sap.ai.sdk.orchestration.client.model.GroundingModuleConfigConfigFiltersInner; import com.sap.ai.sdk.orchestration.client.model.LLMModuleResult; import com.sap.ai.sdk.orchestration.client.model.MaskingProviderConfig; import com.sap.ai.sdk.orchestration.client.model.ModuleConfigs; +import com.sap.ai.sdk.orchestration.client.model.ModuleResultsOutputUnmaskingInner; import com.sap.ai.sdk.orchestration.client.model.OrchestrationConfig; -import com.sap.ai.sdk.orchestration.client.model.TemplateRefTemplateRef; import com.sap.ai.sdk.orchestration.client.model.TemplatingModuleConfig; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException; @@ -47,10 +46,10 @@ public class OrchestrationClient { .visibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE) .serializationInclusion(JsonInclude.Include.NON_NULL) .deserializerByType(LLMModuleResult.class, new LLMModuleResultDeserializer()) + .mixIn(LLMModuleResult.class, NoTypeInfoMixin.class) + .mixIn(ModuleResultsOutputUnmaskingInner.class, NoTypeInfoMixin.class) .mixIn(FilterConfig.class, NoTypeInfoMixin.class) - .mixIn(GroundingModuleConfigConfigFiltersInner.class, NoTypeInfoMixin.class) .mixIn(MaskingProviderConfig.class, NoTypeInfoMixin.class) - .mixIn(TemplateRefTemplateRef.class, NoTypeInfoMixin.class) .mixIn(TemplatingModuleConfig.class, NoTypeInfoMixin.class) .build(); } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/AzureContentSafetyFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/AzureContentSafetyFilterConfig.java index f70d7cc74..1e95c58cc 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/AzureContentSafetyFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/AzureContentSafetyFilterConfig.java @@ -29,15 +29,42 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0") public class AzureContentSafetyFilterConfig implements FilterConfig { - private TypeEnum type; + /** String represents name of the filter provider */ + public enum TypeEnum { + AZURE_CONTENT_SAFETY("azure_content_safety"), - public static final String JSON_PROPERTY_TYPE = "type"; + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - /** Create a builder with no initialized field. */ - public static AzureContentSafetyFilterConfig.Builder builder() { - return new AzureContentSafetyFilterConfig.Builder(); + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } } + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + public static final String JSON_PROPERTY_CONFIG = "config"; private AzureContentSafety config; @@ -172,37 +199,9 @@ public String toString() { } } - /** String represents name of the filter provider */ - public enum TypeEnum { - AZURE_CONTENT_SAFETY("azure_content_safety"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } + /** Create a builder with no initialized field. */ + public static AzureContentSafetyFilterConfig.Builder builder() { + return new AzureContentSafetyFilterConfig.Builder(); } /** Create a builder with a shallow copy of this instance. */ diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostRequest.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostRequest.java index 897475937..8ec4354a7 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostRequest.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostRequest.java @@ -33,11 +33,12 @@ comments = "Generator version: 7.9.0") public class CompletionPostRequest { public static final String JSON_PROPERTY_ORCHESTRATION_CONFIG = "orchestration_config"; - public static final String JSON_PROPERTY_MESSAGES_HISTORY = "messages_history"; + private OrchestrationConfig orchestrationConfig; public static final String JSON_PROPERTY_INPUT_PARAMS = "input_params"; private Map inputParams = new HashMap<>(); - private OrchestrationConfig orchestrationConfig; + + public static final String JSON_PROPERTY_MESSAGES_HISTORY = "messages_history"; private List messagesHistory; public CompletionPostRequest() {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponse.java index 4cc68562b..307c157d5 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponse.java @@ -29,11 +29,12 @@ comments = "Generator version: 7.9.0") public class CompletionPostResponse { public static final String JSON_PROPERTY_REQUEST_ID = "request_id"; - public static final String JSON_PROPERTY_ORCHESTRATION_RESULT = "orchestration_result"; + private String requestId; public static final String JSON_PROPERTY_MODULE_RESULTS = "module_results"; private ModuleResults moduleResults; - private String requestId; + + public static final String JSON_PROPERTY_ORCHESTRATION_RESULT = "orchestration_result"; private LLMModuleResult orchestrationResult; public CompletionPostResponse() {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java index e528cc216..b2423666b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java @@ -29,11 +29,12 @@ comments = "Generator version: 7.9.0") public class CompletionPostResponseStreaming { public static final String JSON_PROPERTY_REQUEST_ID = "request_id"; - public static final String JSON_PROPERTY_ORCHESTRATION_RESULT = "orchestration_result"; + private String requestId; public static final String JSON_PROPERTY_MODULE_RESULTS = "module_results"; private ModuleResults moduleResults; - private String requestId; + + public static final String JSON_PROPERTY_ORCHESTRATION_RESULT = "orchestration_result"; private LLMModuleResultStreaming orchestrationResult; public CompletionPostResponseStreaming() {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DPIConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DPIConfig.java index 66e9885de..9fd4f705d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DPIConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DPIConfig.java @@ -32,23 +32,80 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0") public class DPIConfig implements MaskingProviderConfig { - private MethodEnum method; + /** Type of masking service provider */ + public enum TypeEnum { + SAP_DATA_PRIVACY_INTEGRATION("sap_data_privacy_integration"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Create a builder with no initialized field. */ - public static DPIConfig.Builder builder() { - return new DPIConfig.Builder(); - } + /** Type of masking method to be used */ + public enum MethodEnum { + ANONYMIZATION("anonymization"), - public static final String JSON_PROPERTY_METHOD = "method"; + PSEUDONYMIZATION("pseudonymization"), - /** Create a builder with a shallow copy of this instance. */ - public DPIConfig.Builder toBuilder() { - return new DPIConfig.Builder().type(getType()).method(getMethod()).entities(getEntities()); + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } } + public static final String JSON_PROPERTY_METHOD = "method"; + private MethodEnum method; + public static final String JSON_PROPERTY_ENTITIES = "entities"; private List entities = new ArrayList<>(); @@ -221,71 +278,13 @@ public String toString() { } } - /** Type of masking service provider */ - public enum TypeEnum { - SAP_DATA_PRIVACY_INTEGRATION("sap_data_privacy_integration"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } + /** Create a builder with no initialized field. */ + public static DPIConfig.Builder builder() { + return new DPIConfig.Builder(); } - /** Type of masking method to be used */ - public enum MethodEnum { - ANONYMIZATION("anonymization"), - - PSEUDONYMIZATION("pseudonymization"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonCreator - public static MethodEnum fromValue(String value) { - for (MethodEnum b : MethodEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } + /** Create a builder with a shallow copy of this instance. */ + public DPIConfig.Builder toBuilder() { + return new DPIConfig.Builder().type(getType()).method(getMethod()).entities(getEntities()); } } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java deleted file mode 100644 index c0b690fe9..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Gets or Sets DataRepositoryType */ -public enum DataRepositoryType { - VECTOR("vector"), - - HELP_SAP_COM("help.sap.com"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DataRepositoryType(String value) { - this.value = value; - } - - @JsonCreator - public static DataRepositoryType fromValue(String value) { - for (DataRepositoryType b : DataRepositoryType.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java deleted file mode 100644 index 9f355a7c6..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import org.openapitools.jackson.nullable.JsonNullable; - -/** DocumentGroundingFilter */ -@JsonPropertyOrder({ - DocumentGroundingFilter.JSON_PROPERTY_ID, - DocumentGroundingFilter.JSON_PROPERTY_SEARCH_CONFIG, - DocumentGroundingFilter.JSON_PROPERTY_DATA_REPOSITORIES, - DocumentGroundingFilter.JSON_PROPERTY_DATA_REPOSITORY_TYPE, - DocumentGroundingFilter.JSON_PROPERTY_DATA_REPOSITORY_METADATA, - DocumentGroundingFilter.JSON_PROPERTY_DOCUMENT_METADATA, - DocumentGroundingFilter.JSON_PROPERTY_CHUNK_METADATA -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class DocumentGroundingFilter implements GroundingModuleConfigConfigFiltersInner { - public static final String JSON_PROPERTY_ID = "id"; - public static final String JSON_PROPERTY_SEARCH_CONFIG = "search_config"; - public static final String JSON_PROPERTY_DATA_REPOSITORIES = "data_repositories"; - public static final String JSON_PROPERTY_DATA_REPOSITORY_TYPE = "data_repository_type"; - public static final String JSON_PROPERTY_DATA_REPOSITORY_METADATA = "data_repository_metadata"; - public static final String JSON_PROPERTY_DOCUMENT_METADATA = "document_metadata"; - public static final String JSON_PROPERTY_CHUNK_METADATA = "chunk_metadata"; - private Object id = null; - private JsonNullable searchConfig = - JsonNullable.undefined(); - private List dataRepositories = new ArrayList<>(Arrays.asList("*")); - private DataRepositoryType dataRepositoryType; - private List dataRepositoryMetadata = new ArrayList<>(); - private List documentMetadata = new ArrayList<>(); - private List chunkMetadata = new ArrayList<>(); - - public DocumentGroundingFilter() {} - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - /** Create a builder with no initialized field. */ - public static DocumentGroundingFilter.Builder builder() { - return new DocumentGroundingFilter.Builder(); - } - - public DocumentGroundingFilter id(Object id) { - - this.id = id; - return this; - } - - /** - * Identifier of this SearchFilter - unique per request. - * - * @return id - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Object getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(Object id) { - this.id = id; - } - - public DocumentGroundingFilter searchConfig(GroundingFilterSearchConfiguration searchConfig) { - this.searchConfig = JsonNullable.of(searchConfig); - - return this; - } - - /** - * Get searchConfig - * - * @return searchConfig - */ - @javax.annotation.Nullable - @JsonIgnore - public GroundingFilterSearchConfiguration getSearchConfig() { - return searchConfig.orElse(null); - } - - public void setSearchConfig(GroundingFilterSearchConfiguration searchConfig) { - this.searchConfig = JsonNullable.of(searchConfig); - } - - @JsonProperty(JSON_PROPERTY_SEARCH_CONFIG) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getSearchConfig_JsonNullable() { - return searchConfig; - } - - @JsonProperty(JSON_PROPERTY_SEARCH_CONFIG) - public void setSearchConfig_JsonNullable( - JsonNullable searchConfig) { - this.searchConfig = searchConfig; - } - - public DocumentGroundingFilter dataRepositories(List dataRepositories) { - - this.dataRepositories = dataRepositories; - return this; - } - - public DocumentGroundingFilter addDataRepositoriesItem(String dataRepositoriesItem) { - if (this.dataRepositories == null) { - this.dataRepositories = new ArrayList<>(Arrays.asList("*")); - } - this.dataRepositories.add(dataRepositoriesItem); - return this; - } - - /** - * Specify ['*'] to search across all DataRepositories or give a specific list of - * DataRepository ids. - * - * @return dataRepositories - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDataRepositories() { - return dataRepositories; - } - - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDataRepositories(List dataRepositories) { - this.dataRepositories = dataRepositories; - } - - public DocumentGroundingFilter dataRepositoryType(DataRepositoryType dataRepositoryType) { - - this.dataRepositoryType = dataRepositoryType; - return this; - } - - /** - * Get dataRepositoryType - * - * @return dataRepositoryType - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DataRepositoryType getDataRepositoryType() { - return dataRepositoryType; - } - - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDataRepositoryType(DataRepositoryType dataRepositoryType) { - this.dataRepositoryType = dataRepositoryType; - } - - public DocumentGroundingFilter dataRepositoryMetadata( - List dataRepositoryMetadata) { - - this.dataRepositoryMetadata = dataRepositoryMetadata; - return this; - } - - public DocumentGroundingFilter addDataRepositoryMetadataItem( - KeyValueListPair dataRepositoryMetadataItem) { - if (this.dataRepositoryMetadata == null) { - this.dataRepositoryMetadata = new ArrayList<>(); - } - this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); - return this; - } - - /** - * Restrict DataRepositories considered during search to those annotated with the given metadata. - * Useful when combined with dataRepositories=['*'] - * - * @return dataRepositoryMetadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDataRepositoryMetadata() { - return dataRepositoryMetadata; - } - - @JsonProperty(JSON_PROPERTY_DATA_REPOSITORY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDataRepositoryMetadata(List dataRepositoryMetadata) { - this.dataRepositoryMetadata = dataRepositoryMetadata; - } - - public DocumentGroundingFilter documentMetadata( - List documentMetadata) { - - this.documentMetadata = documentMetadata; - return this; - } - - public DocumentGroundingFilter addDocumentMetadataItem( - SearchDocumentKeyValueListPair documentMetadataItem) { - if (this.documentMetadata == null) { - this.documentMetadata = new ArrayList<>(); - } - this.documentMetadata.add(documentMetadataItem); - return this; - } - - /** - * Restrict documents considered during search to those annotated with the given metadata. - * - * @return documentMetadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOCUMENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDocumentMetadata() { - return documentMetadata; - } - - @JsonProperty(JSON_PROPERTY_DOCUMENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocumentMetadata(List documentMetadata) { - this.documentMetadata = documentMetadata; - } - - public DocumentGroundingFilter chunkMetadata(List chunkMetadata) { - - this.chunkMetadata = chunkMetadata; - return this; - } - - public DocumentGroundingFilter addChunkMetadataItem(KeyValueListPair chunkMetadataItem) { - if (this.chunkMetadata == null) { - this.chunkMetadata = new ArrayList<>(); - } - this.chunkMetadata.add(chunkMetadataItem); - return this; - } - - /** - * Restrict chunks considered during search to those with the given metadata. - * - * @return chunkMetadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CHUNK_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getChunkMetadata() { - return chunkMetadata; - } - - @JsonProperty(JSON_PROPERTY_CHUNK_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setChunkMetadata(List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DocumentGroundingFilter documentGroundingFilter = (DocumentGroundingFilter) o; - return Objects.equals(this.id, documentGroundingFilter.id) - && equalsNullable(this.searchConfig, documentGroundingFilter.searchConfig) - && Objects.equals(this.dataRepositories, documentGroundingFilter.dataRepositories) - && Objects.equals(this.dataRepositoryType, documentGroundingFilter.dataRepositoryType) - && Objects.equals( - this.dataRepositoryMetadata, documentGroundingFilter.dataRepositoryMetadata) - && Objects.equals(this.documentMetadata, documentGroundingFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, documentGroundingFilter.chunkMetadata); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - hashCodeNullable(searchConfig), - dataRepositories, - dataRepositoryType, - dataRepositoryMetadata, - documentMetadata, - chunkMetadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DocumentGroundingFilter {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" searchConfig: ").append(toIndentedString(searchConfig)).append("\n"); - sb.append(" dataRepositories: ").append(toIndentedString(dataRepositories)).append("\n"); - sb.append(" dataRepositoryType: ").append(toIndentedString(dataRepositoryType)).append("\n"); - sb.append(" dataRepositoryMetadata: ") - .append(toIndentedString(dataRepositoryMetadata)) - .append("\n"); - sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); - sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public DocumentGroundingFilter.Builder toBuilder() { - return new DocumentGroundingFilter.Builder() - .id(getId()) - .searchConfig(getSearchConfig()) - .dataRepositories(getDataRepositories()) - .dataRepositoryType(getDataRepositoryType()) - .dataRepositoryMetadata(getDataRepositoryMetadata()) - .documentMetadata(getDocumentMetadata()) - .chunkMetadata(getChunkMetadata()); - } - - public static class Builder { - - private DocumentGroundingFilter instance; - - public Builder() { - this(new DocumentGroundingFilter()); - } - - protected Builder(DocumentGroundingFilter instance) { - this.instance = instance; - } - - public DocumentGroundingFilter.Builder id(Object id) { - this.instance.id = id; - return this; - } - - public DocumentGroundingFilter.Builder searchConfig( - GroundingFilterSearchConfiguration searchConfig) { - this.instance.searchConfig = - JsonNullable.of(searchConfig); - return this; - } - - public DocumentGroundingFilter.Builder searchConfig( - JsonNullable searchConfig) { - this.instance.searchConfig = searchConfig; - return this; - } - - public DocumentGroundingFilter.Builder dataRepositories(List dataRepositories) { - this.instance.dataRepositories = dataRepositories; - return this; - } - - public DocumentGroundingFilter.Builder dataRepositoryType( - DataRepositoryType dataRepositoryType) { - this.instance.dataRepositoryType = dataRepositoryType; - return this; - } - - public DocumentGroundingFilter.Builder dataRepositoryMetadata( - List dataRepositoryMetadata) { - this.instance.dataRepositoryMetadata = dataRepositoryMetadata; - return this; - } - - public DocumentGroundingFilter.Builder documentMetadata( - List documentMetadata) { - this.instance.documentMetadata = documentMetadata; - return this; - } - - public DocumentGroundingFilter.Builder chunkMetadata(List chunkMetadata) { - this.instance.chunkMetadata = chunkMetadata; - return this; - } - - /** - * returns a built DocumentGroundingFilter instance. - * - *

The builder is not reusable. - */ - public DocumentGroundingFilter build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java deleted file mode 100644 index fb1080880..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.Arrays; -import java.util.Objects; -import org.openapitools.jackson.nullable.JsonNullable; - -/** GroundingFilterSearchConfiguration */ -@JsonPropertyOrder({ - GroundingFilterSearchConfiguration.JSON_PROPERTY_MAX_CHUNK_COUNT, - GroundingFilterSearchConfiguration.JSON_PROPERTY_MAX_DOCUMENT_COUNT -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class GroundingFilterSearchConfiguration { - public static final String JSON_PROPERTY_MAX_CHUNK_COUNT = "max_chunk_count"; - public static final String JSON_PROPERTY_MAX_DOCUMENT_COUNT = "max_document_count"; - private JsonNullable maxChunkCount = JsonNullable.undefined(); - private JsonNullable maxDocumentCount = JsonNullable.undefined(); - - public GroundingFilterSearchConfiguration() {} - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - /** Create a builder with no initialized field. */ - public static GroundingFilterSearchConfiguration.Builder builder() { - return new GroundingFilterSearchConfiguration.Builder(); - } - - public GroundingFilterSearchConfiguration maxChunkCount(Integer maxChunkCount) { - this.maxChunkCount = JsonNullable.of(maxChunkCount); - - return this; - } - - /** - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. - * minimum: 0 - * - * @return maxChunkCount - */ - @javax.annotation.Nullable - @JsonIgnore - public Integer getMaxChunkCount() { - return maxChunkCount.orElse(null); - } - - public void setMaxChunkCount(Integer maxChunkCount) { - this.maxChunkCount = JsonNullable.of(maxChunkCount); - } - - @JsonProperty(JSON_PROPERTY_MAX_CHUNK_COUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getMaxChunkCount_JsonNullable() { - return maxChunkCount; - } - - @JsonProperty(JSON_PROPERTY_MAX_CHUNK_COUNT) - public void setMaxChunkCount_JsonNullable(JsonNullable maxChunkCount) { - this.maxChunkCount = maxChunkCount; - } - - public GroundingFilterSearchConfiguration maxDocumentCount(Integer maxDocumentCount) { - this.maxDocumentCount = JsonNullable.of(maxDocumentCount); - - return this; - } - - /** - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be - * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only - * one chunk per document is returned. minimum: 0 - * - * @return maxDocumentCount - */ - @javax.annotation.Nullable - @JsonIgnore - public Integer getMaxDocumentCount() { - return maxDocumentCount.orElse(null); - } - - public void setMaxDocumentCount(Integer maxDocumentCount) { - this.maxDocumentCount = JsonNullable.of(maxDocumentCount); - } - - @JsonProperty(JSON_PROPERTY_MAX_DOCUMENT_COUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getMaxDocumentCount_JsonNullable() { - return maxDocumentCount; - } - - @JsonProperty(JSON_PROPERTY_MAX_DOCUMENT_COUNT) - public void setMaxDocumentCount_JsonNullable(JsonNullable maxDocumentCount) { - this.maxDocumentCount = maxDocumentCount; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GroundingFilterSearchConfiguration groundingFilterSearchConfiguration = - (GroundingFilterSearchConfiguration) o; - return equalsNullable(this.maxChunkCount, groundingFilterSearchConfiguration.maxChunkCount) - && equalsNullable( - this.maxDocumentCount, groundingFilterSearchConfiguration.maxDocumentCount); - } - - @Override - public int hashCode() { - return Objects.hash(hashCodeNullable(maxChunkCount), hashCodeNullable(maxDocumentCount)); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GroundingFilterSearchConfiguration {\n"); - sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); - sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public GroundingFilterSearchConfiguration.Builder toBuilder() { - return new GroundingFilterSearchConfiguration.Builder() - .maxChunkCount(getMaxChunkCount()) - .maxDocumentCount(getMaxDocumentCount()); - } - - public static class Builder { - - private GroundingFilterSearchConfiguration instance; - - public Builder() { - this(new GroundingFilterSearchConfiguration()); - } - - protected Builder(GroundingFilterSearchConfiguration instance) { - this.instance = instance; - } - - public GroundingFilterSearchConfiguration.Builder maxChunkCount(Integer maxChunkCount) { - this.instance.maxChunkCount = JsonNullable.of(maxChunkCount); - return this; - } - - public GroundingFilterSearchConfiguration.Builder maxChunkCount( - JsonNullable maxChunkCount) { - this.instance.maxChunkCount = maxChunkCount; - return this; - } - - public GroundingFilterSearchConfiguration.Builder maxDocumentCount(Integer maxDocumentCount) { - this.instance.maxDocumentCount = JsonNullable.of(maxDocumentCount); - return this; - } - - public GroundingFilterSearchConfiguration.Builder maxDocumentCount( - JsonNullable maxDocumentCount) { - this.instance.maxDocumentCount = maxDocumentCount; - return this; - } - - /** - * returns a built GroundingFilterSearchConfiguration instance. - * - *

The builder is not reusable. - */ - public GroundingFilterSearchConfiguration build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java deleted file mode 100644 index d57864ab7..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; - -/** GroundingModuleConfig */ -@JsonPropertyOrder({ - GroundingModuleConfig.JSON_PROPERTY_TYPE, - GroundingModuleConfig.JSON_PROPERTY_CONFIG -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class GroundingModuleConfig { - public static final String JSON_PROPERTY_TYPE = "type"; - public static final String JSON_PROPERTY_CONFIG = "config"; - private TypeEnum type; - private GroundingModuleConfigConfig config; - - public GroundingModuleConfig() {} - - /** Create a builder with no initialized field. */ - public static GroundingModuleConfig.Builder builder() { - return new GroundingModuleConfig.Builder(); - } - - public GroundingModuleConfig type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TypeEnum getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(TypeEnum type) { - this.type = type; - } - - public GroundingModuleConfig config(GroundingModuleConfigConfig config) { - - this.config = config; - return this; - } - - /** - * Get config - * - * @return config - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CONFIG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public GroundingModuleConfigConfig getConfig() { - return config; - } - - @JsonProperty(JSON_PROPERTY_CONFIG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setConfig(GroundingModuleConfigConfig config) { - this.config = config; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GroundingModuleConfig groundingModuleConfig = (GroundingModuleConfig) o; - return Objects.equals(this.type, groundingModuleConfig.type) - && Objects.equals(this.config, groundingModuleConfig.config); - } - - @Override - public int hashCode() { - return Objects.hash(type, config); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfig {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public GroundingModuleConfig.Builder toBuilder() { - return new GroundingModuleConfig.Builder().type(getType()).config(getConfig()); - } - - /** Gets or Sets type */ - public enum TypeEnum { - DOCUMENT_GROUNDING_SERVICE("document_grounding_service"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - public static class Builder { - - private GroundingModuleConfig instance; - - public Builder() { - this(new GroundingModuleConfig()); - } - - protected Builder(GroundingModuleConfig instance) { - this.instance = instance; - } - - public GroundingModuleConfig.Builder type(TypeEnum type) { - this.instance.type = type; - return this; - } - - public GroundingModuleConfig.Builder config(GroundingModuleConfigConfig config) { - this.instance.config = config; - return this; - } - - /** - * returns a built GroundingModuleConfig instance. - * - *

The builder is not reusable. - */ - public GroundingModuleConfig build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java deleted file mode 100644 index e0a9d3fab..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** GroundingModuleConfigConfig */ -@JsonPropertyOrder({ - GroundingModuleConfigConfig.JSON_PROPERTY_FILTERS, - GroundingModuleConfigConfig.JSON_PROPERTY_INPUT_PARAMS, - GroundingModuleConfigConfig.JSON_PROPERTY_OUTPUT_PARAM -}) -@JsonTypeName("GroundingModuleConfig_config") -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class GroundingModuleConfigConfig { - public static final String JSON_PROPERTY_FILTERS = "filters"; - public static final String JSON_PROPERTY_INPUT_PARAMS = "input_params"; - public static final String JSON_PROPERTY_OUTPUT_PARAM = "output_param"; - private List filters = new ArrayList<>(); - private List inputParams = new ArrayList<>(); - private String outputParam; - - public GroundingModuleConfigConfig() {} - - /** Create a builder with no initialized field. */ - public static GroundingModuleConfigConfig.Builder builder() { - return new GroundingModuleConfigConfig.Builder(); - } - - public GroundingModuleConfigConfig filters( - List filters) { - - this.filters = filters; - return this; - } - - public GroundingModuleConfigConfig addFiltersItem( - GroundingModuleConfigConfigFiltersInner filtersItem) { - if (this.filters == null) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - - /** - * Document grounding service filters to be used - * - * @return filters - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILTERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFilters() { - return filters; - } - - @JsonProperty(JSON_PROPERTY_FILTERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilters(List filters) { - this.filters = filters; - } - - public GroundingModuleConfigConfig inputParams(List inputParams) { - - this.inputParams = inputParams; - return this; - } - - public GroundingModuleConfigConfig addInputParamsItem(String inputParamsItem) { - if (this.inputParams == null) { - this.inputParams = new ArrayList<>(); - } - this.inputParams.add(inputParamsItem); - return this; - } - - /** - * Contains the input parameters used for grounding input questions - * - * @return inputParams - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_INPUT_PARAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getInputParams() { - return inputParams; - } - - @JsonProperty(JSON_PROPERTY_INPUT_PARAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setInputParams(List inputParams) { - this.inputParams = inputParams; - } - - public GroundingModuleConfigConfig outputParam(String outputParam) { - - this.outputParam = outputParam; - return this; - } - - /** - * Parameter name used for grounding output - * - * @return outputParam - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_OUTPUT_PARAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getOutputParam() { - return outputParam; - } - - @JsonProperty(JSON_PROPERTY_OUTPUT_PARAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOutputParam(String outputParam) { - this.outputParam = outputParam; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GroundingModuleConfigConfig groundingModuleConfigConfig = (GroundingModuleConfigConfig) o; - return Objects.equals(this.filters, groundingModuleConfigConfig.filters) - && Objects.equals(this.inputParams, groundingModuleConfigConfig.inputParams) - && Objects.equals(this.outputParam, groundingModuleConfigConfig.outputParam); - } - - @Override - public int hashCode() { - return Objects.hash(filters, inputParams, outputParam); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfigConfig {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" inputParams: ").append(toIndentedString(inputParams)).append("\n"); - sb.append(" outputParam: ").append(toIndentedString(outputParam)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public GroundingModuleConfigConfig.Builder toBuilder() { - return new GroundingModuleConfigConfig.Builder() - .filters(getFilters()) - .inputParams(getInputParams()) - .outputParam(getOutputParam()); - } - - public static class Builder { - - private GroundingModuleConfigConfig instance; - - public Builder() { - this(new GroundingModuleConfigConfig()); - } - - protected Builder(GroundingModuleConfigConfig instance) { - this.instance = instance; - } - - public GroundingModuleConfigConfig.Builder filters( - List filters) { - this.instance.filters = filters; - return this; - } - - public GroundingModuleConfigConfig.Builder inputParams(List inputParams) { - this.instance.inputParams = inputParams; - return this; - } - - public GroundingModuleConfigConfig.Builder outputParam(String outputParam) { - this.instance.outputParam = outputParam; - return this; - } - - /** - * returns a built GroundingModuleConfigConfig instance. - * - *

The builder is not reusable. - */ - public GroundingModuleConfigConfig build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java deleted file mode 100644 index 6c2220f75..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -@JsonIgnoreProperties( - value = "", // ignore manually set , it will be automatically generated by Jackson during - // serialization - allowSetters = true // allows the to be set during deserialization - ) -@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) -public interface GroundingModuleConfigConfigFiltersInner {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java deleted file mode 100644 index e0c7b349c..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** KeyValueListPair */ -@JsonPropertyOrder({KeyValueListPair.JSON_PROPERTY_KEY, KeyValueListPair.JSON_PROPERTY_VALUE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class KeyValueListPair { - public static final String JSON_PROPERTY_KEY = "key"; - public static final String JSON_PROPERTY_VALUE = "value"; - private String key; - private List value = new ArrayList<>(); - - public KeyValueListPair() {} - - /** Create a builder with no initialized field. */ - public static KeyValueListPair.Builder builder() { - return new KeyValueListPair.Builder(); - } - - public KeyValueListPair key(String key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getKey() { - return key; - } - - @JsonProperty(JSON_PROPERTY_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setKey(String key) { - this.key = key; - } - - public KeyValueListPair value(List value) { - - this.value = value; - return this; - } - - public KeyValueListPair addValueItem(String valueItem) { - if (this.value == null) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setValue(List value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - KeyValueListPair keyValueListPair = (KeyValueListPair) o; - return Objects.equals(this.key, keyValueListPair.key) - && Objects.equals(this.value, keyValueListPair.value); - } - - @Override - public int hashCode() { - return Objects.hash(key, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class KeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public KeyValueListPair.Builder toBuilder() { - return new KeyValueListPair.Builder().key(getKey()).value(getValue()); - } - - public static class Builder { - - private KeyValueListPair instance; - - public Builder() { - this(new KeyValueListPair()); - } - - protected Builder(KeyValueListPair instance) { - this.instance = instance; - } - - public KeyValueListPair.Builder key(String key) { - this.instance.key = key; - return this; - } - - public KeyValueListPair.Builder value(List value) { - this.instance.value = value; - return this; - } - - /** - * returns a built KeyValueListPair instance. - * - *

The builder is not reusable. - */ - public KeyValueListPair build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleConfig.java index 172a18623..f6de3861a 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleConfig.java @@ -29,11 +29,12 @@ comments = "Generator version: 7.9.0") public class LLMModuleConfig { public static final String JSON_PROPERTY_MODEL_NAME = "model_name"; - public static final String JSON_PROPERTY_MODEL_VERSION = "model_version"; + private String modelName; public static final String JSON_PROPERTY_MODEL_PARAMS = "model_params"; private Object modelParams; - private String modelName; + + public static final String JSON_PROPERTY_MODEL_VERSION = "model_version"; private String modelVersion = "latest"; public LLMModuleConfig() {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResult.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResult.java index 1d36779a1..a3b32b66b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResult.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResult.java @@ -12,10 +12,20 @@ package com.sap.ai.sdk.orchestration.client.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; -// ignore manually set , it will be automatically generated by Jackson during -// serialization -// allows the to be set during deserialization -@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.9.0") +@JsonIgnoreProperties( + value = "", // ignore manually set , it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "", + visible = true) public interface LLMModuleResult {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java index f05ce0dc4..387276f96 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java @@ -12,12 +12,20 @@ package com.sap.ai.sdk.orchestration.client.model; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; -@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) -@JsonSubTypes({ - @JsonSubTypes.Type(value = LLMChoice.class, name = "LLMChoice"), - @JsonSubTypes.Type(value = LLMChoiceStreaming.class, name = "LLMChoiceStreaming") -}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.9.0") +@JsonIgnoreProperties( + value = "", // ignore manually set , it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "", + visible = true) public interface ModuleResultsOutputUnmaskingInner {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationV1EndpointsHealthz503Response.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationV1EndpointsHealthz503Response.java deleted file mode 100644 index 6d192ea4d..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationV1EndpointsHealthz503Response.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OrchestrationV1EndpointsHealthz503Response */ -// CHECKSTYLE:OFF -public class OrchestrationV1EndpointsHealthz503Response -// CHECKSTYLE:ON -{ - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - @JsonProperty("status") - private String status; - - protected OrchestrationV1EndpointsHealthz503Response() {} - - /** - * Create a new {@link OrchestrationV1EndpointsHealthz503Response} instance. No arguments are - * required. - */ - public static OrchestrationV1EndpointsHealthz503Response create() { - return new OrchestrationV1EndpointsHealthz503Response(); - } - - /** - * Set the status of this {@link OrchestrationV1EndpointsHealthz503Response} instance and return - * the same instance. - * - * @param status The status of this {@link OrchestrationV1EndpointsHealthz503Response} - * @return The same instance of this {@link OrchestrationV1EndpointsHealthz503Response} class - */ - @Nonnull - public OrchestrationV1EndpointsHealthz503Response status(@Nullable final String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status The status of this {@link OrchestrationV1EndpointsHealthz503Response} instance. - */ - @Nonnull - public String getStatus() { - return status; - } - - /** - * Set the status of this {@link OrchestrationV1EndpointsHealthz503Response} instance. - * - * @param status The status of this {@link OrchestrationV1EndpointsHealthz503Response} - */ - public void setStatus(@Nullable final String status) { - this.status = status; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OrchestrationV1EndpointsHealthz503Response}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OrchestrationV1EndpointsHealthz503Response} instance. - * - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OrchestrationV1EndpointsHealthz503Response has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link OrchestrationV1EndpointsHealthz503Response} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OrchestrationV1EndpointsHealthz503Response orchestrationV1EndpointsHealthz503Response = - (OrchestrationV1EndpointsHealthz503Response) o; - return Objects.equals( - this.cloudSdkCustomFields, - orchestrationV1EndpointsHealthz503Response.cloudSdkCustomFields) - && Objects.equals(this.status, orchestrationV1EndpointsHealthz503Response.status); - } - - @Override - public int hashCode() { - return Objects.hash(status, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OrchestrationV1EndpointsHealthz503Response {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java deleted file mode 100644 index 3509a3b4a..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** SearchDocumentKeyValueListPair */ -@JsonPropertyOrder({ - SearchDocumentKeyValueListPair.JSON_PROPERTY_KEY, - SearchDocumentKeyValueListPair.JSON_PROPERTY_VALUE, - SearchDocumentKeyValueListPair.JSON_PROPERTY_SELECT_MODE -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class SearchDocumentKeyValueListPair { - public static final String JSON_PROPERTY_KEY = "key"; - public static final String JSON_PROPERTY_VALUE = "value"; - public static final String JSON_PROPERTY_SELECT_MODE = "select_mode"; - private String key; - private List value = new ArrayList<>(); - private List selectMode = new ArrayList<>(); - - public SearchDocumentKeyValueListPair() {} - - /** Create a builder with no initialized field. */ - public static SearchDocumentKeyValueListPair.Builder builder() { - return new SearchDocumentKeyValueListPair.Builder(); - } - - public SearchDocumentKeyValueListPair key(String key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getKey() { - return key; - } - - @JsonProperty(JSON_PROPERTY_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setKey(String key) { - this.key = key; - } - - public SearchDocumentKeyValueListPair value(List value) { - - this.value = value; - return this; - } - - public SearchDocumentKeyValueListPair addValueItem(String valueItem) { - if (this.value == null) { - this.value = new ArrayList<>(); - } - this.value.add(valueItem); - return this; - } - - /** - * Get value - * - * @return value - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setValue(List value) { - this.value = value; - } - - public SearchDocumentKeyValueListPair selectMode(List selectMode) { - - this.selectMode = selectMode; - return this; - } - - public SearchDocumentKeyValueListPair addSelectModeItem(SearchSelectOptionEnum selectModeItem) { - if (this.selectMode == null) { - this.selectMode = new ArrayList<>(); - } - this.selectMode.add(selectModeItem); - return this; - } - - /** - * Select mode for search filters - * - * @return selectMode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SELECT_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSelectMode() { - return selectMode; - } - - @JsonProperty(JSON_PROPERTY_SELECT_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSelectMode(List selectMode) { - this.selectMode = selectMode; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = - (SearchDocumentKeyValueListPair) o; - return Objects.equals(this.key, searchDocumentKeyValueListPair.key) - && Objects.equals(this.value, searchDocumentKeyValueListPair.value) - && Objects.equals(this.selectMode, searchDocumentKeyValueListPair.selectMode); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, selectMode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SearchDocumentKeyValueListPair {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" selectMode: ").append(toIndentedString(selectMode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public SearchDocumentKeyValueListPair.Builder toBuilder() { - return new SearchDocumentKeyValueListPair.Builder() - .key(getKey()) - .value(getValue()) - .selectMode(getSelectMode()); - } - - public static class Builder { - - private SearchDocumentKeyValueListPair instance; - - public Builder() { - this(new SearchDocumentKeyValueListPair()); - } - - protected Builder(SearchDocumentKeyValueListPair instance) { - this.instance = instance; - } - - public SearchDocumentKeyValueListPair.Builder key(String key) { - this.instance.key = key; - return this; - } - - public SearchDocumentKeyValueListPair.Builder value(List value) { - this.instance.value = value; - return this; - } - - public SearchDocumentKeyValueListPair.Builder selectMode( - List selectMode) { - this.instance.selectMode = selectMode; - return this; - } - - /** - * returns a built SearchDocumentKeyValueListPair instance. - * - *

The builder is not reusable. - */ - public SearchDocumentKeyValueListPair build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java deleted file mode 100644 index 36036a4fa..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Gets or Sets SearchSelectOptionEnum */ -public enum SearchSelectOptionEnum { - IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SearchSelectOptionEnum(String value) { - this.value = value; - } - - @JsonCreator - public static SearchSelectOptionEnum fromValue(String value) { - for (SearchSelectOptionEnum b : SearchSelectOptionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java deleted file mode 100644 index bf84de777..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.Objects; - -/** TemplateRef */ -@JsonPropertyOrder({TemplateRef.JSON_PROPERTY_TEMPLATE_REF}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class TemplateRef { - public static final String JSON_PROPERTY_TEMPLATE_REF = "template_ref"; - private TemplateRefTemplateRef templateRef; - - public TemplateRef() {} - - /** Create a builder with no initialized field. */ - public static TemplateRef.Builder builder() { - return new TemplateRef.Builder(); - } - - public TemplateRef templateRef(TemplateRefTemplateRef templateRef) { - - this.templateRef = templateRef; - return this; - } - - /** - * Get templateRef - * - * @return templateRef - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_REF) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TemplateRefTemplateRef getTemplateRef() { - return templateRef; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_REF) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateRef(TemplateRefTemplateRef templateRef) { - this.templateRef = templateRef; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateRef templateRef = (TemplateRef) o; - return Objects.equals(this.templateRef, templateRef.templateRef); - } - - @Override - public int hashCode() { - return Objects.hash(templateRef); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRef {\n"); - sb.append(" templateRef: ").append(toIndentedString(templateRef)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public TemplateRef.Builder toBuilder() { - return new TemplateRef.Builder().templateRef(getTemplateRef()); - } - - public static class Builder { - - private TemplateRef instance; - - public Builder() { - this(new TemplateRef()); - } - - protected Builder(TemplateRef instance) { - this.instance = instance; - } - - public TemplateRef.Builder templateRef(TemplateRefTemplateRef templateRef) { - this.instance.templateRef = templateRef; - return this; - } - - /** - * returns a built TemplateRef instance. - * - *

The builder is not reusable. - */ - public TemplateRef build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java deleted file mode 100644 index 28ed912e1..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.Objects; - -/** TemplateRefByID */ -@JsonPropertyOrder({TemplateRefByID.JSON_PROPERTY_ID}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class TemplateRefByID implements TemplateRefTemplateRef { - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public TemplateRefByID() {} - - /** Create a builder with no initialized field. */ - public static TemplateRefByID.Builder builder() { - return new TemplateRefByID.Builder(); - } - - public TemplateRefByID id(String id) { - - this.id = id; - return this; - } - - /** - * ID of the template in prompt registry - * - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateRefByID templateRefByID = (TemplateRefByID) o; - return Objects.equals(this.id, templateRefByID.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRefByID {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public TemplateRefByID.Builder toBuilder() { - return new TemplateRefByID.Builder().id(getId()); - } - - public static class Builder { - - private TemplateRefByID instance; - - public Builder() { - this(new TemplateRefByID()); - } - - protected Builder(TemplateRefByID instance) { - this.instance = instance; - } - - public TemplateRefByID.Builder id(String id) { - this.instance.id = id; - return this; - } - - /** - * returns a built TemplateRefByID instance. - * - *

The builder is not reusable. - */ - public TemplateRefByID build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java deleted file mode 100644 index fb41fad2c..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.Objects; - -/** TemplateRefByScenarioNameVersion */ -@JsonPropertyOrder({ - TemplateRefByScenarioNameVersion.JSON_PROPERTY_SCENARIO, - TemplateRefByScenarioNameVersion.JSON_PROPERTY_NAME, - TemplateRefByScenarioNameVersion.JSON_PROPERTY_VERSION -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -public class TemplateRefByScenarioNameVersion { - public static final String JSON_PROPERTY_SCENARIO = "scenario"; - public static final String JSON_PROPERTY_NAME = "name"; - public static final String JSON_PROPERTY_VERSION = "version"; - private String scenario; - private String name; - private String version; - - public TemplateRefByScenarioNameVersion() {} - - /** Create a builder with no initialized field. */ - public static TemplateRefByScenarioNameVersion.Builder builder() { - return new TemplateRefByScenarioNameVersion.Builder(); - } - - public TemplateRefByScenarioNameVersion scenario(String scenario) { - - this.scenario = scenario; - return this; - } - - /** - * Scenario name - * - * @return scenario - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SCENARIO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getScenario() { - return scenario; - } - - @JsonProperty(JSON_PROPERTY_SCENARIO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setScenario(String scenario) { - this.scenario = scenario; - } - - public TemplateRefByScenarioNameVersion name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the template - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - public TemplateRefByScenarioNameVersion version(String version) { - - this.version = version; - return this; - } - - /** - * Version of the template - * - * @return version - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getVersion() { - return version; - } - - @JsonProperty(JSON_PROPERTY_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setVersion(String version) { - this.version = version; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateRefByScenarioNameVersion templateRefByScenarioNameVersion = - (TemplateRefByScenarioNameVersion) o; - return Objects.equals(this.scenario, templateRefByScenarioNameVersion.scenario) - && Objects.equals(this.name, templateRefByScenarioNameVersion.name) - && Objects.equals(this.version, templateRefByScenarioNameVersion.version); - } - - @Override - public int hashCode() { - return Objects.hash(scenario, name, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRefByScenarioNameVersion {\n"); - sb.append(" scenario: ").append(toIndentedString(scenario)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a builder with a shallow copy of this instance. */ - public TemplateRefByScenarioNameVersion.Builder toBuilder() { - return new TemplateRefByScenarioNameVersion.Builder() - .scenario(getScenario()) - .name(getName()) - .version(getVersion()); - } - - public static class Builder { - - private TemplateRefByScenarioNameVersion instance; - - public Builder() { - this(new TemplateRefByScenarioNameVersion()); - } - - protected Builder(TemplateRefByScenarioNameVersion instance) { - this.instance = instance; - } - - public TemplateRefByScenarioNameVersion.Builder scenario(String scenario) { - this.instance.scenario = scenario; - return this; - } - - public TemplateRefByScenarioNameVersion.Builder name(String name) { - this.instance.name = name; - return this; - } - - public TemplateRefByScenarioNameVersion.Builder version(String version) { - this.instance.version = version; - return this; - } - - /** - * returns a built TemplateRefByScenarioNameVersion instance. - * - *

The builder is not reusable. - */ - public TemplateRefByScenarioNameVersion build() { - try { - return this.instance; - } finally { - // ensure that this.instance is not reused - this.instance = null; - } - } - - @Override - public String toString() { - return getClass() + "=(" + instance + ")"; - } - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java deleted file mode 100644 index cec1ce89c..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.9.0") -@JsonIgnoreProperties( - value = "", // ignore manually set , it will be automatically generated by Jackson during - // serialization - allowSetters = true // allows the to be set during deserialization - ) -@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) -public interface TemplateRefTemplateRef {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TokenUsage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TokenUsage.java index 65715ee9c..24eaba3b3 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TokenUsage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TokenUsage.java @@ -29,11 +29,12 @@ comments = "Generator version: 7.9.0") public class TokenUsage { public static final String JSON_PROPERTY_COMPLETION_TOKENS = "completion_tokens"; - public static final String JSON_PROPERTY_TOTAL_TOKENS = "total_tokens"; + private Integer completionTokens; public static final String JSON_PROPERTY_PROMPT_TOKENS = "prompt_tokens"; private Integer promptTokens; - private Integer completionTokens; + + public static final String JSON_PROPERTY_TOTAL_TOKENS = "total_tokens"; private Integer totalTokens; public TokenUsage() {} diff --git a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializerTest.java b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializerTest.java index 76642eb04..37089f6e6 100644 --- a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializerTest.java +++ b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/LLMModuleResultDeserializerTest.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.sap.ai.sdk.orchestration.client.model.LLMModuleResult; -import com.sap.ai.sdk.orchestration.client.model.LLMModuleResultStreaming; import com.sap.ai.sdk.orchestration.client.model.LLMModuleResultSynchronous; import lombok.SneakyThrows; import org.junit.jupiter.api.Test; @@ -54,42 +53,4 @@ void testSubtypeResolutionSynchronous() { // Assert assertThat(result).isExactlyInstanceOf(LLMModuleResultSynchronous.class); } - - @SneakyThrows - @Test - void testSubtypeResolutionStreaming() { - var choices = - """ - [ - { - "index": 0, - "delta": { - "content": "Sample response content." - } - } - ] - """; - - var json = String.format(jsonTemplate, choices); - - // Deserialize JSON content - LLMModuleResult result = objectMapper.readValue(json, LLMModuleResult.class); - - // Assert - assertThat(result).isExactlyInstanceOf(LLMModuleResultStreaming.class); - } - - @SneakyThrows - @Test - void testSubtypeResolutionEmptyChoices() { - - String choice = "[]"; - var json = String.format(jsonTemplate, choice); - - // Deserialize JSON content - LLMModuleResult result = objectMapper.readValue(json, LLMModuleResult.class); - - // Assert - assertThat(result).isExactlyInstanceOf(LLMModuleResultSynchronous.class); - } }