From 61d3fc51ced96dd31984884d7baed6463ff53e3b Mon Sep 17 00:00:00 2001 From: Matthias Kuhr <52661546+MatKuhr@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:15:33 +0100 Subject: [PATCH] feat: [Orchestration] Update to Orchestration Spec 0.36.1 (#203) * Update to Orchestration Spec 0.36.1 * Update test payload * update spec, remove help.sap.com --- .../model/AzureContentSafety.java | 2 +- .../model/AzureContentSafetyFilterConfig.java | 2 +- .../orchestration/model/AzureThreshold.java | 2 +- .../ai/sdk/orchestration/model/ChatDelta.java | 2 +- .../sdk/orchestration/model/ChatMessage.java | 2 +- .../model/CompletionPostRequest.java | 2 +- .../model/CompletionPostResponse.java | 2 +- .../CompletionPostResponseStreaming.java | 2 +- .../ai/sdk/orchestration/model/DPIConfig.java | 57 +- .../sdk/orchestration/model/DPIEntities.java | 2 +- .../orchestration/model/DPIEntityConfig.java | 2 +- .../model/DataRepositoryType.java | 65 +++ .../model/DocumentGroundingFilter.java | 504 ++++++++++++++++++ .../orchestration/model/ErrorResponse.java | 2 +- .../sdk/orchestration/model/FilterConfig.java | 2 +- .../model/FilteringModuleConfig.java | 2 +- .../model/FilteringStreamOptions.java | 2 +- .../model/GenericModuleResult.java | 2 +- .../model/GlobalStreamOptions.java | 2 +- .../GroundingFilterSearchConfiguration.java | 215 ++++++++ .../model/GroundingModuleConfig.java | 274 ++++++++++ .../model/GroundingModuleConfigConfig.java | 306 +++++++++++ ...oundingModuleConfigConfigFiltersInner.java | 23 + .../model/InputFilteringConfig.java | 2 +- .../orchestration/model/KeyValueListPair.java | 245 +++++++++ .../ai/sdk/orchestration/model/LLMChoice.java | 2 +- .../model/LLMChoiceStreaming.java | 2 +- .../orchestration/model/LLMModuleConfig.java | 2 +- .../orchestration/model/LLMModuleResult.java | 2 +- .../model/LLMModuleResultStreaming.java | 2 +- .../model/LLMModuleResultSynchronous.java | 2 +- .../model/MaskingModuleConfig.java | 2 +- .../model/MaskingProviderConfig.java | 2 +- .../orchestration/model/ModuleConfigs.java | 46 +- .../orchestration/model/ModuleResults.java | 39 +- .../ModuleResultsOutputUnmaskingInner.java | 2 +- .../model/OrchestrationConfig.java | 2 +- .../model/OutputFilteringConfig.java | 2 +- .../model/SearchDocumentKeyValueListPair.java | 306 +++++++++++ .../model/SearchSelectOptionEnum.java | 63 +++ .../ai/sdk/orchestration/model/Template.java | 2 +- .../sdk/orchestration/model/TemplateRef.java | 170 ++++++ .../orchestration/model/TemplateRefByID.java | 170 ++++++ .../TemplateRefByScenarioNameVersion.java | 278 ++++++++++ .../model/TemplateRefTemplateRef.java | 23 + .../model/TemplatingModuleConfig.java | 2 +- .../sdk/orchestration/model/TokenUsage.java | 2 +- .../main/resources/spec/orchestration.yaml | 412 +++++++++++--- .../src/test/resources/maskingRequest.json | 3 +- 49 files changed, 3147 insertions(+), 114 deletions(-) create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java index 726155059..abbea194f 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java index 4f58dcb40..0c84e4e20 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java index 9a11aa2d3..7a7b38a7b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java index 762a1fe06..a0b4596c1 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java index 8709c6067..a5b0e575d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java index 206c5c7f9..2c833d951 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java index f74d15d26..74bc49e40 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java index 96339b572..fc7fcd6b9 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java index 199de0167..cbf7f0861 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -155,6 +155,9 @@ public static MethodEnum fromValue(@Nonnull final String value) { @JsonProperty("entities") private List entities = new ArrayList<>(); + @JsonProperty("allowlist") + private List allowlist = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -269,6 +272,52 @@ public void setEntities(@Nonnull final List entities) { this.entities = entities; } + /** + * Set the allowlist of this {@link DPIConfig} instance and return the same instance. + * + * @param allowlist List of strings that should not be masked + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig allowlist(@Nullable final List allowlist) { + this.allowlist = allowlist; + return this; + } + + /** + * Add one allowlist instance to this {@link DPIConfig}. + * + * @param allowlistItem The allowlist that should be added + * @return The same instance of type {@link DPIConfig} + */ + @Nonnull + public DPIConfig addAllowlistItem(@Nonnull final String allowlistItem) { + if (this.allowlist == null) { + this.allowlist = new ArrayList<>(); + } + this.allowlist.add(allowlistItem); + return this; + } + + /** + * List of strings that should not be masked + * + * @return allowlist The allowlist of this {@link DPIConfig} instance. + */ + @Nonnull + public List getAllowlist() { + return allowlist; + } + + /** + * Set the allowlist of this {@link DPIConfig} instance. + * + * @param allowlist List of strings that should not be masked + */ + public void setAllowlist(@Nullable final List allowlist) { + this.allowlist = allowlist; + } + /** * Get the names of the unrecognizable properties of the {@link DPIConfig}. * @@ -319,12 +368,13 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, dpIConfig.cloudSdkCustomFields) && Objects.equals(this.type, dpIConfig.type) && Objects.equals(this.method, dpIConfig.method) - && Objects.equals(this.entities, dpIConfig.entities); + && Objects.equals(this.entities, dpIConfig.entities) + && Objects.equals(this.allowlist, dpIConfig.allowlist); } @Override public int hashCode() { - return Objects.hash(type, method, entities, cloudSdkCustomFields); + return Objects.hash(type, method, entities, allowlist, cloudSdkCustomFields); } @Override @@ -335,6 +385,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java index 8eb69dc86..eb9b4f0c3 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java index 89ad10677..73b49aeb4 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java new file mode 100644 index 000000000..5408b2fca --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java @@ -0,0 +1,65 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets DataRepositoryType */ +public enum DataRepositoryType { + VECTOR("vector"), + + HELP_SAP_COM("help.sap.com"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + DataRepositoryType(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static DataRepositoryType fromValue(@Nonnull final String value) { + for (final DataRepositoryType b : DataRepositoryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java new file mode 100644 index 000000000..d2da77815 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java @@ -0,0 +1,504 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentGroundingFilter */ +@Beta // CHECKSTYLE:OFF +public class DocumentGroundingFilter implements GroundingModuleConfigConfigFiltersInner +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private Object id = null; + + @JsonProperty("search_config") + private GroundingFilterSearchConfiguration searchConfig; + + @JsonProperty("data_repositories") + private List dataRepositories = new ArrayList<>(Arrays.asList("*")); + + @JsonProperty("data_repository_type") + private DataRepositoryType dataRepositoryType; + + @JsonProperty("data_repository_metadata") + private List dataRepositoryMetadata = new ArrayList<>(); + + @JsonProperty("document_metadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunk_metadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentGroundingFilter. */ + protected DocumentGroundingFilter() {} + + /** + * Set the id of this {@link DocumentGroundingFilter} instance and return the same instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter id(@Nullable final Object id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link DocumentGroundingFilter} instance. + */ + @Nullable + public Object getId() { + return id; + } + + /** + * Set the id of this {@link DocumentGroundingFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + */ + public void setId(@Nullable final Object id) { + this.id = id; + } + + /** + * Set the searchConfig of this {@link DocumentGroundingFilter} instance and return the same + * instance. + * + * @param searchConfig The searchConfig of this {@link DocumentGroundingFilter} + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter searchConfig( + @Nullable final GroundingFilterSearchConfiguration searchConfig) { + this.searchConfig = searchConfig; + return this; + } + + /** + * Get searchConfig + * + * @return searchConfig The searchConfig of this {@link DocumentGroundingFilter} instance. + */ + @Nullable + public GroundingFilterSearchConfiguration getSearchConfig() { + return searchConfig; + } + + /** + * Set the searchConfig of this {@link DocumentGroundingFilter} instance. + * + * @param searchConfig The searchConfig of this {@link DocumentGroundingFilter} + */ + public void setSearchConfig(@Nullable final GroundingFilterSearchConfiguration searchConfig) { + this.searchConfig = searchConfig; + } + + /** + * Set the dataRepositories of this {@link DocumentGroundingFilter} instance and return the same + * instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + return this; + } + + /** + * Add one dataRepositories instance to this {@link DocumentGroundingFilter}. + * + * @param dataRepositoriesItem The dataRepositories that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDataRepositoriesItem( + @Nonnull final 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 The dataRepositories of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDataRepositories() { + return dataRepositories; + } + + /** + * Set the dataRepositories of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositories Specify ['*'] to search across all DataRepositories or give a + * specific list of DataRepository ids. + */ + public void setDataRepositories(@Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + } + + /** + * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance and return the same + * instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + return this; + } + + /** + * Get dataRepositoryType + * + * @return dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} + * instance. + */ + @Nullable + public DataRepositoryType getDataRepositoryType() { + return dataRepositoryType; + } + + /** + * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} + */ + public void setDataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + } + + /** + * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance and return the + * same instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter dataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + return this; + } + + /** + * Add one dataRepositoryMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDataRepositoryMetadataItem( + @Nonnull final 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 The dataRepositoryMetadata of this {@link + * DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDataRepositoryMetadata() { + return dataRepositoryMetadata; + } + + /** + * Set the dataRepositoryMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositoryMetadata Restrict DataRepositories considered during search to those + * annotated with the given metadata. Useful when combined with + * dataRepositories=['*'] + */ + public void setDataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + } + + /** + * Set the documentMetadata of this {@link DocumentGroundingFilter} instance and return the same + * instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addDocumentMetadataItem( + @Nonnull final 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 The documentMetadata of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance and return the same + * instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link DocumentGroundingFilter} class + */ + @Nonnull + public DocumentGroundingFilter chunkMetadata( + @Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link DocumentGroundingFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link DocumentGroundingFilter} + */ + @Nonnull + public DocumentGroundingFilter addChunkMetadataItem( + @Nonnull final 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 The chunkMetadata of this {@link DocumentGroundingFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link DocumentGroundingFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentGroundingFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentGroundingFilter} 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( + "DocumentGroundingFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link DocumentGroundingFilter} 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 DocumentGroundingFilter documentGroundingFilter = (DocumentGroundingFilter) o; + return Objects.equals(this.cloudSdkCustomFields, documentGroundingFilter.cloudSdkCustomFields) + && Objects.equals(this.id, documentGroundingFilter.id) + && Objects.equals(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, + searchConfig, + dataRepositories, + dataRepositoryType, + dataRepositoryMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DocumentGroundingFilter} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (dataRepositoryType) -> + new DocumentGroundingFilter().id(id).dataRepositoryType(dataRepositoryType); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link DocumentGroundingFilter} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The DocumentGroundingFilter builder. + */ + Builder1 id(@Nullable final Object id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the dataRepositoryType of this {@link DocumentGroundingFilter} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link DocumentGroundingFilter} + * @return The DocumentGroundingFilter instance. + */ + DocumentGroundingFilter dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java index 90fd92b64..17a9e2147 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java index 187b7e997..22b7d4efa 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java index e43755cb8..d5f183dfe 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java index b00926a27..15cd4a606 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java index a993bb608..2d41e63cb 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java index 9328ebb5e..4c0e5d00b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java new file mode 100644 index 000000000..ece76d573 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java @@ -0,0 +1,215 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +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; + +/** GroundingFilterSearchConfiguration */ +@Beta // CHECKSTYLE:OFF +public class GroundingFilterSearchConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("max_chunk_count") + private Integer maxChunkCount; + + @JsonProperty("max_document_count") + private Integer maxDocumentCount; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GroundingFilterSearchConfiguration. */ + protected GroundingFilterSearchConfiguration() {} + + /** + * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance and return + * the same instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 + * @return The same instance of this {@link GroundingFilterSearchConfiguration} class + */ + @Nonnull + public GroundingFilterSearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + return this; + } + + /** + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + * minimum: 0 + * + * @return maxChunkCount The maxChunkCount of this {@link GroundingFilterSearchConfiguration} + * instance. + */ + @Nullable + public Integer getMaxChunkCount() { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link GroundingFilterSearchConfiguration} instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 + */ + public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + } + + /** + * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance and return + * the same instance. + * + * @param maxDocumentCount [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 The same instance of this {@link GroundingFilterSearchConfiguration} class + */ + @Nonnull + public GroundingFilterSearchConfiguration maxDocumentCount( + @Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = 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 The maxDocumentCount of this {@link + * GroundingFilterSearchConfiguration} instance. + */ + @Nullable + public Integer getMaxDocumentCount() { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link GroundingFilterSearchConfiguration} instance. + * + * @param maxDocumentCount [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 + */ + public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * GroundingFilterSearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingFilterSearchConfiguration} + * 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( + "GroundingFilterSearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link GroundingFilterSearchConfiguration} 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 GroundingFilterSearchConfiguration groundingFilterSearchConfiguration = + (GroundingFilterSearchConfiguration) o; + return Objects.equals( + this.cloudSdkCustomFields, groundingFilterSearchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, groundingFilterSearchConfiguration.maxChunkCount) + && Objects.equals( + this.maxDocumentCount, groundingFilterSearchConfiguration.maxDocumentCount); + } + + @Override + public int hashCode() { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a new {@link GroundingFilterSearchConfiguration} instance. No arguments are required. + */ + public static GroundingFilterSearchConfiguration create() { + return new GroundingFilterSearchConfiguration(); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java new file mode 100644 index 000000000..587cb1766 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java @@ -0,0 +1,274 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; +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; + +/** GroundingModuleConfig */ +@Beta // CHECKSTYLE:OFF +public class GroundingModuleConfig +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The DOCUMENT_GROUNDING_SERVICE option of this GroundingModuleConfig */ + DOCUMENT_GROUNDING_SERVICE("document_grounding_service"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this GroundingModuleConfig */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type GroundingModuleConfig + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("config") + private GroundingModuleConfigConfig config; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GroundingModuleConfig. */ + protected GroundingModuleConfig() {} + + /** + * Set the type of this {@link GroundingModuleConfig} instance and return the same instance. + * + * @param type The type of this {@link GroundingModuleConfig} + * @return The same instance of this {@link GroundingModuleConfig} class + */ + @Nonnull + public GroundingModuleConfig type(@Nullable final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link GroundingModuleConfig} instance. + */ + @Nullable + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link GroundingModuleConfig} instance. + * + * @param type The type of this {@link GroundingModuleConfig} + */ + public void setType(@Nullable final TypeEnum type) { + this.type = type; + } + + /** + * Set the config of this {@link GroundingModuleConfig} instance and return the same instance. + * + * @param config The config of this {@link GroundingModuleConfig} + * @return The same instance of this {@link GroundingModuleConfig} class + */ + @Nonnull + public GroundingModuleConfig config(@Nonnull final GroundingModuleConfigConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link GroundingModuleConfig} instance. + */ + @Nonnull + public GroundingModuleConfigConfig getConfig() { + return config; + } + + /** + * Set the config of this {@link GroundingModuleConfig} instance. + * + * @param config The config of this {@link GroundingModuleConfig} + */ + public void setConfig(@Nonnull final GroundingModuleConfigConfig config) { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingModuleConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingModuleConfig} 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( + "GroundingModuleConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfig} 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 GroundingModuleConfig groundingModuleConfig = (GroundingModuleConfig) o; + return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfig.cloudSdkCustomFields) + && Objects.equals(this.type, groundingModuleConfig.type) + && Objects.equals(this.config, groundingModuleConfig.config); + } + + @Override + public int hashCode() { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link GroundingModuleConfig} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> (config) -> new GroundingModuleConfig().type(type).config(config); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link GroundingModuleConfig} instance. + * + * @param type The type of this {@link GroundingModuleConfig} + * @return The GroundingModuleConfig builder. + */ + Builder1 type(@Nullable final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the config of this {@link GroundingModuleConfig} instance. + * + * @param config The config of this {@link GroundingModuleConfig} + * @return The GroundingModuleConfig instance. + */ + GroundingModuleConfig config(@Nonnull final GroundingModuleConfigConfig config); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java new file mode 100644 index 000000000..bce02796e --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java @@ -0,0 +1,306 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** GroundingModuleConfigConfig */ +@Beta // CHECKSTYLE:OFF +public class GroundingModuleConfigConfig +// CHECKSTYLE:ON +{ + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonProperty("input_params") + private List inputParams = new ArrayList<>(); + + @JsonProperty("output_param") + private String outputParam; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GroundingModuleConfigConfig. */ + protected GroundingModuleConfigConfig() {} + + /** + * Set the filters of this {@link GroundingModuleConfigConfig} instance and return the same + * instance. + * + * @param filters Document grounding service filters to be used + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig filters( + @Nullable final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link GroundingModuleConfigConfig}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link GroundingModuleConfigConfig} + */ + @Nonnull + public GroundingModuleConfigConfig addFiltersItem( + @Nonnull final 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 The filters of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link GroundingModuleConfigConfig} instance. + * + * @param filters Document grounding service filters to be used + */ + public void setFilters(@Nullable final List filters) { + this.filters = filters; + } + + /** + * Set the inputParams of this {@link GroundingModuleConfigConfig} instance and return the same + * instance. + * + * @param inputParams Contains the input parameters used for grounding input questions + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig inputParams(@Nonnull final List inputParams) { + this.inputParams = inputParams; + return this; + } + + /** + * Add one inputParams instance to this {@link GroundingModuleConfigConfig}. + * + * @param inputParamsItem The inputParams that should be added + * @return The same instance of type {@link GroundingModuleConfigConfig} + */ + @Nonnull + public GroundingModuleConfigConfig addInputParamsItem(@Nonnull final 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 The inputParams of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public List getInputParams() { + return inputParams; + } + + /** + * Set the inputParams of this {@link GroundingModuleConfigConfig} instance. + * + * @param inputParams Contains the input parameters used for grounding input questions + */ + public void setInputParams(@Nonnull final List inputParams) { + this.inputParams = inputParams; + } + + /** + * Set the outputParam of this {@link GroundingModuleConfigConfig} instance and return the same + * instance. + * + * @param outputParam Parameter name used for grounding output + * @return The same instance of this {@link GroundingModuleConfigConfig} class + */ + @Nonnull + public GroundingModuleConfigConfig outputParam(@Nonnull final String outputParam) { + this.outputParam = outputParam; + return this; + } + + /** + * Parameter name used for grounding output + * + * @return outputParam The outputParam of this {@link GroundingModuleConfigConfig} instance. + */ + @Nonnull + public String getOutputParam() { + return outputParam; + } + + /** + * Set the outputParam of this {@link GroundingModuleConfigConfig} instance. + * + * @param outputParam Parameter name used for grounding output + */ + public void setOutputParam(@Nonnull final String outputParam) { + this.outputParam = outputParam; + } + + /** + * Get the names of the unrecognizable properties of the {@link GroundingModuleConfigConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GroundingModuleConfigConfig} + * 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( + "GroundingModuleConfigConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfigConfig} 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 GroundingModuleConfigConfig groundingModuleConfigConfig = (GroundingModuleConfigConfig) o; + return Objects.equals( + this.cloudSdkCustomFields, groundingModuleConfigConfig.cloudSdkCustomFields) + && 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, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * GroundingModuleConfigConfig} instance with all required arguments. + */ + public static Builder create() { + return (inputParams) -> + (outputParam) -> + new GroundingModuleConfigConfig().inputParams(inputParams).outputParam(outputParam); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the inputParams of this {@link GroundingModuleConfigConfig} instance. + * + * @param inputParams Contains the input parameters used for grounding input questions + * @return The GroundingModuleConfigConfig builder. + */ + Builder1 inputParams(@Nonnull final List inputParams); + + /** + * Set the inputParams of this {@link GroundingModuleConfigConfig} instance. + * + * @param inputParams Contains the input parameters used for grounding input questions + * @return The GroundingModuleConfigConfig builder. + */ + default Builder1 inputParams(@Nonnull final String... inputParams) { + return inputParams(Arrays.asList(inputParams)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputParam of this {@link GroundingModuleConfigConfig} instance. + * + * @param outputParam Parameter name used for grounding output + * @return The GroundingModuleConfigConfig instance. + */ + GroundingModuleConfigConfig outputParam(@Nonnull final String outputParam); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java new file mode 100644 index 000000000..37a9d8719 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java @@ -0,0 +1,23 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.model; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** GroundingModuleConfigConfigFiltersInner */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "", + visible = true) +public interface GroundingModuleConfigConfigFiltersInner {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java index b3e97cca4..a41e75e4d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java new file mode 100644 index 000000000..ae465e414 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java @@ -0,0 +1,245 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** KeyValueListPair */ +@Beta // CHECKSTYLE:OFF +public class KeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for KeyValueListPair. */ + protected KeyValueListPair() {} + + /** + * Set the key of this {@link KeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link KeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link KeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The same instance of this {@link KeyValueListPair} class + */ + @Nonnull + public KeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link KeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link KeyValueListPair} + */ + @Nonnull + public KeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link KeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link KeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link KeyValueListPair} 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("KeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link KeyValueListPair} 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 KeyValueListPair keyValueListPair = (KeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, keyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, keyValueListPair.key) + && Objects.equals(this.value, keyValueListPair.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link KeyValueListPair} + * instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new KeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link KeyValueListPair} instance. + * + * @param key The key of this {@link KeyValueListPair} + * @return The KeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + KeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link KeyValueListPair} instance. + * + * @param value The value of this {@link KeyValueListPair} + * @return The KeyValueListPair instance. + */ + default KeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java index 1ad2e9cbf..b0b801532 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java index 566907aa7..629a58d63 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java index 7e3636b43..a8b6b8dc0 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java index 9d11dd1dd..2d0e9b577 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java index 3cb8c0364..1e67d5f02 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java index 4a9765521..5953ad0c2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java index 812d98495..3971c21c3 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java index d593e0383..466b9de74 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java index 823bb476d..91d595fd2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -42,6 +42,9 @@ public class ModuleConfigs @JsonProperty("masking_module_config") private MaskingModuleConfig maskingModuleConfig; + @JsonProperty("grounding_module_config") + private GroundingModuleConfig groundingModuleConfig; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -181,6 +184,40 @@ public void setMaskingModuleConfig(@Nullable final MaskingModuleConfig maskingMo this.maskingModuleConfig = maskingModuleConfig; } + /** + * Set the groundingModuleConfig of this {@link ModuleConfigs} instance and return the same + * instance. + * + * @param groundingModuleConfig The groundingModuleConfig of this {@link ModuleConfigs} + * @return The same instance of this {@link ModuleConfigs} class + */ + @Nonnull + public ModuleConfigs groundingModuleConfig( + @Nullable final GroundingModuleConfig groundingModuleConfig) { + this.groundingModuleConfig = groundingModuleConfig; + return this; + } + + /** + * Get groundingModuleConfig + * + * @return groundingModuleConfig The groundingModuleConfig of this {@link ModuleConfigs} instance. + */ + @Nonnull + public GroundingModuleConfig getGroundingModuleConfig() { + return groundingModuleConfig; + } + + /** + * Set the groundingModuleConfig of this {@link ModuleConfigs} instance. + * + * @param groundingModuleConfig The groundingModuleConfig of this {@link ModuleConfigs} + */ + public void setGroundingModuleConfig( + @Nullable final GroundingModuleConfig groundingModuleConfig) { + this.groundingModuleConfig = groundingModuleConfig; + } + /** * Get the names of the unrecognizable properties of the {@link ModuleConfigs}. * @@ -232,7 +269,8 @@ public boolean equals(@Nullable final java.lang.Object o) { && Objects.equals(this.llmModuleConfig, moduleConfigs.llmModuleConfig) && Objects.equals(this.templatingModuleConfig, moduleConfigs.templatingModuleConfig) && Objects.equals(this.filteringModuleConfig, moduleConfigs.filteringModuleConfig) - && Objects.equals(this.maskingModuleConfig, moduleConfigs.maskingModuleConfig); + && Objects.equals(this.maskingModuleConfig, moduleConfigs.maskingModuleConfig) + && Objects.equals(this.groundingModuleConfig, moduleConfigs.groundingModuleConfig); } @Override @@ -242,6 +280,7 @@ public int hashCode() { templatingModuleConfig, filteringModuleConfig, maskingModuleConfig, + groundingModuleConfig, cloudSdkCustomFields); } @@ -260,6 +299,9 @@ public String toString() { sb.append(" maskingModuleConfig: ") .append(toIndentedString(maskingModuleConfig)) .append("\n"); + sb.append(" groundingModuleConfig: ") + .append(toIndentedString(groundingModuleConfig)) + .append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java index 2337068c1..8ab7ec403 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,6 +32,9 @@ public class ModuleResults // CHECKSTYLE:ON { + @JsonProperty("grounding") + private GenericModuleResult grounding; + @JsonProperty("templating") private List templating = new ArrayList<>(); @@ -56,6 +59,37 @@ public class ModuleResults /** Default constructor for ModuleResults. */ protected ModuleResults() {} + /** + * Set the grounding of this {@link ModuleResults} instance and return the same instance. + * + * @param grounding The grounding of this {@link ModuleResults} + * @return The same instance of this {@link ModuleResults} class + */ + @Nonnull + public ModuleResults grounding(@Nullable final GenericModuleResult grounding) { + this.grounding = grounding; + return this; + } + + /** + * Get grounding + * + * @return grounding The grounding of this {@link ModuleResults} instance. + */ + @Nonnull + public GenericModuleResult getGrounding() { + return grounding; + } + + /** + * Set the grounding of this {@link ModuleResults} instance. + * + * @param grounding The grounding of this {@link ModuleResults} + */ + public void setGrounding(@Nullable final GenericModuleResult grounding) { + this.grounding = grounding; + } + /** * Set the templating of this {@link ModuleResults} instance and return the same instance. * @@ -323,6 +357,7 @@ public boolean equals(@Nullable final java.lang.Object o) { } final ModuleResults moduleResults = (ModuleResults) o; return Objects.equals(this.cloudSdkCustomFields, moduleResults.cloudSdkCustomFields) + && Objects.equals(this.grounding, moduleResults.grounding) && Objects.equals(this.templating, moduleResults.templating) && Objects.equals(this.inputMasking, moduleResults.inputMasking) && Objects.equals(this.inputFiltering, moduleResults.inputFiltering) @@ -334,6 +369,7 @@ public boolean equals(@Nullable final java.lang.Object o) { @Override public int hashCode() { return Objects.hash( + grounding, templating, inputMasking, inputFiltering, @@ -348,6 +384,7 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class ModuleResults {\n"); + sb.append(" grounding: ").append(toIndentedString(grounding)).append("\n"); sb.append(" templating: ").append(toIndentedString(templating)).append("\n"); sb.append(" inputMasking: ").append(toIndentedString(inputMasking)).append("\n"); sb.append(" inputFiltering: ").append(toIndentedString(inputFiltering)).append("\n"); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java index 002dc3ee2..a76603803 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java index 8633ab0ac..f4d3740ca 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java index 2d01da76f..b014af6bf 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..3af260874 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java @@ -0,0 +1,306 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SearchDocumentKeyValueListPair */ +@Beta // CHECKSTYLE:OFF +public class SearchDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonProperty("select_mode") + private List selectMode = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SearchDocumentKeyValueListPair. */ + protected SearchDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param selectMode Select mode for search filters + * @return The same instance of this {@link SearchDocumentKeyValueListPair} class + */ + @Nonnull + public SearchDocumentKeyValueListPair selectMode( + @Nullable final List selectMode) { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link SearchDocumentKeyValueListPair}. + * + * @param selectModeItem The selectMode that should be added + * @return The same instance of type {@link SearchDocumentKeyValueListPair} + */ + @Nonnull + public SearchDocumentKeyValueListPair addSelectModeItem( + @Nonnull final SearchSelectOptionEnum selectModeItem) { + if (this.selectMode == null) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link SearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getSelectMode() { + return selectMode; + } + + /** + * Set the selectMode of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param selectMode Select mode for search filters + */ + public void setSelectMode(@Nullable final List selectMode) { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link SearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SearchDocumentKeyValueListPair} + * 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( + "SearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SearchDocumentKeyValueListPair} 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 SearchDocumentKeyValueListPair searchDocumentKeyValueListPair = + (SearchDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, searchDocumentKeyValueListPair.cloudSdkCustomFields) + && 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, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * SearchDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new SearchDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + SearchDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link SearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link SearchDocumentKeyValueListPair} + * @return The SearchDocumentKeyValueListPair instance. + */ + default SearchDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java new file mode 100644 index 000000000..cc8b2e4da --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java @@ -0,0 +1,63 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets SearchSelectOptionEnum */ +public enum SearchSelectOptionEnum { + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + SearchSelectOptionEnum(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static SearchSelectOptionEnum fromValue(@Nonnull final String value) { + for (final SearchSelectOptionEnum b : SearchSelectOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java index ca4604b20..dbb8796be 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java new file mode 100644 index 000000000..64b04cdc4 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java @@ -0,0 +1,170 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +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; + +/** TemplateRef */ +@Beta // CHECKSTYLE:OFF +public class TemplateRef implements TemplatingModuleConfig +// CHECKSTYLE:ON +{ + @JsonProperty("template_ref") + private TemplateRefTemplateRef templateRef; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TemplateRef. */ + protected TemplateRef() {} + + /** + * Set the templateRef of this {@link TemplateRef} instance and return the same instance. + * + * @param templateRef The templateRef of this {@link TemplateRef} + * @return The same instance of this {@link TemplateRef} class + */ + @Nonnull + public TemplateRef templateRef(@Nonnull final TemplateRefTemplateRef templateRef) { + this.templateRef = templateRef; + return this; + } + + /** + * Get templateRef + * + * @return templateRef The templateRef of this {@link TemplateRef} instance. + */ + @Nonnull + public TemplateRefTemplateRef getTemplateRef() { + return templateRef; + } + + /** + * Set the templateRef of this {@link TemplateRef} instance. + * + * @param templateRef The templateRef of this {@link TemplateRef} + */ + public void setTemplateRef(@Nonnull final TemplateRefTemplateRef templateRef) { + this.templateRef = templateRef; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRef}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRef} 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("TemplateRef has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TemplateRef} 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 TemplateRef templateRef = (TemplateRef) o; + return Objects.equals(this.cloudSdkCustomFields, templateRef.cloudSdkCustomFields) + && Objects.equals(this.templateRef, templateRef.templateRef); + } + + @Override + public int hashCode() { + return Objects.hash(templateRef, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRef {\n"); + sb.append(" templateRef: ").append(toIndentedString(templateRef)).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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TemplateRef} instance + * with all required arguments. + */ + public static Builder create() { + return (templateRef) -> new TemplateRef().templateRef(templateRef); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the templateRef of this {@link TemplateRef} instance. + * + * @param templateRef The templateRef of this {@link TemplateRef} + * @return The TemplateRef instance. + */ + TemplateRef templateRef(@Nonnull final TemplateRefTemplateRef templateRef); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java new file mode 100644 index 000000000..087e843b0 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java @@ -0,0 +1,170 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +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; + +/** TemplateRefByID */ +@Beta // CHECKSTYLE:OFF +public class TemplateRefByID implements TemplateRefTemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TemplateRefByID. */ + protected TemplateRefByID() {} + + /** + * Set the id of this {@link TemplateRefByID} instance and return the same instance. + * + * @param id ID of the template in prompt registry + * @return The same instance of this {@link TemplateRefByID} class + */ + @Nonnull + public TemplateRefByID id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * ID of the template in prompt registry + * + * @return id The id of this {@link TemplateRefByID} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link TemplateRefByID} instance. + * + * @param id ID of the template in prompt registry + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRefByID}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRefByID} 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("TemplateRefByID has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TemplateRefByID} 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 TemplateRefByID templateRefByID = (TemplateRefByID) o; + return Objects.equals(this.cloudSdkCustomFields, templateRefByID.cloudSdkCustomFields) + && Objects.equals(this.id, templateRefByID.id); + } + + @Override + public int hashCode() { + return Objects.hash(id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRefByID {\n"); + sb.append(" id: ").append(toIndentedString(id)).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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link TemplateRefByID} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> new TemplateRefByID().id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link TemplateRefByID} instance. + * + * @param id ID of the template in prompt registry + * @return The TemplateRefByID instance. + */ + TemplateRefByID id(@Nonnull final String id); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java new file mode 100644 index 000000000..8250875d6 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java @@ -0,0 +1,278 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.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 com.google.common.annotations.Beta; +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; + +/** TemplateRefByScenarioNameVersion */ +@Beta // CHECKSTYLE:OFF +public class TemplateRefByScenarioNameVersion implements TemplateRefTemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty("scenario") + private String scenario; + + @JsonProperty("name") + private String name; + + @JsonProperty("version") + private String version; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for TemplateRefByScenarioNameVersion. */ + protected TemplateRefByScenarioNameVersion() {} + + /** + * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance and return the same + * instance. + * + * @param scenario Scenario name + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion scenario(@Nonnull final String scenario) { + this.scenario = scenario; + return this; + } + + /** + * Scenario name + * + * @return scenario The scenario of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getScenario() { + return scenario; + } + + /** + * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param scenario Scenario name + */ + public void setScenario(@Nonnull final String scenario) { + this.scenario = scenario; + } + + /** + * Set the name of this {@link TemplateRefByScenarioNameVersion} instance and return the same + * instance. + * + * @param name Name of the template + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * Name of the template + * + * @return name The name of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param name Name of the template + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the version of this {@link TemplateRefByScenarioNameVersion} instance and return the same + * instance. + * + * @param version Version of the template + * @return The same instance of this {@link TemplateRefByScenarioNameVersion} class + */ + @Nonnull + public TemplateRefByScenarioNameVersion version(@Nonnull final String version) { + this.version = version; + return this; + } + + /** + * Version of the template + * + * @return version The version of this {@link TemplateRefByScenarioNameVersion} instance. + */ + @Nonnull + public String getVersion() { + return version; + } + + /** + * Set the version of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param version Version of the template + */ + public void setVersion(@Nonnull final String version) { + this.version = version; + } + + /** + * Get the names of the unrecognizable properties of the {@link TemplateRefByScenarioNameVersion}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} + * 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( + "TemplateRefByScenarioNameVersion has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TemplateRefByScenarioNameVersion} 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 TemplateRefByScenarioNameVersion templateRefByScenarioNameVersion = + (TemplateRefByScenarioNameVersion) o; + return Objects.equals( + this.cloudSdkCustomFields, templateRefByScenarioNameVersion.cloudSdkCustomFields) + && 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, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final 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"); + 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 "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * TemplateRefByScenarioNameVersion} instance with all required arguments. + */ + public static Builder create() { + return (scenario) -> + (name) -> + (version) -> + new TemplateRefByScenarioNameVersion() + .scenario(scenario) + .name(name) + .version(version); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the scenario of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param scenario Scenario name + * @return The TemplateRefByScenarioNameVersion builder. + */ + Builder1 scenario(@Nonnull final String scenario); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the name of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param name Name of the template + * @return The TemplateRefByScenarioNameVersion builder. + */ + Builder2 name(@Nonnull final String name); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the version of this {@link TemplateRefByScenarioNameVersion} instance. + * + * @param version Version of the template + * @return The TemplateRefByScenarioNameVersion instance. + */ + TemplateRefByScenarioNameVersion version(@Nonnull final String version); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java new file mode 100644 index 000000000..06ecd7c42 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java @@ -0,0 +1,23 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.36.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.model; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** Reference to a template in the prompt registry by ID or by scenario, name and version */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "", + visible = true) +public interface TemplateRefTemplateRef {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java index d399b7ea5..701b97b46 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java index e6ad73671..40f8d61b4 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.29.3 + * The version of the OpenAPI document: 0.36.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/resources/spec/orchestration.yaml b/orchestration/src/main/resources/spec/orchestration.yaml index 84a6a7a32..b1c5afec6 100644 --- a/orchestration/src/main/resources/spec/orchestration.yaml +++ b/orchestration/src/main/resources/spec/orchestration.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Orchestration description: Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - version: 0.29.3 + version: 0.36.1 x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. servers: - url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id} @@ -27,44 +27,47 @@ externalDocs: description: Documentation for SAP AI Core - Orchestration url: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration security: - - Oauth2: [ ] + - Oauth2: [] tags: - name: Orchestrated Completion description: Run an orchestrated completion inference request + paths: /completion: post: tags: - Orchestration Completion operationId: orchestration.v1.endpoints.create - summary: Orchestrated Completion - description: Run an orchestrated completion inference request + summary: "Orchestrated Completion" + description: "Run an orchestrated completion inference request" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CompletionPostRequest' + $ref: "#/components/schemas/CompletionPostRequest" responses: '200': - description: Successful response + description: "Successful response" content: application/json: schema: - $ref: '#/components/schemas/CompletionPostResponse' + $ref: "#/components/schemas/CompletionPostResponse" '400': - $ref: '#/components/responses/BadRequest' + $ref: "#/components/responses/BadRequest" default: - $ref: '#/components/responses/CommonError' + $ref: "#/components/responses/CommonError" + components: securitySchemes: Oauth2: type: oauth2 - description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit. + description: OAuth client credentials (client ID and secret) are required. These + can be requested from SAP BTP cloud cockpit. flows: clientCredentials: tokenUrl: https://(subdomain_identity_zone).authentication.(host)/oauth/token - scopes: { } + scopes: {} schemas: CompletionPostRequest: type: object @@ -72,21 +75,30 @@ components: - orchestration_config properties: orchestration_config: - $ref: '#/components/schemas/OrchestrationConfig' + $ref: "#/components/schemas/OrchestrationConfig" input_params: type: object example: - inputContext: optimizing supply chain management + groundingInput: "What is SAP Joule?" + inputContext: "optimizing supply chain management" additionalProperties: type: string messages_history: allOf: - - $ref: '#/components/schemas/ChatMessages' + - $ref: "#/components/schemas/ChatMessages" description: History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message + ChatMessages: type: array items: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" + + TemplatingChatMessage: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/ChatMessage" + ChatMessage: type: object required: @@ -98,6 +110,7 @@ components: example: user content: type: string + ChatDelta: type: object required: @@ -107,7 +120,8 @@ components: type: string content: type: string - default: '' + default: "" + CompletionPostResponse: type: object required: @@ -118,11 +132,12 @@ components: request_id: description: ID of the request type: string - example: d4a67ea1-2bf9-4df7-8105-d48203ccff76 + example: "d4a67ea1-2bf9-4df7-8105-d48203ccff76" module_results: - $ref: '#/components/schemas/ModuleResults' + $ref: "#/components/schemas/ModuleResults" orchestration_result: - $ref: '#/components/schemas/LLMModuleResult' + $ref: "#/components/schemas/LLMModuleResult" + CompletionPostResponseStreaming: type: object required: @@ -132,22 +147,24 @@ components: description: ID of the request type: string module_results: - $ref: '#/components/schemas/ModuleResults' + $ref: "#/components/schemas/ModuleResults" orchestration_result: - $ref: '#/components/schemas/LLMModuleResultStreaming' + $ref: "#/components/schemas/LLMModuleResultStreaming" + OrchestrationConfig: type: object required: - module_configurations properties: module_configurations: - $ref: '#/components/schemas/ModuleConfigs' + $ref: "#/components/schemas/ModuleConfigs" stream: type: boolean description: If true, the response will be streamed back to the client default: false stream_options: - $ref: '#/components/schemas/GlobalStreamOptions' + $ref: "#/components/schemas/GlobalStreamOptions" + ModuleConfigs: type: object required: @@ -155,34 +172,40 @@ components: - templating_module_config properties: llm_module_config: - $ref: '#/components/schemas/LLMModuleConfig' + $ref: "#/components/schemas/LLMModuleConfig" templating_module_config: - $ref: '#/components/schemas/TemplatingModuleConfig' + $ref: "#/components/schemas/TemplatingModuleConfig" filtering_module_config: - $ref: '#/components/schemas/FilteringModuleConfig' + $ref: "#/components/schemas/FilteringModuleConfig" masking_module_config: - $ref: '#/components/schemas/MaskingModuleConfig' + $ref: "#/components/schemas/MaskingModuleConfig" + grounding_module_config: + $ref: "#/components/schemas/GroundingModuleConfig" + ModuleResults: description: Results of each module. type: object additionalProperties: false properties: + grounding: + $ref: "#/components/schemas/GenericModuleResult" templating: - $ref: '#/components/schemas/ChatMessages' + $ref: "#/components/schemas/TemplatingChatMessage" input_masking: - $ref: '#/components/schemas/GenericModuleResult' + $ref: "#/components/schemas/GenericModuleResult" input_filtering: - $ref: '#/components/schemas/GenericModuleResult' + $ref: "#/components/schemas/GenericModuleResult" llm: - $ref: '#/components/schemas/LLMModuleResult' + $ref: "#/components/schemas/LLMModuleResult" output_filtering: - $ref: '#/components/schemas/GenericModuleResult' + $ref: "#/components/schemas/GenericModuleResult" output_unmasking: type: array items: oneOf: - - $ref: '#/components/schemas/LLMChoice' - - $ref: '#/components/schemas/LLMChoiceStreaming' + - $ref: "#/components/schemas/LLMChoice" + - $ref: "#/components/schemas/LLMChoiceStreaming" + GlobalStreamOptions: description: Options for streaming. Will be ignored if stream is false. type: object @@ -194,6 +217,8 @@ components: default: 100 minimum: 1 maximum: 10000 + + # --- LLM MODULE --- LLMModuleConfig: type: object required: @@ -202,7 +227,7 @@ components: properties: model_name: description: Model name as in LLM Access configuration - example: gpt-4 + example: "gpt-4" type: string model_params: description: Model parameters @@ -216,7 +241,8 @@ components: model_version: description: Version of the model to use type: string - default: latest + default: "latest" + GenericModuleResult: type: object description: Generic module result @@ -230,11 +256,13 @@ components: data: type: object description: Additional data object from the module + LLMModuleResult: description: Output of LLM module. Follows the OpenAI spec. oneOf: - - $ref: '#/components/schemas/LLMModuleResultSynchronous' - - $ref: '#/components/schemas/LLMModuleResultStreaming' + - $ref: "#/components/schemas/LLMModuleResultSynchronous" + - $ref: "#/components/schemas/LLMModuleResultStreaming" + LLMModuleResultSynchronous: type: object description: Output of LLM module. Follows the OpenAI spec. @@ -249,7 +277,7 @@ components: id: type: string description: ID of the response - example: chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr + example: "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr" object: type: string description: Object type @@ -261,18 +289,19 @@ components: model: type: string description: Model name - example: gpt-4 + example: "gpt-4" system_fingerprint: type: string description: System fingerprint - example: fp_44709d6fcb + example: "fp_44709d6fcb" choices: type: array description: Choices items: - $ref: '#/components/schemas/LLMChoice' + $ref: "#/components/schemas/LLMChoice" usage: - $ref: '#/components/schemas/TokenUsage' + $ref: "#/components/schemas/TokenUsage" + LLMModuleResultStreaming: type: object description: Output of LLM module. Follows the OpenAI spec. @@ -302,9 +331,10 @@ components: type: array description: Choices items: - $ref: '#/components/schemas/LLMChoiceStreaming' + $ref: "#/components/schemas/LLMChoiceStreaming" usage: - $ref: '#/components/schemas/TokenUsage' + $ref: "#/components/schemas/TokenUsage" + LLMChoice: type: object required: @@ -317,7 +347,7 @@ components: description: Index of the choice example: 0 message: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" logprobs: type: object description: Log probabilities @@ -327,8 +357,9 @@ components: type: number finish_reason: type: string - description: Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module + description: "Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module" example: stop + LLMChoiceStreaming: type: object required: @@ -339,7 +370,7 @@ components: type: integer description: Index of the choice delta: - $ref: '#/components/schemas/ChatDelta' + $ref: "#/components/schemas/ChatDelta" logprobs: type: object description: Log probabilities @@ -350,6 +381,7 @@ components: finish_reason: type: string description: Reason for stopping the model + TokenUsage: type: object description: Usage of tokens in the response @@ -370,9 +402,15 @@ components: type: integer description: Total number of tokens used example: 50 + + # --- Templating Module --- + TemplatingModuleConfig: oneOf: - - $ref: '#/components/schemas/Template' + - $ref: "#/components/schemas/Template" + - $ref: "#/components/schemas/TemplateRef" + + # --- Templating Module with User Defined Template --- Template: type: object required: @@ -380,7 +418,7 @@ components: properties: template: allOf: - - $ref: '#/components/schemas/ChatMessages' + - $ref: "#/components/schemas/TemplatingChatMessage" description: A chat message array to be formatted with values from input_params. Both role and content can be templated. If messages_history is provided, the templated messages will be appended. defaults: description: Optional default values for the template. If a parameter has no default it is required. @@ -388,21 +426,67 @@ components: example: template: - role: user - content: How can the features of AI in SAP BTP specifially {​{?product}}, be applied to {​{?inputContext}} + content: "How can the features of AI in SAP BTP specifically {{?groundingOutput}}, be applied to {{?inputContext}}" defaults: inputContext: The default text that will be used in the template if inputContext is not set + + # --- Templating Module with reference to Prompt Registry --- + TemplateRef: + type: object + required: + - template_ref + properties: + template_ref: + type: object + description: Reference to a template in the prompt registry by ID or by scenario, name and version + oneOf: + - $ref: "#/components/schemas/TemplateRefByID" + - $ref: "#/components/schemas/TemplateRefByScenarioNameVersion" + + TemplateRefByID: + type: object + required: + - id + properties: + id: + type: string + description: ID of the template in prompt registry + example: "template_id" + + TemplateRefByScenarioNameVersion: + type: object + required: + - scenario + - name + - version + properties: + scenario: + type: string + description: Scenario name + example: "some-scenario" + name: + type: string + description: Name of the template + example: "some-template-name" + version: + type: string + description: Version of the template + example: "some version, can be `latest`" + + # --- Filtering Module --- FilteringModuleConfig: type: object properties: input: allOf: - - $ref: '#/components/schemas/InputFilteringConfig' + - $ref: "#/components/schemas/InputFilteringConfig" description: List of provider type and filters output: allOf: - - $ref: '#/components/schemas/OutputFilteringConfig' + - $ref: "#/components/schemas/OutputFilteringConfig" description: List of provider type and filters additionalProperties: false + InputFilteringConfig: type: object required: @@ -414,7 +498,8 @@ components: type: array minItems: 1 items: - $ref: '#/components/schemas/FilterConfig' + $ref: "#/components/schemas/FilterConfig" + OutputFilteringConfig: type: object required: @@ -426,9 +511,10 @@ components: type: array minItems: 1 items: - $ref: '#/components/schemas/FilterConfig' + $ref: "#/components/schemas/FilterConfig" stream_options: - $ref: '#/components/schemas/FilteringStreamOptions' + $ref: "#/components/schemas/FilteringStreamOptions" + FilteringStreamOptions: description: Stream options for output filtering. Will be ignored if stream is false. type: object @@ -440,9 +526,11 @@ components: default: 0 minimum: 0 maximum: 10000 + FilterConfig: oneOf: - - $ref: '#/components/schemas/AzureContentSafetyFilterConfig' + - $ref: "#/components/schemas/AzureContentSafetyFilterConfig" + AzureContentSafetyFilterConfig: type: object required: @@ -455,20 +543,22 @@ components: - azure_content_safety example: azure_content_safety config: - $ref: '#/components/schemas/AzureContentSafety' + $ref: "#/components/schemas/AzureContentSafety" + AzureContentSafety: description: Filter configuration for Azure Content Safety type: object additionalProperties: false properties: - Hate: - $ref: '#/components/schemas/AzureThreshold' - SelfHarm: - $ref: '#/components/schemas/AzureThreshold' - Sexual: - $ref: '#/components/schemas/AzureThreshold' - Violence: - $ref: '#/components/schemas/AzureThreshold' + "Hate": + $ref: "#/components/schemas/AzureThreshold" + "SelfHarm": + $ref: "#/components/schemas/AzureThreshold" + "Sexual": + $ref: "#/components/schemas/AzureThreshold" + "Violence": + $ref: "#/components/schemas/AzureThreshold" + AzureThreshold: type: integer description: Threshold for the filter. Setting it to `0` blocks content with low severity, whereas `6` is the most permissive and blocks only the highest severity @@ -478,6 +568,9 @@ components: - 4 - 6 example: 0 + + # --- Masking module --- + MaskingModuleConfig: type: object required: @@ -487,12 +580,14 @@ components: type: array minItems: 1 items: - $ref: '#/components/schemas/MaskingProviderConfig' + $ref: "#/components/schemas/MaskingProviderConfig" description: List of masking service providers additionalProperties: false + MaskingProviderConfig: oneOf: - - $ref: '#/components/schemas/DPIConfig' + - $ref: "#/components/schemas/DPIConfig" + DPIConfig: type: object required: @@ -516,7 +611,14 @@ components: type: array minItems: 1 items: - $ref: '#/components/schemas/DPIEntityConfig' + $ref: "#/components/schemas/DPIEntityConfig" + allowlist: + description: List of strings that should not be masked + type: array + items: + type: string + example: "David Smith" + DPIEntityConfig: type: object required: @@ -525,7 +627,8 @@ components: type: description: Type of entity to be masked allOf: - - $ref: '#/components/schemas/DPIEntities' + - $ref: "#/components/schemas/DPIEntities" + DPIEntities: description: Default entities supported by data privacy and integration service type: string @@ -555,6 +658,162 @@ components: - profile-sexual-orientation - profile-trade-union - profile-sensitive-data + + # --- Grounding Module --- + GroundingModuleConfig: + type: object + required: + - type + - config + properties: + type: + type: string + anyOf: + - enum: + - document_grounding_service + - {} + example: document_grounding_service + config: + type: object + required: + - input_params + - output_param + properties: + filters: + type: array + items: + oneOf: + - $ref: "#/components/schemas/DocumentGroundingFilter" + description: Document grounding service filters to be used + input_params: + type: array + items: + type: string + example: groundingInput + description: Contains the input parameters used for grounding input questions + output_param: + type: string + description: Parameter name used for grounding output + example: groundingOutput + DocumentGroundingFilter: + type: object + required: + - id + - data_repository_type + properties: + id: + $ref: "#/components/schemas/GroundingFilterId" + search_config: + $ref: "#/components/schemas/GroundingFilterSearchConfiguration" + data_repositories: + type: array + items: + type: string + title: DataRepositories + description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + default: + - "*" + data_repository_type: + type: string + $ref: "#/components/schemas/DataRepositoryType" + description: Only include DataRepositories with the given type. + data_repository_metadata: + type: array + items: + $ref: "#/components/schemas/KeyValueListPair" + title: Datarepositorymetadata + description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] + document_metadata: + type: array + items: + $ref: "#/components/schemas/SearchDocumentKeyValueListPair" + title: Documentmetadata + description: Restrict documents considered during search to those annotated with the given metadata. + chunk_metadata: + type: array + items: + $ref: "#/components/schemas/KeyValueListPair" + title: Chunkmetadata + description: Restrict chunks considered during search to those with the given metadata. + minProperties: 1 + GroundingFilterId: + title: Id + description: Identifier of this SearchFilter - unique per request. + GroundingFilterSearchConfiguration: + nullable: true + properties: + max_chunk_count: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxchunkcount + description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + max_document_count: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxdocumentcount + description: "[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." + title: SearchConfiguration + minProperties: 0 + maxProperties: 1 + DataRepositoryType: + type: string + anyOf: + - enum: + - vector + - {} + title: DataRepositoryType + KeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: KeyValueListPair + SearchDocumentKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + select_mode: + type: array + items: + $ref: "#/components/schemas/SearchSelectOptionEnum" + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: SearchDocumentKeyValueListPair + SearchSelectOptionEnum: + type: string + anyOf: + - enum: + - ignoreIfKeyAbsent + - {} + title: SearchSelectOptionEnum + ErrorResponse: type: object required: @@ -565,29 +824,30 @@ components: properties: request_id: type: string - example: d4a67ea1-2bf9-4df7-8105-d48203ccff76 + example: "d4a67ea1-2bf9-4df7-8105-d48203ccff76" code: type: integer example: 400 message: type: string - example: Model name must be one of ['gpt-4', ...] + example: "Model name must be one of ['gpt-4', ...]" location: type: string description: Where the error occurred - example: LLM Module + example: "LLM Module" module_results: - $ref: '#/components/schemas/ModuleResults' + $ref: "#/components/schemas/ModuleResults" + responses: BadRequest: description: Bad Request content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' + $ref: "#/components/schemas/ErrorResponse" CommonError: description: Common Error content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' + $ref: "#/components/schemas/ErrorResponse" \ No newline at end of file diff --git a/orchestration/src/test/resources/maskingRequest.json b/orchestration/src/test/resources/maskingRequest.json index 03c19275e..e582f4206 100644 --- a/orchestration/src/test/resources/maskingRequest.json +++ b/orchestration/src/test/resources/maskingRequest.json @@ -28,7 +28,8 @@ { "type": "profile-phone" } - ] + ], + "allowlist" : [ ] } ] }