From 8f7ff3e9019287c288028ff37fc5ff9c95682570 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot <107626431+bot-sdk-js@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:02:10 +0200 Subject: [PATCH] Update Orchestration specification (#85) * Update Orchestration specification * Update Orchestration client * Fixed tests --------- Co-authored-by: GH Actions Runner User Co-authored-by: I538344 --- .../orchestration/client/model/ChatDelta.java | 204 +++++++ .../CompletionPostResponseStreaming.java | 257 +++++++++ .../client/model/DataRepositoryType.java | 65 +++ .../client/model/DocumentGroundingFilter.java | 502 +++++++++++++++++ .../client/model/FilteringModuleConfig.java | 16 +- .../client/model/FilteringStreamOptions.java | 158 ++++++ .../client/model/GlobalStreamOptions.java | 157 ++++++ .../client/model/GroundingFilter.java | 510 ----------------- .../GroundingFilterSearchConfiguration.java | 213 +++++++ .../client/model/GroundingModuleConfig.java | 113 ++-- .../model/GroundingModuleConfigConfig.java | 304 ++++++++++ ...oundingModuleConfigConfigFiltersInner.java | 525 ++++++++++++++++++ ...leConfigGroundingServiceConfiguration.java | 342 ------------ ...gConfig.java => InputFilteringConfig.java} | 57 +- .../client/model/KeyValueListPair.java | 243 ++++++++ .../client/model/LLMChoiceStreaming.java | 305 ++++++++++ .../model/LLMModuleResultStreaming.java | 470 ++++++++++++++++ .../model/LLMModuleResultSynchronous.java | 488 ++++++++++++++++ .../client/model/ModuleResults.java | 13 +- .../ModuleResultsOutputUnmaskingInner.java | 346 ++++++++++++ .../client/model/OrchestrationConfig.java | 77 ++- .../client/model/OutputFilteringConfig.java | 239 ++++++++ .../model/SearchDocumentKeyValueListPair.java | 304 ++++++++++ .../client/model/SearchSelectOptionEnum.java | 63 +++ .../orchestration/client/model/Template.java | 243 ++++++++ .../client/model/TemplateRef.java | 168 ++++++ .../client/model/TemplateRefByID.java | 168 ++++++ .../TemplateRefByScenarioNameVersion.java | 276 +++++++++ .../client/model/TemplateRefTemplateRef.java | 169 ++++++ .../main/resources/spec/orchestration.yaml | 465 ++++++++++++---- .../client/OrchestrationUnitTest.java | 7 +- .../test/resources/filteringLooseRequest.json | 3 +- .../src/test/resources/maskingRequest.json | 3 +- .../resources/messagesHistoryRequest.json | 3 +- .../src/test/resources/templatingRequest.json | 3 +- .../controllers/OrchestrationController.java | 7 +- 36 files changed, 6427 insertions(+), 1059 deletions(-) create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ChatDelta.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringStreamOptions.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GlobalStreamOptions.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilter.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java delete mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigGroundingServiceConfiguration.java rename orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/{FilteringConfig.java => InputFilteringConfig.java} (71%) create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMChoiceStreaming.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultStreaming.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultSynchronous.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OutputFilteringConfig.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/Template.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java create mode 100644 orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ChatDelta.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ChatDelta.java new file mode 100644 index 00000000..c9b2976c --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ChatDelta.java @@ -0,0 +1,204 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ChatDelta */ +// CHECKSTYLE:OFF +public class ChatDelta +// CHECKSTYLE:ON +{ + @JsonProperty("role") + private String role; + + @JsonProperty("content") + private String content = ""; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected ChatDelta() {} + + /** + * Set the role of this {@link ChatDelta} instance and return the same instance. + * + * @param role The role of this {@link ChatDelta} + * @return The same instance of this {@link ChatDelta} class + */ + @Nonnull + public ChatDelta role(@Nullable final String role) { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link ChatDelta} instance. + */ + @Nonnull + public String getRole() { + return role; + } + + /** + * Set the role of this {@link ChatDelta} instance. + * + * @param role The role of this {@link ChatDelta} + */ + public void setRole(@Nullable final String role) { + this.role = role; + } + + /** + * Set the content of this {@link ChatDelta} instance and return the same instance. + * + * @param content The content of this {@link ChatDelta} + * @return The same instance of this {@link ChatDelta} class + */ + @Nonnull + public ChatDelta content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link ChatDelta} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link ChatDelta} instance. + * + * @param content The content of this {@link ChatDelta} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link ChatDelta}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ChatDelta} 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("ChatDelta has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ChatDelta} 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 ChatDelta chatDelta = (ChatDelta) o; + return Objects.equals(this.cloudSdkCustomFields, chatDelta.cloudSdkCustomFields) + && Objects.equals(this.role, chatDelta.role) + && Objects.equals(this.content, chatDelta.content); + } + + @Override + public int hashCode() { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ChatDelta {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 ChatDelta} instance + * with all required arguments. + */ + public static Builder create() { + return (content) -> new ChatDelta().content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the content of this {@link ChatDelta} instance. + * + * @param content The content of this {@link ChatDelta} + * @return The ChatDelta instance. + */ + ChatDelta content(@Nonnull final String content); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java new file mode 100644 index 00000000..7c876d1a --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/CompletionPostResponseStreaming.java @@ -0,0 +1,257 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CompletionPostResponseStreaming */ +// CHECKSTYLE:OFF +public class CompletionPostResponseStreaming +// CHECKSTYLE:ON +{ + @JsonProperty("request_id") + private String requestId; + + @JsonProperty("module_results") + private ModuleResults moduleResults; + + @JsonProperty("orchestration_result") + private LLMModuleResultStreaming orchestrationResult; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected CompletionPostResponseStreaming() {} + + /** + * Set the requestId of this {@link CompletionPostResponseStreaming} instance and return the same + * instance. + * + * @param requestId ID of the request + * @return The same instance of this {@link CompletionPostResponseStreaming} class + */ + @Nonnull + public CompletionPostResponseStreaming requestId(@Nonnull final String requestId) { + this.requestId = requestId; + return this; + } + + /** + * ID of the request + * + * @return requestId The requestId of this {@link CompletionPostResponseStreaming} instance. + */ + @Nonnull + public String getRequestId() { + return requestId; + } + + /** + * Set the requestId of this {@link CompletionPostResponseStreaming} instance. + * + * @param requestId ID of the request + */ + public void setRequestId(@Nonnull final String requestId) { + this.requestId = requestId; + } + + /** + * Set the moduleResults of this {@link CompletionPostResponseStreaming} instance and return the + * same instance. + * + * @param moduleResults The moduleResults of this {@link CompletionPostResponseStreaming} + * @return The same instance of this {@link CompletionPostResponseStreaming} class + */ + @Nonnull + public CompletionPostResponseStreaming moduleResults( + @Nullable final ModuleResults moduleResults) { + this.moduleResults = moduleResults; + return this; + } + + /** + * Get moduleResults + * + * @return moduleResults The moduleResults of this {@link CompletionPostResponseStreaming} + * instance. + */ + @Nonnull + public ModuleResults getModuleResults() { + return moduleResults; + } + + /** + * Set the moduleResults of this {@link CompletionPostResponseStreaming} instance. + * + * @param moduleResults The moduleResults of this {@link CompletionPostResponseStreaming} + */ + public void setModuleResults(@Nullable final ModuleResults moduleResults) { + this.moduleResults = moduleResults; + } + + /** + * Set the orchestrationResult of this {@link CompletionPostResponseStreaming} instance and return + * the same instance. + * + * @param orchestrationResult The orchestrationResult of this {@link + * CompletionPostResponseStreaming} + * @return The same instance of this {@link CompletionPostResponseStreaming} class + */ + @Nonnull + public CompletionPostResponseStreaming orchestrationResult( + @Nullable final LLMModuleResultStreaming orchestrationResult) { + this.orchestrationResult = orchestrationResult; + return this; + } + + /** + * Get orchestrationResult + * + * @return orchestrationResult The orchestrationResult of this {@link + * CompletionPostResponseStreaming} instance. + */ + @Nonnull + public LLMModuleResultStreaming getOrchestrationResult() { + return orchestrationResult; + } + + /** + * Set the orchestrationResult of this {@link CompletionPostResponseStreaming} instance. + * + * @param orchestrationResult The orchestrationResult of this {@link + * CompletionPostResponseStreaming} + */ + public void setOrchestrationResult(@Nullable final LLMModuleResultStreaming orchestrationResult) { + this.orchestrationResult = orchestrationResult; + } + + /** + * Get the names of the unrecognizable properties of the {@link CompletionPostResponseStreaming}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CompletionPostResponseStreaming} + * 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( + "CompletionPostResponseStreaming has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link CompletionPostResponseStreaming} 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 CompletionPostResponseStreaming completionPostResponseStreaming = + (CompletionPostResponseStreaming) o; + return Objects.equals( + this.cloudSdkCustomFields, completionPostResponseStreaming.cloudSdkCustomFields) + && Objects.equals(this.requestId, completionPostResponseStreaming.requestId) + && Objects.equals(this.moduleResults, completionPostResponseStreaming.moduleResults) + && Objects.equals( + this.orchestrationResult, completionPostResponseStreaming.orchestrationResult); + } + + @Override + public int hashCode() { + return Objects.hash(requestId, moduleResults, orchestrationResult, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CompletionPostResponseStreaming {\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" moduleResults: ").append(toIndentedString(moduleResults)).append("\n"); + sb.append(" orchestrationResult: ") + .append(toIndentedString(orchestrationResult)) + .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 + * CompletionPostResponseStreaming} instance with all required arguments. + */ + public static Builder create() { + return (requestId) -> new CompletionPostResponseStreaming().requestId(requestId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the requestId of this {@link CompletionPostResponseStreaming} instance. + * + * @param requestId ID of the request + * @return The CompletionPostResponseStreaming instance. + */ + CompletionPostResponseStreaming requestId(@Nonnull final String requestId); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java new file mode 100644 index 00000000..6d8e1ad2 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DataRepositoryType.java @@ -0,0 +1,65 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/client/model/DocumentGroundingFilter.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java new file mode 100644 index 00000000..f6a5b0ec --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/DocumentGroundingFilter.java @@ -0,0 +1,502 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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 */ +// CHECKSTYLE:OFF +public class DocumentGroundingFilter +// 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<>(); + + 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/client/model/FilteringModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringModuleConfig.java index fb467c89..44a7eb5f 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringModuleConfig.java @@ -30,10 +30,10 @@ public class FilteringModuleConfig // CHECKSTYLE:ON { @JsonProperty("input") - private FilteringConfig input; + private InputFilteringConfig input; @JsonProperty("output") - private FilteringConfig output; + private OutputFilteringConfig output; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -47,7 +47,7 @@ protected FilteringModuleConfig() {} * @return The same instance of this {@link FilteringModuleConfig} class */ @Nonnull - public FilteringModuleConfig input(@Nullable final FilteringConfig input) { + public FilteringModuleConfig input(@Nullable final InputFilteringConfig input) { this.input = input; return this; } @@ -58,7 +58,7 @@ public FilteringModuleConfig input(@Nullable final FilteringConfig input) { * @return input The input of this {@link FilteringModuleConfig} instance. */ @Nonnull - public FilteringConfig getInput() { + public InputFilteringConfig getInput() { return input; } @@ -67,7 +67,7 @@ public FilteringConfig getInput() { * * @param input List of provider type and filters */ - public void setInput(@Nullable final FilteringConfig input) { + public void setInput(@Nullable final InputFilteringConfig input) { this.input = input; } @@ -78,7 +78,7 @@ public void setInput(@Nullable final FilteringConfig input) { * @return The same instance of this {@link FilteringModuleConfig} class */ @Nonnull - public FilteringModuleConfig output(@Nullable final FilteringConfig output) { + public FilteringModuleConfig output(@Nullable final OutputFilteringConfig output) { this.output = output; return this; } @@ -89,7 +89,7 @@ public FilteringModuleConfig output(@Nullable final FilteringConfig output) { * @return output The output of this {@link FilteringModuleConfig} instance. */ @Nonnull - public FilteringConfig getOutput() { + public OutputFilteringConfig getOutput() { return output; } @@ -98,7 +98,7 @@ public FilteringConfig getOutput() { * * @param output List of provider type and filters */ - public void setOutput(@Nullable final FilteringConfig output) { + public void setOutput(@Nullable final OutputFilteringConfig output) { this.output = output; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringStreamOptions.java new file mode 100644 index 00000000..eb430c60 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringStreamOptions.java @@ -0,0 +1,158 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Stream options for output filtering. Will be ignored if stream is false. */ +// CHECKSTYLE:OFF +public class FilteringStreamOptions +// CHECKSTYLE:ON +{ + @JsonProperty("overlap") + private Integer overlap = 0; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected FilteringStreamOptions() {} + + /** + * Set the overlap of this {@link FilteringStreamOptions} instance and return the same instance. + * + * @param overlap Number of characters that should be additionally sent to content filtering + * services from previous chunks as additional context. Minimum: 0 Maximum: 10000 + * @return The same instance of this {@link FilteringStreamOptions} class + */ + @Nonnull + public FilteringStreamOptions overlap(@Nullable final Integer overlap) { + this.overlap = overlap; + return this; + } + + /** + * Number of characters that should be additionally sent to content filtering services from + * previous chunks as additional context. minimum: 0 maximum: 10000 + * + * @return overlap The overlap of this {@link FilteringStreamOptions} instance. + */ + @Nonnull + public Integer getOverlap() { + return overlap; + } + + /** + * Set the overlap of this {@link FilteringStreamOptions} instance. + * + * @param overlap Number of characters that should be additionally sent to content filtering + * services from previous chunks as additional context. Minimum: 0 Maximum: 10000 + */ + public void setOverlap(@Nullable final Integer overlap) { + this.overlap = overlap; + } + + /** + * Get the names of the unrecognizable properties of the {@link FilteringStreamOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FilteringStreamOptions} 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( + "FilteringStreamOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link FilteringStreamOptions} 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 FilteringStreamOptions filteringStreamOptions = (FilteringStreamOptions) o; + return Objects.equals(this.cloudSdkCustomFields, filteringStreamOptions.cloudSdkCustomFields) + && Objects.equals(this.overlap, filteringStreamOptions.overlap); + } + + @Override + public int hashCode() { + return Objects.hash(overlap, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FilteringStreamOptions {\n"); + sb.append(" overlap: ").append(toIndentedString(overlap)).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 FilteringStreamOptions} instance. No arguments are required. */ + public static FilteringStreamOptions create() { + return new FilteringStreamOptions(); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GlobalStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GlobalStreamOptions.java new file mode 100644 index 00000000..c5d959a3 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GlobalStreamOptions.java @@ -0,0 +1,157 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Options for streaming. Will be ignored if stream is false. */ +// CHECKSTYLE:OFF +public class GlobalStreamOptions +// CHECKSTYLE:ON +{ + @JsonProperty("chunk_size") + private Integer chunkSize = 100; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected GlobalStreamOptions() {} + + /** + * Set the chunkSize of this {@link GlobalStreamOptions} instance and return the same instance. + * + * @param chunkSize Number of characters per chunk that post-LLM modules operate on. Minimum: 1 + * Maximum: 10000 + * @return The same instance of this {@link GlobalStreamOptions} class + */ + @Nonnull + public GlobalStreamOptions chunkSize(@Nullable final Integer chunkSize) { + this.chunkSize = chunkSize; + return this; + } + + /** + * Number of characters per chunk that post-LLM modules operate on. minimum: 1 maximum: 10000 + * + * @return chunkSize The chunkSize of this {@link GlobalStreamOptions} instance. + */ + @Nonnull + public Integer getChunkSize() { + return chunkSize; + } + + /** + * Set the chunkSize of this {@link GlobalStreamOptions} instance. + * + * @param chunkSize Number of characters per chunk that post-LLM modules operate on. Minimum: 1 + * Maximum: 10000 + */ + public void setChunkSize(@Nullable final Integer chunkSize) { + this.chunkSize = chunkSize; + } + + /** + * Get the names of the unrecognizable properties of the {@link GlobalStreamOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GlobalStreamOptions} 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( + "GlobalStreamOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link GlobalStreamOptions} 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 GlobalStreamOptions globalStreamOptions = (GlobalStreamOptions) o; + return Objects.equals(this.cloudSdkCustomFields, globalStreamOptions.cloudSdkCustomFields) + && Objects.equals(this.chunkSize, globalStreamOptions.chunkSize); + } + + @Override + public int hashCode() { + return Objects.hash(chunkSize, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class GlobalStreamOptions {\n"); + sb.append(" chunkSize: ").append(toIndentedString(chunkSize)).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 GlobalStreamOptions} instance. No arguments are required. */ + public static GlobalStreamOptions create() { + return new GlobalStreamOptions(); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilter.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilter.java deleted file mode 100644 index 94822c86..00000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilter.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -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; - -/** GroundingFilter */ -// CHECKSTYLE:OFF -public class GroundingFilter -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("search_configuration") - private Object searchConfiguration; - - @JsonProperty("data_repositories") - private List dataRepositories = new ArrayList<>(); - - /** Gets or Sets dataRepositoryType */ - public enum DataRepositoryTypeEnum { - /** The VECTOR option of this GroundingFilter */ - VECTOR("vector"), - - /** The HELP_SAP_COM option of this GroundingFilter */ - HELP_SAP_COM("help.sap.com"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this GroundingFilter */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - DataRepositoryTypeEnum(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 GroundingFilter - */ - @JsonCreator - @Nonnull - public static DataRepositoryTypeEnum fromValue(@Nonnull final String value) { - for (DataRepositoryTypeEnum b : DataRepositoryTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("data_repository_type") - private DataRepositoryTypeEnum 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<>(); - - protected GroundingFilter() {} - - /** - * Set the id of this {@link GroundingFilter} instance and return the same instance. - * - * @param id The id of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter id(@Nullable final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link GroundingFilter} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link GroundingFilter} instance. - * - * @param id The id of this {@link GroundingFilter} - */ - public void setId(@Nullable final String id) { - this.id = id; - } - - /** - * Set the searchConfiguration of this {@link GroundingFilter} instance and return the same - * instance. - * - * @param searchConfiguration The searchConfiguration of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter searchConfiguration(@Nullable final Object searchConfiguration) { - this.searchConfiguration = searchConfiguration; - return this; - } - - /** - * Get searchConfiguration - * - * @return searchConfiguration The searchConfiguration of this {@link GroundingFilter} instance. - */ - @Nonnull - public Object getSearchConfiguration() { - return searchConfiguration; - } - - /** - * Set the searchConfiguration of this {@link GroundingFilter} instance. - * - * @param searchConfiguration The searchConfiguration of this {@link GroundingFilter} - */ - public void setSearchConfiguration(@Nullable final Object searchConfiguration) { - this.searchConfiguration = searchConfiguration; - } - - /** - * Set the dataRepositories of this {@link GroundingFilter} instance and return the same instance. - * - * @param dataRepositories The dataRepositories of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter dataRepositories(@Nullable final List dataRepositories) { - this.dataRepositories = dataRepositories; - return this; - } - - /** - * Add one dataRepositories instance to this {@link GroundingFilter}. - * - * @param dataRepositoriesItem The dataRepositories that should be added - * @return The same instance of type {@link GroundingFilter} - */ - @Nonnull - public GroundingFilter addDataRepositoriesItem(@Nonnull final String dataRepositoriesItem) { - if (this.dataRepositories == null) { - this.dataRepositories = new ArrayList<>(); - } - this.dataRepositories.add(dataRepositoriesItem); - return this; - } - - /** - * Get dataRepositories - * - * @return dataRepositories The dataRepositories of this {@link GroundingFilter} instance. - */ - @Nonnull - public List getDataRepositories() { - return dataRepositories; - } - - /** - * Set the dataRepositories of this {@link GroundingFilter} instance. - * - * @param dataRepositories The dataRepositories of this {@link GroundingFilter} - */ - public void setDataRepositories(@Nullable final List dataRepositories) { - this.dataRepositories = dataRepositories; - } - - /** - * Set the dataRepositoryType of this {@link GroundingFilter} instance and return the same - * instance. - * - * @param dataRepositoryType The dataRepositoryType of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter dataRepositoryType( - @Nullable final DataRepositoryTypeEnum dataRepositoryType) { - this.dataRepositoryType = dataRepositoryType; - return this; - } - - /** - * Get dataRepositoryType - * - * @return dataRepositoryType The dataRepositoryType of this {@link GroundingFilter} instance. - */ - @Nonnull - public DataRepositoryTypeEnum getDataRepositoryType() { - return dataRepositoryType; - } - - /** - * Set the dataRepositoryType of this {@link GroundingFilter} instance. - * - * @param dataRepositoryType The dataRepositoryType of this {@link GroundingFilter} - */ - public void setDataRepositoryType(@Nullable final DataRepositoryTypeEnum dataRepositoryType) { - this.dataRepositoryType = dataRepositoryType; - } - - /** - * Set the dataRepositoryMetadata of this {@link GroundingFilter} instance and return the same - * instance. - * - * @param dataRepositoryMetadata The dataRepositoryMetadata of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter dataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata) { - this.dataRepositoryMetadata = dataRepositoryMetadata; - return this; - } - - /** - * Add one dataRepositoryMetadata instance to this {@link GroundingFilter}. - * - * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added - * @return The same instance of type {@link GroundingFilter} - */ - @Nonnull - public GroundingFilter addDataRepositoryMetadataItem( - @Nonnull final Object dataRepositoryMetadataItem) { - if (this.dataRepositoryMetadata == null) { - this.dataRepositoryMetadata = new ArrayList<>(); - } - this.dataRepositoryMetadata.add(dataRepositoryMetadataItem); - return this; - } - - /** - * Get dataRepositoryMetadata - * - * @return dataRepositoryMetadata The dataRepositoryMetadata of this {@link GroundingFilter} - * instance. - */ - @Nonnull - public List getDataRepositoryMetadata() { - return dataRepositoryMetadata; - } - - /** - * Set the dataRepositoryMetadata of this {@link GroundingFilter} instance. - * - * @param dataRepositoryMetadata The dataRepositoryMetadata of this {@link GroundingFilter} - */ - public void setDataRepositoryMetadata(@Nullable final List dataRepositoryMetadata) { - this.dataRepositoryMetadata = dataRepositoryMetadata; - } - - /** - * Set the documentMetadata of this {@link GroundingFilter} instance and return the same instance. - * - * @param documentMetadata The documentMetadata of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter documentMetadata(@Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - return this; - } - - /** - * Add one documentMetadata instance to this {@link GroundingFilter}. - * - * @param documentMetadataItem The documentMetadata that should be added - * @return The same instance of type {@link GroundingFilter} - */ - @Nonnull - public GroundingFilter addDocumentMetadataItem(@Nonnull final Object documentMetadataItem) { - if (this.documentMetadata == null) { - this.documentMetadata = new ArrayList<>(); - } - this.documentMetadata.add(documentMetadataItem); - return this; - } - - /** - * Get documentMetadata - * - * @return documentMetadata The documentMetadata of this {@link GroundingFilter} instance. - */ - @Nonnull - public List getDocumentMetadata() { - return documentMetadata; - } - - /** - * Set the documentMetadata of this {@link GroundingFilter} instance. - * - * @param documentMetadata The documentMetadata of this {@link GroundingFilter} - */ - public void setDocumentMetadata(@Nullable final List documentMetadata) { - this.documentMetadata = documentMetadata; - } - - /** - * Set the chunkMetadata of this {@link GroundingFilter} instance and return the same instance. - * - * @param chunkMetadata The chunkMetadata of this {@link GroundingFilter} - * @return The same instance of this {@link GroundingFilter} class - */ - @Nonnull - public GroundingFilter chunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - return this; - } - - /** - * Add one chunkMetadata instance to this {@link GroundingFilter}. - * - * @param chunkMetadataItem The chunkMetadata that should be added - * @return The same instance of type {@link GroundingFilter} - */ - @Nonnull - public GroundingFilter addChunkMetadataItem(@Nonnull final Object chunkMetadataItem) { - if (this.chunkMetadata == null) { - this.chunkMetadata = new ArrayList<>(); - } - this.chunkMetadata.add(chunkMetadataItem); - return this; - } - - /** - * Get chunkMetadata - * - * @return chunkMetadata The chunkMetadata of this {@link GroundingFilter} instance. - */ - @Nonnull - public List getChunkMetadata() { - return chunkMetadata; - } - - /** - * Set the chunkMetadata of this {@link GroundingFilter} instance. - * - * @param chunkMetadata The chunkMetadata of this {@link GroundingFilter} - */ - public void setChunkMetadata(@Nullable final List chunkMetadata) { - this.chunkMetadata = chunkMetadata; - } - - /** - * Get the names of the unrecognizable properties of the {@link GroundingFilter}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GroundingFilter} 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("GroundingFilter has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link GroundingFilter} 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 GroundingFilter groundingFilter = (GroundingFilter) o; - return Objects.equals(this.cloudSdkCustomFields, groundingFilter.cloudSdkCustomFields) - && Objects.equals(this.id, groundingFilter.id) - && Objects.equals(this.searchConfiguration, groundingFilter.searchConfiguration) - && Objects.equals(this.dataRepositories, groundingFilter.dataRepositories) - && Objects.equals(this.dataRepositoryType, groundingFilter.dataRepositoryType) - && Objects.equals(this.dataRepositoryMetadata, groundingFilter.dataRepositoryMetadata) - && Objects.equals(this.documentMetadata, groundingFilter.documentMetadata) - && Objects.equals(this.chunkMetadata, groundingFilter.chunkMetadata); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - searchConfiguration, - dataRepositories, - dataRepositoryType, - dataRepositoryMetadata, - documentMetadata, - chunkMetadata, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingFilter {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" searchConfiguration: ") - .append(toIndentedString(searchConfiguration)) - .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 new {@link GroundingFilter} instance. No arguments are required. */ - public static GroundingFilter create() { - return new GroundingFilter(); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java new file mode 100644 index 00000000..d27a96fe --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingFilterSearchConfiguration.java @@ -0,0 +1,213 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** GroundingFilterSearchConfiguration */ +// 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<>(); + + 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/client/model/GroundingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java index 865e9e97..66bd3bc2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfig.java @@ -31,8 +31,8 @@ public class GroundingModuleConfig // CHECKSTYLE:ON { - /** Gets or Sets groundingService */ - public enum GroundingServiceEnum { + /** Gets or Sets type */ + public enum TypeEnum { /** The DOCUMENT_GROUNDING_SERVICE option of this GroundingModuleConfig */ DOCUMENT_GROUNDING_SERVICE("document_grounding_service"), @@ -41,7 +41,7 @@ public enum GroundingServiceEnum { private String value; - GroundingServiceEnum(String value) { + TypeEnum(String value) { this.value = value; } @@ -75,21 +75,21 @@ public String toString() { */ @JsonCreator @Nonnull - public static GroundingServiceEnum fromValue(@Nonnull final String value) { - for (GroundingServiceEnum b : GroundingServiceEnum.values()) { + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } - return UNKNOWN_DEFAULT_OPEN_API; + return null; } } - @JsonProperty("grounding_service") - private GroundingServiceEnum groundingService; + @JsonProperty("type") + private TypeEnum type; - @JsonProperty("grounding_service_configuration") - private GroundingModuleConfigGroundingServiceConfiguration groundingServiceConfiguration; + @JsonProperty("config") + private GroundingModuleConfigConfig config; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -97,75 +97,65 @@ public static GroundingServiceEnum fromValue(@Nonnull final String value) { protected GroundingModuleConfig() {} /** - * Set the groundingService of this {@link GroundingModuleConfig} instance and return the same - * instance. + * Set the type of this {@link GroundingModuleConfig} instance and return the same instance. * - * @param groundingService The groundingService of this {@link GroundingModuleConfig} + * @param type The type of this {@link GroundingModuleConfig} * @return The same instance of this {@link GroundingModuleConfig} class */ @Nonnull - public GroundingModuleConfig groundingService( - @Nonnull final GroundingServiceEnum groundingService) { - this.groundingService = groundingService; + public GroundingModuleConfig type(@Nullable final TypeEnum type) { + this.type = type; return this; } /** - * Get groundingService + * Get type * - * @return groundingService The groundingService of this {@link GroundingModuleConfig} instance. + * @return type The type of this {@link GroundingModuleConfig} instance. */ - @Nonnull - public GroundingServiceEnum getGroundingService() { - return groundingService; + @Nullable + public TypeEnum getType() { + return type; } /** - * Set the groundingService of this {@link GroundingModuleConfig} instance. + * Set the type of this {@link GroundingModuleConfig} instance. * - * @param groundingService The groundingService of this {@link GroundingModuleConfig} + * @param type The type of this {@link GroundingModuleConfig} */ - public void setGroundingService(@Nonnull final GroundingServiceEnum groundingService) { - this.groundingService = groundingService; + public void setType(@Nullable final TypeEnum type) { + this.type = type; } /** - * Set the groundingServiceConfiguration of this {@link GroundingModuleConfig} instance and return - * the same instance. + * Set the config of this {@link GroundingModuleConfig} instance and return the same instance. * - * @param groundingServiceConfiguration The groundingServiceConfiguration of this {@link - * GroundingModuleConfig} + * @param config The config of this {@link GroundingModuleConfig} * @return The same instance of this {@link GroundingModuleConfig} class */ @Nonnull - public GroundingModuleConfig groundingServiceConfiguration( - @Nullable - final GroundingModuleConfigGroundingServiceConfiguration groundingServiceConfiguration) { - this.groundingServiceConfiguration = groundingServiceConfiguration; + public GroundingModuleConfig config(@Nonnull final GroundingModuleConfigConfig config) { + this.config = config; return this; } /** - * Get groundingServiceConfiguration + * Get config * - * @return groundingServiceConfiguration The groundingServiceConfiguration of this {@link - * GroundingModuleConfig} instance. + * @return config The config of this {@link GroundingModuleConfig} instance. */ @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration getGroundingServiceConfiguration() { - return groundingServiceConfiguration; + public GroundingModuleConfigConfig getConfig() { + return config; } /** - * Set the groundingServiceConfiguration of this {@link GroundingModuleConfig} instance. + * Set the config of this {@link GroundingModuleConfig} instance. * - * @param groundingServiceConfiguration The groundingServiceConfiguration of this {@link - * GroundingModuleConfig} + * @param config The config of this {@link GroundingModuleConfig} */ - public void setGroundingServiceConfiguration( - @Nullable - final GroundingModuleConfigGroundingServiceConfiguration groundingServiceConfiguration) { - this.groundingServiceConfiguration = groundingServiceConfiguration; + public void setConfig(@Nonnull final GroundingModuleConfigConfig config) { + this.config = config; } /** @@ -217,15 +207,13 @@ public boolean equals(@Nullable final java.lang.Object o) { } final GroundingModuleConfig groundingModuleConfig = (GroundingModuleConfig) o; return Objects.equals(this.cloudSdkCustomFields, groundingModuleConfig.cloudSdkCustomFields) - && Objects.equals(this.groundingService, groundingModuleConfig.groundingService) - && Objects.equals( - this.groundingServiceConfiguration, - groundingModuleConfig.groundingServiceConfiguration); + && Objects.equals(this.type, groundingModuleConfig.type) + && Objects.equals(this.config, groundingModuleConfig.config); } @Override public int hashCode() { - return Objects.hash(groundingService, groundingServiceConfiguration, cloudSdkCustomFields); + return Objects.hash(type, config, cloudSdkCustomFields); } @Override @@ -233,10 +221,8 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class GroundingModuleConfig {\n"); - sb.append(" groundingService: ").append(toIndentedString(groundingService)).append("\n"); - sb.append(" groundingServiceConfiguration: ") - .append(toIndentedString(groundingServiceConfiguration)) - .append("\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")); @@ -259,17 +245,28 @@ private String toIndentedString(final java.lang.Object o) { * instance with all required arguments. */ public static Builder create() { - return (groundingService) -> new GroundingModuleConfig().groundingService(groundingService); + return (type) -> (config) -> new GroundingModuleConfig().type(type).config(config); } /** Builder helper class. */ public interface Builder { /** - * Set the groundingService of this {@link GroundingModuleConfig} instance. + * 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 groundingService The groundingService of this {@link GroundingModuleConfig} + * @param config The config of this {@link GroundingModuleConfig} * @return The GroundingModuleConfig instance. */ - GroundingModuleConfig groundingService(@Nonnull final GroundingServiceEnum groundingService); + GroundingModuleConfig config(@Nonnull final GroundingModuleConfigConfig config); } } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java new file mode 100644 index 00000000..b12e1d84 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfig.java @@ -0,0 +1,304 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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 */ +// 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<>(); + + 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/client/model/GroundingModuleConfigConfigFiltersInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java new file mode 100644 index 00000000..2bb81950 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigConfigFiltersInner.java @@ -0,0 +1,525 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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; + +/** GroundingModuleConfigConfigFiltersInner */ +// CHECKSTYLE:OFF +public class GroundingModuleConfigConfigFiltersInner +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private Object id; + + @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<>(); + + protected GroundingModuleConfigConfigFiltersInner() {} + + /** + * Set the id of this {@link GroundingModuleConfigConfigFiltersInner} instance and return the same + * instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The same instance of this {@link GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner id(@Nullable final Object id) { + this.id = id; + return this; + } + + /** + * Identifier of this SearchFilter - unique per request. + * + * @return id The id of this {@link GroundingModuleConfigConfigFiltersInner} instance. + */ + @Nullable + public Object getId() { + return id; + } + + /** + * Set the id of this {@link GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} instance and + * return the same instance. + * + * @param searchConfig The searchConfig of this {@link GroundingModuleConfigConfigFiltersInner} + * @return The same instance of this {@link GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner searchConfig( + @Nullable final GroundingFilterSearchConfiguration searchConfig) { + this.searchConfig = searchConfig; + return this; + } + + /** + * Get searchConfig + * + * @return searchConfig The searchConfig of this {@link GroundingModuleConfigConfigFiltersInner} + * instance. + */ + @Nullable + public GroundingFilterSearchConfiguration getSearchConfig() { + return searchConfig; + } + + /** + * Set the searchConfig of this {@link GroundingModuleConfigConfigFiltersInner} instance. + * + * @param searchConfig The searchConfig of this {@link GroundingModuleConfigConfigFiltersInner} + */ + public void setSearchConfig(@Nullable final GroundingFilterSearchConfiguration searchConfig) { + this.searchConfig = searchConfig; + } + + /** + * Set the dataRepositories of this {@link GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner dataRepositories( + @Nullable final List dataRepositories) { + this.dataRepositories = dataRepositories; + return this; + } + + /** + * Add one dataRepositories instance to this {@link GroundingModuleConfigConfigFiltersInner}. + * + * @param dataRepositoriesItem The dataRepositories that should be added + * @return The same instance of type {@link GroundingModuleConfigConfigFiltersInner} + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner 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 + * GroundingModuleConfigConfigFiltersInner} instance. + */ + @Nonnull + public List getDataRepositories() { + return dataRepositories; + } + + /** + * Set the dataRepositories of this {@link GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} instance and + * return the same instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link + * GroundingModuleConfigConfigFiltersInner} + * @return The same instance of this {@link GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + return this; + } + + /** + * Get dataRepositoryType + * + * @return dataRepositoryType The dataRepositoryType of this {@link + * GroundingModuleConfigConfigFiltersInner} instance. + */ + @Nullable + public DataRepositoryType getDataRepositoryType() { + return dataRepositoryType; + } + + /** + * Set the dataRepositoryType of this {@link GroundingModuleConfigConfigFiltersInner} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link + * GroundingModuleConfigConfigFiltersInner} + */ + public void setDataRepositoryType(@Nullable final DataRepositoryType dataRepositoryType) { + this.dataRepositoryType = dataRepositoryType; + } + + /** + * Set the dataRepositoryMetadata of this {@link GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner dataRepositoryMetadata( + @Nullable final List dataRepositoryMetadata) { + this.dataRepositoryMetadata = dataRepositoryMetadata; + return this; + } + + /** + * Add one dataRepositoryMetadata instance to this {@link + * GroundingModuleConfigConfigFiltersInner}. + * + * @param dataRepositoryMetadataItem The dataRepositoryMetadata that should be added + * @return The same instance of type {@link GroundingModuleConfigConfigFiltersInner} + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner 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 + * GroundingModuleConfigConfigFiltersInner} instance. + */ + @Nonnull + public List getDataRepositoryMetadata() { + return dataRepositoryMetadata; + } + + /** + * Set the dataRepositoryMetadata of this {@link GroundingModuleConfigConfigFiltersInner} + * 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 GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link GroundingModuleConfigConfigFiltersInner}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link GroundingModuleConfigConfigFiltersInner} + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner 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 + * GroundingModuleConfigConfigFiltersInner} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} 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 GroundingModuleConfigConfigFiltersInner} class + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner chunkMetadata( + @Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link GroundingModuleConfigConfigFiltersInner}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link GroundingModuleConfigConfigFiltersInner} + */ + @Nonnull + public GroundingModuleConfigConfigFiltersInner 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 GroundingModuleConfigConfigFiltersInner} + * instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link GroundingModuleConfigConfigFiltersInner} 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 + * GroundingModuleConfigConfigFiltersInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * GroundingModuleConfigConfigFiltersInner} 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( + "GroundingModuleConfigConfigFiltersInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link GroundingModuleConfigConfigFiltersInner} + * 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 GroundingModuleConfigConfigFiltersInner groundingModuleConfigConfigFiltersInner = + (GroundingModuleConfigConfigFiltersInner) o; + return Objects.equals( + this.cloudSdkCustomFields, groundingModuleConfigConfigFiltersInner.cloudSdkCustomFields) + && Objects.equals(this.id, groundingModuleConfigConfigFiltersInner.id) + && Objects.equals(this.searchConfig, groundingModuleConfigConfigFiltersInner.searchConfig) + && Objects.equals( + this.dataRepositories, groundingModuleConfigConfigFiltersInner.dataRepositories) + && Objects.equals( + this.dataRepositoryType, groundingModuleConfigConfigFiltersInner.dataRepositoryType) + && Objects.equals( + this.dataRepositoryMetadata, + groundingModuleConfigConfigFiltersInner.dataRepositoryMetadata) + && Objects.equals( + this.documentMetadata, groundingModuleConfigConfigFiltersInner.documentMetadata) + && Objects.equals( + this.chunkMetadata, groundingModuleConfigConfigFiltersInner.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 GroundingModuleConfigConfigFiltersInner {\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 + * GroundingModuleConfigConfigFiltersInner} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (dataRepositoryType) -> + new GroundingModuleConfigConfigFiltersInner() + .id(id) + .dataRepositoryType(dataRepositoryType); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link GroundingModuleConfigConfigFiltersInner} instance. + * + * @param id Identifier of this SearchFilter - unique per request. + * @return The GroundingModuleConfigConfigFiltersInner builder. + */ + Builder1 id(@Nullable final Object id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the dataRepositoryType of this {@link GroundingModuleConfigConfigFiltersInner} instance. + * + * @param dataRepositoryType The dataRepositoryType of this {@link + * GroundingModuleConfigConfigFiltersInner} + * @return The GroundingModuleConfigConfigFiltersInner instance. + */ + GroundingModuleConfigConfigFiltersInner dataRepositoryType( + @Nullable final DataRepositoryType dataRepositoryType); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigGroundingServiceConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigGroundingServiceConfiguration.java deleted file mode 100644 index 1b9ae1cc..00000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/GroundingModuleConfigGroundingServiceConfiguration.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Internal Orchestration Service API - * SAP AI Core - Orchestration Service API - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.client.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.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; - -/** GroundingModuleConfigGroundingServiceConfiguration */ -// CHECKSTYLE:OFF -public class GroundingModuleConfigGroundingServiceConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("filters") - private List filters = new ArrayList<>(); - - @JsonProperty("grounding_input_parameters") - private List groundingInputParameters = new ArrayList<>(); - - @JsonProperty("grounding_output_parameter") - private String groundingOutputParameter; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - protected GroundingModuleConfigGroundingServiceConfiguration() {} - - /** - * Set the filters of this {@link GroundingModuleConfigGroundingServiceConfiguration} instance and - * return the same instance. - * - * @param filters Document grounding service filters to be used - * @return The same instance of this {@link GroundingModuleConfigGroundingServiceConfiguration} - * class - */ - @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration filters( - @Nullable final List filters) { - this.filters = filters; - return this; - } - - /** - * Add one filters instance to this {@link GroundingModuleConfigGroundingServiceConfiguration}. - * - * @param filtersItem The filters that should be added - * @return The same instance of type {@link GroundingModuleConfigGroundingServiceConfiguration} - */ - @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration addFiltersItem( - @Nonnull final GroundingFilter 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 GroundingModuleConfigGroundingServiceConfiguration} - * instance. - */ - @Nonnull - public List getFilters() { - return filters; - } - - /** - * Set the filters of this {@link GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param filters Document grounding service filters to be used - */ - public void setFilters(@Nullable final List filters) { - this.filters = filters; - } - - /** - * Set the groundingInputParameters of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance and return the same instance. - * - * @param groundingInputParameters Contains the input parameters used for grounding input - * questions - * @return The same instance of this {@link GroundingModuleConfigGroundingServiceConfiguration} - * class - */ - @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration groundingInputParameters( - @Nonnull final List groundingInputParameters) { - this.groundingInputParameters = groundingInputParameters; - return this; - } - - /** - * Add one groundingInputParameters instance to this {@link - * GroundingModuleConfigGroundingServiceConfiguration}. - * - * @param groundingInputParametersItem The groundingInputParameters that should be added - * @return The same instance of type {@link GroundingModuleConfigGroundingServiceConfiguration} - */ - @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration addGroundingInputParametersItem( - @Nonnull final String groundingInputParametersItem) { - if (this.groundingInputParameters == null) { - this.groundingInputParameters = new ArrayList<>(); - } - this.groundingInputParameters.add(groundingInputParametersItem); - return this; - } - - /** - * Contains the input parameters used for grounding input questions - * - * @return groundingInputParameters The groundingInputParameters of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - */ - @Nonnull - public List getGroundingInputParameters() { - return groundingInputParameters; - } - - /** - * Set the groundingInputParameters of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param groundingInputParameters Contains the input parameters used for grounding input - * questions - */ - public void setGroundingInputParameters(@Nonnull final List groundingInputParameters) { - this.groundingInputParameters = groundingInputParameters; - } - - /** - * Set the groundingOutputParameter of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance and return the same instance. - * - * @param groundingOutputParameter Parameter name used for grounding output - * @return The same instance of this {@link GroundingModuleConfigGroundingServiceConfiguration} - * class - */ - @Nonnull - public GroundingModuleConfigGroundingServiceConfiguration groundingOutputParameter( - @Nonnull final String groundingOutputParameter) { - this.groundingOutputParameter = groundingOutputParameter; - return this; - } - - /** - * Parameter name used for grounding output - * - * @return groundingOutputParameter The groundingOutputParameter of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - */ - @Nonnull - public String getGroundingOutputParameter() { - return groundingOutputParameter; - } - - /** - * Set the groundingOutputParameter of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param groundingOutputParameter Parameter name used for grounding output - */ - public void setGroundingOutputParameter(@Nonnull final String groundingOutputParameter) { - this.groundingOutputParameter = groundingOutputParameter; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * GroundingModuleConfigGroundingServiceConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} 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( - "GroundingModuleConfigGroundingServiceConfiguration has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} 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 GroundingModuleConfigGroundingServiceConfiguration - groundingModuleConfigGroundingServiceConfiguration = - (GroundingModuleConfigGroundingServiceConfiguration) o; - return Objects.equals( - this.cloudSdkCustomFields, - groundingModuleConfigGroundingServiceConfiguration.cloudSdkCustomFields) - && Objects.equals(this.filters, groundingModuleConfigGroundingServiceConfiguration.filters) - && Objects.equals( - this.groundingInputParameters, - groundingModuleConfigGroundingServiceConfiguration.groundingInputParameters) - && Objects.equals( - this.groundingOutputParameter, - groundingModuleConfigGroundingServiceConfiguration.groundingOutputParameter); - } - - @Override - public int hashCode() { - return Objects.hash( - filters, groundingInputParameters, groundingOutputParameter, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GroundingModuleConfigGroundingServiceConfiguration {\n"); - sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" groundingInputParameters: ") - .append(toIndentedString(groundingInputParameters)) - .append("\n"); - sb.append(" groundingOutputParameter: ") - .append(toIndentedString(groundingOutputParameter)) - .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 - * GroundingModuleConfigGroundingServiceConfiguration} instance with all required arguments. - */ - public static Builder create() { - return (groundingInputParameters) -> - (groundingOutputParameter) -> - new GroundingModuleConfigGroundingServiceConfiguration() - .groundingInputParameters(groundingInputParameters) - .groundingOutputParameter(groundingOutputParameter); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the groundingInputParameters of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param groundingInputParameters Contains the input parameters used for grounding input - * questions - * @return The GroundingModuleConfigGroundingServiceConfiguration builder. - */ - Builder1 groundingInputParameters(@Nonnull final List groundingInputParameters); - - /** - * Set the groundingInputParameters of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param groundingInputParameters Contains the input parameters used for grounding input - * questions - * @return The GroundingModuleConfigGroundingServiceConfiguration builder. - */ - default Builder1 groundingInputParameters(@Nonnull final String... groundingInputParameters) { - return groundingInputParameters(Arrays.asList(groundingInputParameters)); - } - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the groundingOutputParameter of this {@link - * GroundingModuleConfigGroundingServiceConfiguration} instance. - * - * @param groundingOutputParameter Parameter name used for grounding output - * @return The GroundingModuleConfigGroundingServiceConfiguration instance. - */ - GroundingModuleConfigGroundingServiceConfiguration groundingOutputParameter( - @Nonnull final String groundingOutputParameter); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/InputFilteringConfig.java similarity index 71% rename from orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringConfig.java rename to orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/InputFilteringConfig.java index 501ad1bb..c61afeff 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/FilteringConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/InputFilteringConfig.java @@ -27,9 +27,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** FilteringConfig */ +/** InputFilteringConfig */ // CHECKSTYLE:OFF -public class FilteringConfig +public class InputFilteringConfig // CHECKSTYLE:ON { @JsonProperty("filters") @@ -38,29 +38,29 @@ public class FilteringConfig @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - protected FilteringConfig() {} + protected InputFilteringConfig() {} /** - * Set the filters of this {@link FilteringConfig} instance and return the same instance. + * Set the filters of this {@link InputFilteringConfig} instance and return the same instance. * * @param filters Configuration for content filtering services that should be used for the given * filtering step (input filtering or output filtering). - * @return The same instance of this {@link FilteringConfig} class + * @return The same instance of this {@link InputFilteringConfig} class */ @Nonnull - public FilteringConfig filters(@Nonnull final List filters) { + public InputFilteringConfig filters(@Nonnull final List filters) { this.filters = filters; return this; } /** - * Add one filters instance to this {@link FilteringConfig}. + * Add one filters instance to this {@link InputFilteringConfig}. * * @param filtersItem The filters that should be added - * @return The same instance of type {@link FilteringConfig} + * @return The same instance of type {@link InputFilteringConfig} */ @Nonnull - public FilteringConfig addFiltersItem(@Nonnull final FilterConfig filtersItem) { + public InputFilteringConfig addFiltersItem(@Nonnull final FilterConfig filtersItem) { if (this.filters == null) { this.filters = new ArrayList<>(); } @@ -72,7 +72,7 @@ public FilteringConfig addFiltersItem(@Nonnull final FilterConfig filtersItem) { * Configuration for content filtering services that should be used for the given filtering step * (input filtering or output filtering). * - * @return filters The filters of this {@link FilteringConfig} instance. + * @return filters The filters of this {@link InputFilteringConfig} instance. */ @Nonnull public List getFilters() { @@ -80,7 +80,7 @@ public List getFilters() { } /** - * Set the filters of this {@link FilteringConfig} instance. + * Set the filters of this {@link InputFilteringConfig} instance. * * @param filters Configuration for content filtering services that should be used for the given * filtering step (input filtering or output filtering). @@ -90,7 +90,7 @@ public void setFilters(@Nonnull final List filters) { } /** - * Get the names of the unrecognizable properties of the {@link FilteringConfig}. + * Get the names of the unrecognizable properties of the {@link InputFilteringConfig}. * * @return The set of properties names */ @@ -101,7 +101,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link FilteringConfig} instance. + * Get the value of an unrecognizable property of this {@link InputFilteringConfig} instance. * * @param name The name of the property * @return The value of the property @@ -110,14 +110,15 @@ public Set getCustomFieldNames() { @Nullable public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("FilteringConfig has no field with name '" + name + "'."); + throw new NoSuchElementException( + "InputFilteringConfig has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Set an unrecognizable property of this {@link FilteringConfig} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link InputFilteringConfig} 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 @@ -135,9 +136,9 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final FilteringConfig filteringConfig = (FilteringConfig) o; - return Objects.equals(this.cloudSdkCustomFields, filteringConfig.cloudSdkCustomFields) - && Objects.equals(this.filters, filteringConfig.filters); + final InputFilteringConfig inputFilteringConfig = (InputFilteringConfig) o; + return Objects.equals(this.cloudSdkCustomFields, inputFilteringConfig.cloudSdkCustomFields) + && Objects.equals(this.filters, inputFilteringConfig.filters); } @Override @@ -149,7 +150,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class FilteringConfig {\n"); + sb.append("class InputFilteringConfig {\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -169,32 +170,32 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link FilteringConfig} + * Create a type-safe, fluent-api builder object to construct a new {@link InputFilteringConfig} * instance with all required arguments. */ public static Builder create() { - return (filters) -> new FilteringConfig().filters(filters); + return (filters) -> new InputFilteringConfig().filters(filters); } /** Builder helper class. */ public interface Builder { /** - * Set the filters of this {@link FilteringConfig} instance. + * Set the filters of this {@link InputFilteringConfig} instance. * * @param filters Configuration for content filtering services that should be used for the given * filtering step (input filtering or output filtering). - * @return The FilteringConfig instance. + * @return The InputFilteringConfig instance. */ - FilteringConfig filters(@Nonnull final List filters); + InputFilteringConfig filters(@Nonnull final List filters); /** - * Set the filters of this {@link FilteringConfig} instance. + * Set the filters of this {@link InputFilteringConfig} instance. * * @param filters Configuration for content filtering services that should be used for the given * filtering step (input filtering or output filtering). - * @return The FilteringConfig instance. + * @return The InputFilteringConfig instance. */ - default FilteringConfig filters(@Nonnull final FilterConfig... filters) { + default InputFilteringConfig filters(@Nonnull final FilterConfig... filters) { return filters(Arrays.asList(filters)); } } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java new file mode 100644 index 00000000..3ebc2793 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/KeyValueListPair.java @@ -0,0 +1,243 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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 */ +// 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<>(); + + 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/client/model/LLMChoiceStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMChoiceStreaming.java new file mode 100644 index 00000000..bc28dba8 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMChoiceStreaming.java @@ -0,0 +1,305 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.HashMap; +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; + +/** LLMChoiceStreaming */ +// CHECKSTYLE:OFF +public class LLMChoiceStreaming +// CHECKSTYLE:ON +{ + @JsonProperty("index") + private Integer index; + + @JsonProperty("delta") + private ChatDelta delta; + + @JsonProperty("logprobs") + private Map> logprobs = new HashMap<>(); + + @JsonProperty("finish_reason") + private String finishReason; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected LLMChoiceStreaming() {} + + /** + * Set the index of this {@link LLMChoiceStreaming} instance and return the same instance. + * + * @param index Index of the choice + * @return The same instance of this {@link LLMChoiceStreaming} class + */ + @Nonnull + public LLMChoiceStreaming index(@Nonnull final Integer index) { + this.index = index; + return this; + } + + /** + * Index of the choice + * + * @return index The index of this {@link LLMChoiceStreaming} instance. + */ + @Nonnull + public Integer getIndex() { + return index; + } + + /** + * Set the index of this {@link LLMChoiceStreaming} instance. + * + * @param index Index of the choice + */ + public void setIndex(@Nonnull final Integer index) { + this.index = index; + } + + /** + * Set the delta of this {@link LLMChoiceStreaming} instance and return the same instance. + * + * @param delta The delta of this {@link LLMChoiceStreaming} + * @return The same instance of this {@link LLMChoiceStreaming} class + */ + @Nonnull + public LLMChoiceStreaming delta(@Nonnull final ChatDelta delta) { + this.delta = delta; + return this; + } + + /** + * Get delta + * + * @return delta The delta of this {@link LLMChoiceStreaming} instance. + */ + @Nonnull + public ChatDelta getDelta() { + return delta; + } + + /** + * Set the delta of this {@link LLMChoiceStreaming} instance. + * + * @param delta The delta of this {@link LLMChoiceStreaming} + */ + public void setDelta(@Nonnull final ChatDelta delta) { + this.delta = delta; + } + + /** + * Set the logprobs of this {@link LLMChoiceStreaming} instance and return the same instance. + * + * @param logprobs Log probabilities + * @return The same instance of this {@link LLMChoiceStreaming} class + */ + @Nonnull + public LLMChoiceStreaming logprobs(@Nullable final Map> logprobs) { + this.logprobs = logprobs; + return this; + } + + /** + * Put one logprobs instance to this {@link LLMChoiceStreaming} instance. + * + * @param key The String key of this logprobs instance + * @param logprobsItem The logprobs that should be added under the given key + * @return The same instance of type {@link LLMChoiceStreaming} + */ + @Nonnull + public LLMChoiceStreaming putlogprobsItem( + @Nonnull final String key, @Nonnull final List logprobsItem) { + this.logprobs = new HashMap<>(); + this.logprobs.put(key, logprobsItem); + return this; + } + + /** + * Log probabilities + * + * @return logprobs The logprobs of this {@link LLMChoiceStreaming} instance. + */ + @Nonnull + public Map> getLogprobs() { + return logprobs; + } + + /** + * Set the logprobs of this {@link LLMChoiceStreaming} instance. + * + * @param logprobs Log probabilities + */ + public void setLogprobs(@Nullable final Map> logprobs) { + this.logprobs = logprobs; + } + + /** + * Set the finishReason of this {@link LLMChoiceStreaming} instance and return the same instance. + * + * @param finishReason Reason for stopping the model + * @return The same instance of this {@link LLMChoiceStreaming} class + */ + @Nonnull + public LLMChoiceStreaming finishReason(@Nullable final String finishReason) { + this.finishReason = finishReason; + return this; + } + + /** + * Reason for stopping the model + * + * @return finishReason The finishReason of this {@link LLMChoiceStreaming} instance. + */ + @Nonnull + public String getFinishReason() { + return finishReason; + } + + /** + * Set the finishReason of this {@link LLMChoiceStreaming} instance. + * + * @param finishReason Reason for stopping the model + */ + public void setFinishReason(@Nullable final String finishReason) { + this.finishReason = finishReason; + } + + /** + * Get the names of the unrecognizable properties of the {@link LLMChoiceStreaming}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LLMChoiceStreaming} 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("LLMChoiceStreaming has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link LLMChoiceStreaming} 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 LLMChoiceStreaming llMChoiceStreaming = (LLMChoiceStreaming) o; + return Objects.equals(this.cloudSdkCustomFields, llMChoiceStreaming.cloudSdkCustomFields) + && Objects.equals(this.index, llMChoiceStreaming.index) + && Objects.equals(this.delta, llMChoiceStreaming.delta) + && Objects.equals(this.logprobs, llMChoiceStreaming.logprobs) + && Objects.equals(this.finishReason, llMChoiceStreaming.finishReason); + } + + @Override + public int hashCode() { + return Objects.hash(index, delta, logprobs, finishReason, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class LLMChoiceStreaming {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" logprobs: ").append(toIndentedString(logprobs)).append("\n"); + sb.append(" finishReason: ").append(toIndentedString(finishReason)).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 LLMChoiceStreaming} + * instance with all required arguments. + */ + public static Builder create() { + return (index) -> (delta) -> new LLMChoiceStreaming().index(index).delta(delta); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the index of this {@link LLMChoiceStreaming} instance. + * + * @param index Index of the choice + * @return The LLMChoiceStreaming builder. + */ + Builder1 index(@Nonnull final Integer index); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the delta of this {@link LLMChoiceStreaming} instance. + * + * @param delta The delta of this {@link LLMChoiceStreaming} + * @return The LLMChoiceStreaming instance. + */ + LLMChoiceStreaming delta(@Nonnull final ChatDelta delta); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultStreaming.java new file mode 100644 index 00000000..ce80a2b3 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultStreaming.java @@ -0,0 +1,470 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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; + +/** Output of LLM module. Follows the OpenAI spec. */ +// CHECKSTYLE:OFF +public class LLMModuleResultStreaming +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("object") + private String _object; + + @JsonProperty("created") + private Integer created; + + @JsonProperty("model") + private String model; + + @JsonProperty("system_fingerprint") + private String systemFingerprint; + + @JsonProperty("choices") + private List choices = new ArrayList<>(); + + @JsonProperty("usage") + private TokenUsage usage; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected LLMModuleResultStreaming() {} + + /** + * Set the id of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param id ID of the response + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * ID of the response + * + * @return id The id of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link LLMModuleResultStreaming} instance. + * + * @param id ID of the response + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the _object of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param _object Object type + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming _object(@Nonnull final String _object) { + this._object = _object; + return this; + } + + /** + * Object type + * + * @return _object The _object of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public String getObject() { + return _object; + } + + /** + * Set the _object of this {@link LLMModuleResultStreaming} instance. + * + * @param _object Object type + */ + public void setObject(@Nonnull final String _object) { + this._object = _object; + } + + /** + * Set the created of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param created Unix timestamp + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming created(@Nonnull final Integer created) { + this.created = created; + return this; + } + + /** + * Unix timestamp + * + * @return created The created of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public Integer getCreated() { + return created; + } + + /** + * Set the created of this {@link LLMModuleResultStreaming} instance. + * + * @param created Unix timestamp + */ + public void setCreated(@Nonnull final Integer created) { + this.created = created; + } + + /** + * Set the model of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param model Model name + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming model(@Nonnull final String model) { + this.model = model; + return this; + } + + /** + * Model name + * + * @return model The model of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public String getModel() { + return model; + } + + /** + * Set the model of this {@link LLMModuleResultStreaming} instance. + * + * @param model Model name + */ + public void setModel(@Nonnull final String model) { + this.model = model; + } + + /** + * Set the systemFingerprint of this {@link LLMModuleResultStreaming} instance and return the same + * instance. + * + * @param systemFingerprint System fingerprint + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming systemFingerprint(@Nullable final String systemFingerprint) { + this.systemFingerprint = systemFingerprint; + return this; + } + + /** + * System fingerprint + * + * @return systemFingerprint The systemFingerprint of this {@link LLMModuleResultStreaming} + * instance. + */ + @Nonnull + public String getSystemFingerprint() { + return systemFingerprint; + } + + /** + * Set the systemFingerprint of this {@link LLMModuleResultStreaming} instance. + * + * @param systemFingerprint System fingerprint + */ + public void setSystemFingerprint(@Nullable final String systemFingerprint) { + this.systemFingerprint = systemFingerprint; + } + + /** + * Set the choices of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param choices Choices + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming choices(@Nonnull final List choices) { + this.choices = choices; + return this; + } + + /** + * Add one choices instance to this {@link LLMModuleResultStreaming}. + * + * @param choicesItem The choices that should be added + * @return The same instance of type {@link LLMModuleResultStreaming} + */ + @Nonnull + public LLMModuleResultStreaming addChoicesItem(@Nonnull final LLMChoiceStreaming choicesItem) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.add(choicesItem); + return this; + } + + /** + * Choices + * + * @return choices The choices of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public List getChoices() { + return choices; + } + + /** + * Set the choices of this {@link LLMModuleResultStreaming} instance. + * + * @param choices Choices + */ + public void setChoices(@Nonnull final List choices) { + this.choices = choices; + } + + /** + * Set the usage of this {@link LLMModuleResultStreaming} instance and return the same instance. + * + * @param usage The usage of this {@link LLMModuleResultStreaming} + * @return The same instance of this {@link LLMModuleResultStreaming} class + */ + @Nonnull + public LLMModuleResultStreaming usage(@Nullable final TokenUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage The usage of this {@link LLMModuleResultStreaming} instance. + */ + @Nonnull + public TokenUsage getUsage() { + return usage; + } + + /** + * Set the usage of this {@link LLMModuleResultStreaming} instance. + * + * @param usage The usage of this {@link LLMModuleResultStreaming} + */ + public void setUsage(@Nullable final TokenUsage usage) { + this.usage = usage; + } + + /** + * Get the names of the unrecognizable properties of the {@link LLMModuleResultStreaming}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LLMModuleResultStreaming} 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( + "LLMModuleResultStreaming has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link LLMModuleResultStreaming} 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 LLMModuleResultStreaming llMModuleResultStreaming = (LLMModuleResultStreaming) o; + return Objects.equals(this.cloudSdkCustomFields, llMModuleResultStreaming.cloudSdkCustomFields) + && Objects.equals(this.id, llMModuleResultStreaming.id) + && Objects.equals(this._object, llMModuleResultStreaming._object) + && Objects.equals(this.created, llMModuleResultStreaming.created) + && Objects.equals(this.model, llMModuleResultStreaming.model) + && Objects.equals(this.systemFingerprint, llMModuleResultStreaming.systemFingerprint) + && Objects.equals(this.choices, llMModuleResultStreaming.choices) + && Objects.equals(this.usage, llMModuleResultStreaming.usage); + } + + @Override + public int hashCode() { + return Objects.hash( + id, _object, created, model, systemFingerprint, choices, usage, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class LLMModuleResultStreaming {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" systemFingerprint: ").append(toIndentedString(systemFingerprint)).append("\n"); + sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).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 + * LLMModuleResultStreaming} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (_object) -> + (created) -> + (model) -> + (choices) -> + new LLMModuleResultStreaming() + .id(id) + ._object(_object) + .created(created) + .model(model) + .choices(choices); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link LLMModuleResultStreaming} instance. + * + * @param id ID of the response + * @return The LLMModuleResultStreaming builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _object of this {@link LLMModuleResultStreaming} instance. + * + * @param _object Object type + * @return The LLMModuleResultStreaming builder. + */ + Builder2 _object(@Nonnull final String _object); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the created of this {@link LLMModuleResultStreaming} instance. + * + * @param created Unix timestamp + * @return The LLMModuleResultStreaming builder. + */ + Builder3 created(@Nonnull final Integer created); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the model of this {@link LLMModuleResultStreaming} instance. + * + * @param model Model name + * @return The LLMModuleResultStreaming builder. + */ + Builder4 model(@Nonnull final String model); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the choices of this {@link LLMModuleResultStreaming} instance. + * + * @param choices Choices + * @return The LLMModuleResultStreaming instance. + */ + LLMModuleResultStreaming choices(@Nonnull final List choices); + + /** + * Set the choices of this {@link LLMModuleResultStreaming} instance. + * + * @param choices Choices + * @return The LLMModuleResultStreaming instance. + */ + default LLMModuleResultStreaming choices(@Nonnull final LLMChoiceStreaming... choices) { + return choices(Arrays.asList(choices)); + } + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultSynchronous.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultSynchronous.java new file mode 100644 index 00000000..fe61d9e1 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/LLMModuleResultSynchronous.java @@ -0,0 +1,488 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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; + +/** Output of LLM module. Follows the OpenAI spec. */ +// CHECKSTYLE:OFF +public class LLMModuleResultSynchronous +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("object") + private String _object; + + @JsonProperty("created") + private Integer created; + + @JsonProperty("model") + private String model; + + @JsonProperty("system_fingerprint") + private String systemFingerprint; + + @JsonProperty("choices") + private List choices = new ArrayList<>(); + + @JsonProperty("usage") + private TokenUsage usage; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected LLMModuleResultSynchronous() {} + + /** + * Set the id of this {@link LLMModuleResultSynchronous} instance and return the same instance. + * + * @param id ID of the response + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * ID of the response + * + * @return id The id of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link LLMModuleResultSynchronous} instance. + * + * @param id ID of the response + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the _object of this {@link LLMModuleResultSynchronous} instance and return the same + * instance. + * + * @param _object Object type + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous _object(@Nonnull final String _object) { + this._object = _object; + return this; + } + + /** + * Object type + * + * @return _object The _object of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public String getObject() { + return _object; + } + + /** + * Set the _object of this {@link LLMModuleResultSynchronous} instance. + * + * @param _object Object type + */ + public void setObject(@Nonnull final String _object) { + this._object = _object; + } + + /** + * Set the created of this {@link LLMModuleResultSynchronous} instance and return the same + * instance. + * + * @param created Unix timestamp + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous created(@Nonnull final Integer created) { + this.created = created; + return this; + } + + /** + * Unix timestamp + * + * @return created The created of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public Integer getCreated() { + return created; + } + + /** + * Set the created of this {@link LLMModuleResultSynchronous} instance. + * + * @param created Unix timestamp + */ + public void setCreated(@Nonnull final Integer created) { + this.created = created; + } + + /** + * Set the model of this {@link LLMModuleResultSynchronous} instance and return the same instance. + * + * @param model Model name + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous model(@Nonnull final String model) { + this.model = model; + return this; + } + + /** + * Model name + * + * @return model The model of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public String getModel() { + return model; + } + + /** + * Set the model of this {@link LLMModuleResultSynchronous} instance. + * + * @param model Model name + */ + public void setModel(@Nonnull final String model) { + this.model = model; + } + + /** + * Set the systemFingerprint of this {@link LLMModuleResultSynchronous} instance and return the + * same instance. + * + * @param systemFingerprint System fingerprint + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous systemFingerprint(@Nullable final String systemFingerprint) { + this.systemFingerprint = systemFingerprint; + return this; + } + + /** + * System fingerprint + * + * @return systemFingerprint The systemFingerprint of this {@link LLMModuleResultSynchronous} + * instance. + */ + @Nonnull + public String getSystemFingerprint() { + return systemFingerprint; + } + + /** + * Set the systemFingerprint of this {@link LLMModuleResultSynchronous} instance. + * + * @param systemFingerprint System fingerprint + */ + public void setSystemFingerprint(@Nullable final String systemFingerprint) { + this.systemFingerprint = systemFingerprint; + } + + /** + * Set the choices of this {@link LLMModuleResultSynchronous} instance and return the same + * instance. + * + * @param choices Choices + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous choices(@Nonnull final List choices) { + this.choices = choices; + return this; + } + + /** + * Add one choices instance to this {@link LLMModuleResultSynchronous}. + * + * @param choicesItem The choices that should be added + * @return The same instance of type {@link LLMModuleResultSynchronous} + */ + @Nonnull + public LLMModuleResultSynchronous addChoicesItem(@Nonnull final LLMChoice choicesItem) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.add(choicesItem); + return this; + } + + /** + * Choices + * + * @return choices The choices of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public List getChoices() { + return choices; + } + + /** + * Set the choices of this {@link LLMModuleResultSynchronous} instance. + * + * @param choices Choices + */ + public void setChoices(@Nonnull final List choices) { + this.choices = choices; + } + + /** + * Set the usage of this {@link LLMModuleResultSynchronous} instance and return the same instance. + * + * @param usage The usage of this {@link LLMModuleResultSynchronous} + * @return The same instance of this {@link LLMModuleResultSynchronous} class + */ + @Nonnull + public LLMModuleResultSynchronous usage(@Nonnull final TokenUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage The usage of this {@link LLMModuleResultSynchronous} instance. + */ + @Nonnull + public TokenUsage getUsage() { + return usage; + } + + /** + * Set the usage of this {@link LLMModuleResultSynchronous} instance. + * + * @param usage The usage of this {@link LLMModuleResultSynchronous} + */ + public void setUsage(@Nonnull final TokenUsage usage) { + this.usage = usage; + } + + /** + * Get the names of the unrecognizable properties of the {@link LLMModuleResultSynchronous}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LLMModuleResultSynchronous} + * 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( + "LLMModuleResultSynchronous has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link LLMModuleResultSynchronous} 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 LLMModuleResultSynchronous llMModuleResultSynchronous = (LLMModuleResultSynchronous) o; + return Objects.equals( + this.cloudSdkCustomFields, llMModuleResultSynchronous.cloudSdkCustomFields) + && Objects.equals(this.id, llMModuleResultSynchronous.id) + && Objects.equals(this._object, llMModuleResultSynchronous._object) + && Objects.equals(this.created, llMModuleResultSynchronous.created) + && Objects.equals(this.model, llMModuleResultSynchronous.model) + && Objects.equals(this.systemFingerprint, llMModuleResultSynchronous.systemFingerprint) + && Objects.equals(this.choices, llMModuleResultSynchronous.choices) + && Objects.equals(this.usage, llMModuleResultSynchronous.usage); + } + + @Override + public int hashCode() { + return Objects.hash( + id, _object, created, model, systemFingerprint, choices, usage, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class LLMModuleResultSynchronous {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" systemFingerprint: ").append(toIndentedString(systemFingerprint)).append("\n"); + sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).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 + * LLMModuleResultSynchronous} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (_object) -> + (created) -> + (model) -> + (choices) -> + (usage) -> + new LLMModuleResultSynchronous() + .id(id) + ._object(_object) + .created(created) + .model(model) + .choices(choices) + .usage(usage); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link LLMModuleResultSynchronous} instance. + * + * @param id ID of the response + * @return The LLMModuleResultSynchronous builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _object of this {@link LLMModuleResultSynchronous} instance. + * + * @param _object Object type + * @return The LLMModuleResultSynchronous builder. + */ + Builder2 _object(@Nonnull final String _object); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the created of this {@link LLMModuleResultSynchronous} instance. + * + * @param created Unix timestamp + * @return The LLMModuleResultSynchronous builder. + */ + Builder3 created(@Nonnull final Integer created); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the model of this {@link LLMModuleResultSynchronous} instance. + * + * @param model Model name + * @return The LLMModuleResultSynchronous builder. + */ + Builder4 model(@Nonnull final String model); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the choices of this {@link LLMModuleResultSynchronous} instance. + * + * @param choices Choices + * @return The LLMModuleResultSynchronous builder. + */ + Builder5 choices(@Nonnull final List choices); + + /** + * Set the choices of this {@link LLMModuleResultSynchronous} instance. + * + * @param choices Choices + * @return The LLMModuleResultSynchronous builder. + */ + default Builder5 choices(@Nonnull final LLMChoice... choices) { + return choices(Arrays.asList(choices)); + } + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the usage of this {@link LLMModuleResultSynchronous} instance. + * + * @param usage The usage of this {@link LLMModuleResultSynchronous} + * @return The LLMModuleResultSynchronous instance. + */ + LLMModuleResultSynchronous usage(@Nonnull final TokenUsage usage); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResults.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResults.java index af260d12..67d68e67 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResults.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResults.java @@ -50,7 +50,7 @@ public class ModuleResults private GenericModuleResult outputFiltering; @JsonProperty("output_unmasking") - private List outputUnmasking = new ArrayList<>(); + private List outputUnmasking = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -265,7 +265,8 @@ public void setOutputFiltering(@Nullable final GenericModuleResult outputFilteri * @return The same instance of this {@link ModuleResults} class */ @Nonnull - public ModuleResults outputUnmasking(@Nullable final List outputUnmasking) { + public ModuleResults outputUnmasking( + @Nullable final List outputUnmasking) { this.outputUnmasking = outputUnmasking; return this; } @@ -277,7 +278,8 @@ public ModuleResults outputUnmasking(@Nullable final List outputUnmas * @return The same instance of type {@link ModuleResults} */ @Nonnull - public ModuleResults addOutputUnmaskingItem(@Nonnull final LLMChoice outputUnmaskingItem) { + public ModuleResults addOutputUnmaskingItem( + @Nonnull final ModuleResultsOutputUnmaskingInner outputUnmaskingItem) { if (this.outputUnmasking == null) { this.outputUnmasking = new ArrayList<>(); } @@ -291,7 +293,7 @@ public ModuleResults addOutputUnmaskingItem(@Nonnull final LLMChoice outputUnmas * @return outputUnmasking The outputUnmasking of this {@link ModuleResults} instance. */ @Nonnull - public List getOutputUnmasking() { + public List getOutputUnmasking() { return outputUnmasking; } @@ -300,7 +302,8 @@ public List getOutputUnmasking() { * * @param outputUnmasking The outputUnmasking of this {@link ModuleResults} */ - public void setOutputUnmasking(@Nullable final List outputUnmasking) { + public void setOutputUnmasking( + @Nullable final List outputUnmasking) { this.outputUnmasking = outputUnmasking; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java new file mode 100644 index 00000000..92c06952 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/ModuleResultsOutputUnmaskingInner.java @@ -0,0 +1,346 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.HashMap; +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; + +/** ModuleResultsOutputUnmaskingInner */ +// CHECKSTYLE:OFF +public class ModuleResultsOutputUnmaskingInner +// CHECKSTYLE:ON +{ + @JsonProperty("index") + private Integer index; + + @JsonProperty("message") + private ChatMessage message; + + @JsonProperty("logprobs") + private Map> logprobs = new HashMap<>(); + + @JsonProperty("finish_reason") + private String finishReason; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected ModuleResultsOutputUnmaskingInner() {} + + /** + * Set the index of this {@link ModuleResultsOutputUnmaskingInner} instance and return the same + * instance. + * + * @param index Index of the choice + * @return The same instance of this {@link ModuleResultsOutputUnmaskingInner} class + */ + @Nonnull + public ModuleResultsOutputUnmaskingInner index(@Nonnull final Integer index) { + this.index = index; + return this; + } + + /** + * Index of the choice + * + * @return index The index of this {@link ModuleResultsOutputUnmaskingInner} instance. + */ + @Nonnull + public Integer getIndex() { + return index; + } + + /** + * Set the index of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param index Index of the choice + */ + public void setIndex(@Nonnull final Integer index) { + this.index = index; + } + + /** + * Set the message of this {@link ModuleResultsOutputUnmaskingInner} instance and return the same + * instance. + * + * @param message The message of this {@link ModuleResultsOutputUnmaskingInner} + * @return The same instance of this {@link ModuleResultsOutputUnmaskingInner} class + */ + @Nonnull + public ModuleResultsOutputUnmaskingInner message(@Nonnull final ChatMessage message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link ModuleResultsOutputUnmaskingInner} instance. + */ + @Nonnull + public ChatMessage getMessage() { + return message; + } + + /** + * Set the message of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param message The message of this {@link ModuleResultsOutputUnmaskingInner} + */ + public void setMessage(@Nonnull final ChatMessage message) { + this.message = message; + } + + /** + * Set the logprobs of this {@link ModuleResultsOutputUnmaskingInner} instance and return the same + * instance. + * + * @param logprobs Log probabilities + * @return The same instance of this {@link ModuleResultsOutputUnmaskingInner} class + */ + @Nonnull + public ModuleResultsOutputUnmaskingInner logprobs( + @Nullable final Map> logprobs) { + this.logprobs = logprobs; + return this; + } + + /** + * Put one logprobs instance to this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param key The String key of this logprobs instance + * @param logprobsItem The logprobs that should be added under the given key + * @return The same instance of type {@link ModuleResultsOutputUnmaskingInner} + */ + @Nonnull + public ModuleResultsOutputUnmaskingInner putlogprobsItem( + @Nonnull final String key, @Nonnull final List logprobsItem) { + this.logprobs = new HashMap<>(); + this.logprobs.put(key, logprobsItem); + return this; + } + + /** + * Log probabilities + * + * @return logprobs The logprobs of this {@link ModuleResultsOutputUnmaskingInner} instance. + */ + @Nonnull + public Map> getLogprobs() { + return logprobs; + } + + /** + * Set the logprobs of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param logprobs Log probabilities + */ + public void setLogprobs(@Nullable final Map> logprobs) { + this.logprobs = logprobs; + } + + /** + * Set the finishReason of this {@link ModuleResultsOutputUnmaskingInner} instance and return the + * same instance. + * + * @param finishReason 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 + * @return The same instance of this {@link ModuleResultsOutputUnmaskingInner} class + */ + @Nonnull + public ModuleResultsOutputUnmaskingInner finishReason(@Nonnull final String finishReason) { + this.finishReason = finishReason; + return this; + } + + /** + * 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 + * + * @return finishReason The finishReason of this {@link ModuleResultsOutputUnmaskingInner} + * instance. + */ + @Nonnull + public String getFinishReason() { + return finishReason; + } + + /** + * Set the finishReason of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param finishReason 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 + */ + public void setFinishReason(@Nonnull final String finishReason) { + this.finishReason = finishReason; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * ModuleResultsOutputUnmaskingInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ModuleResultsOutputUnmaskingInner} + * 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( + "ModuleResultsOutputUnmaskingInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ModuleResultsOutputUnmaskingInner} 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 ModuleResultsOutputUnmaskingInner moduleResultsOutputUnmaskingInner = + (ModuleResultsOutputUnmaskingInner) o; + return Objects.equals( + this.cloudSdkCustomFields, moduleResultsOutputUnmaskingInner.cloudSdkCustomFields) + && Objects.equals(this.index, moduleResultsOutputUnmaskingInner.index) + && Objects.equals(this.message, moduleResultsOutputUnmaskingInner.message) + && Objects.equals(this.logprobs, moduleResultsOutputUnmaskingInner.logprobs) + && Objects.equals(this.finishReason, moduleResultsOutputUnmaskingInner.finishReason); + } + + @Override + public int hashCode() { + return Objects.hash(index, message, logprobs, finishReason, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ModuleResultsOutputUnmaskingInner {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" logprobs: ").append(toIndentedString(logprobs)).append("\n"); + sb.append(" finishReason: ").append(toIndentedString(finishReason)).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 + * ModuleResultsOutputUnmaskingInner} instance with all required arguments. + */ + public static Builder create() { + return (index) -> + (message) -> + (finishReason) -> + new ModuleResultsOutputUnmaskingInner() + .index(index) + .message(message) + .finishReason(finishReason); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the index of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param index Index of the choice + * @return The ModuleResultsOutputUnmaskingInner builder. + */ + Builder1 index(@Nonnull final Integer index); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param message The message of this {@link ModuleResultsOutputUnmaskingInner} + * @return The ModuleResultsOutputUnmaskingInner builder. + */ + Builder2 message(@Nonnull final ChatMessage message); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the finishReason of this {@link ModuleResultsOutputUnmaskingInner} instance. + * + * @param finishReason 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 + * @return The ModuleResultsOutputUnmaskingInner instance. + */ + ModuleResultsOutputUnmaskingInner finishReason(@Nonnull final String finishReason); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationConfig.java index 999e0274..9e81bfef 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OrchestrationConfig.java @@ -32,6 +32,12 @@ public class OrchestrationConfig @JsonProperty("module_configurations") private ModuleConfigs moduleConfigurations; + @JsonProperty("stream") + private Boolean stream = false; + + @JsonProperty("stream_options") + private GlobalStreamOptions streamOptions; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -71,6 +77,69 @@ public void setModuleConfigurations(@Nonnull final ModuleConfigs moduleConfigura this.moduleConfigurations = moduleConfigurations; } + /** + * Set the stream of this {@link OrchestrationConfig} instance and return the same instance. + * + * @param stream If true, the response will be streamed back to the client + * @return The same instance of this {@link OrchestrationConfig} class + */ + @Nonnull + public OrchestrationConfig stream(@Nullable final Boolean stream) { + this.stream = stream; + return this; + } + + /** + * If true, the response will be streamed back to the client + * + * @return stream The stream of this {@link OrchestrationConfig} instance. + */ + @Nonnull + public Boolean isStream() { + return stream; + } + + /** + * Set the stream of this {@link OrchestrationConfig} instance. + * + * @param stream If true, the response will be streamed back to the client + */ + public void setStream(@Nullable final Boolean stream) { + this.stream = stream; + } + + /** + * Set the streamOptions of this {@link OrchestrationConfig} instance and return the same + * instance. + * + * @param streamOptions The streamOptions of this {@link OrchestrationConfig} + * @return The same instance of this {@link OrchestrationConfig} class + */ + @Nonnull + public OrchestrationConfig streamOptions(@Nullable final GlobalStreamOptions streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get streamOptions + * + * @return streamOptions The streamOptions of this {@link OrchestrationConfig} instance. + */ + @Nonnull + public GlobalStreamOptions getStreamOptions() { + return streamOptions; + } + + /** + * Set the streamOptions of this {@link OrchestrationConfig} instance. + * + * @param streamOptions The streamOptions of this {@link OrchestrationConfig} + */ + public void setStreamOptions(@Nullable final GlobalStreamOptions streamOptions) { + this.streamOptions = streamOptions; + } + /** * Get the names of the unrecognizable properties of the {@link OrchestrationConfig}. * @@ -120,12 +189,14 @@ public boolean equals(@Nullable final java.lang.Object o) { } final OrchestrationConfig orchestrationConfig = (OrchestrationConfig) o; return Objects.equals(this.cloudSdkCustomFields, orchestrationConfig.cloudSdkCustomFields) - && Objects.equals(this.moduleConfigurations, orchestrationConfig.moduleConfigurations); + && Objects.equals(this.moduleConfigurations, orchestrationConfig.moduleConfigurations) + && Objects.equals(this.stream, orchestrationConfig.stream) + && Objects.equals(this.streamOptions, orchestrationConfig.streamOptions); } @Override public int hashCode() { - return Objects.hash(moduleConfigurations, cloudSdkCustomFields); + return Objects.hash(moduleConfigurations, stream, streamOptions, cloudSdkCustomFields); } @Override @@ -136,6 +207,8 @@ public String toString() { sb.append(" moduleConfigurations: ") .append(toIndentedString(moduleConfigurations)) .append("\n"); + sb.append(" stream: ").append(toIndentedString(stream)).append("\n"); + sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).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/client/model/OutputFilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OutputFilteringConfig.java new file mode 100644 index 00000000..212b55a7 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/OutputFilteringConfig.java @@ -0,0 +1,239 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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; + +/** OutputFilteringConfig */ +// CHECKSTYLE:OFF +public class OutputFilteringConfig +// CHECKSTYLE:ON +{ + @JsonProperty("filters") + private List filters = new ArrayList<>(); + + @JsonProperty("stream_options") + private FilteringStreamOptions streamOptions; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected OutputFilteringConfig() {} + + /** + * Set the filters of this {@link OutputFilteringConfig} instance and return the same instance. + * + * @param filters Configuration for content filtering services that should be used for the given + * filtering step (input filtering or output filtering). + * @return The same instance of this {@link OutputFilteringConfig} class + */ + @Nonnull + public OutputFilteringConfig filters(@Nonnull final List filters) { + this.filters = filters; + return this; + } + + /** + * Add one filters instance to this {@link OutputFilteringConfig}. + * + * @param filtersItem The filters that should be added + * @return The same instance of type {@link OutputFilteringConfig} + */ + @Nonnull + public OutputFilteringConfig addFiltersItem(@Nonnull final FilterConfig filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Configuration for content filtering services that should be used for the given filtering step + * (input filtering or output filtering). + * + * @return filters The filters of this {@link OutputFilteringConfig} instance. + */ + @Nonnull + public List getFilters() { + return filters; + } + + /** + * Set the filters of this {@link OutputFilteringConfig} instance. + * + * @param filters Configuration for content filtering services that should be used for the given + * filtering step (input filtering or output filtering). + */ + public void setFilters(@Nonnull final List filters) { + this.filters = filters; + } + + /** + * Set the streamOptions of this {@link OutputFilteringConfig} instance and return the same + * instance. + * + * @param streamOptions The streamOptions of this {@link OutputFilteringConfig} + * @return The same instance of this {@link OutputFilteringConfig} class + */ + @Nonnull + public OutputFilteringConfig streamOptions(@Nullable final FilteringStreamOptions streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get streamOptions + * + * @return streamOptions The streamOptions of this {@link OutputFilteringConfig} instance. + */ + @Nonnull + public FilteringStreamOptions getStreamOptions() { + return streamOptions; + } + + /** + * Set the streamOptions of this {@link OutputFilteringConfig} instance. + * + * @param streamOptions The streamOptions of this {@link OutputFilteringConfig} + */ + public void setStreamOptions(@Nullable final FilteringStreamOptions streamOptions) { + this.streamOptions = streamOptions; + } + + /** + * Get the names of the unrecognizable properties of the {@link OutputFilteringConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OutputFilteringConfig} 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( + "OutputFilteringConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link OutputFilteringConfig} 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 OutputFilteringConfig outputFilteringConfig = (OutputFilteringConfig) o; + return Objects.equals(this.cloudSdkCustomFields, outputFilteringConfig.cloudSdkCustomFields) + && Objects.equals(this.filters, outputFilteringConfig.filters) + && Objects.equals(this.streamOptions, outputFilteringConfig.streamOptions); + } + + @Override + public int hashCode() { + return Objects.hash(filters, streamOptions, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OutputFilteringConfig {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).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 OutputFilteringConfig} + * instance with all required arguments. + */ + public static Builder create() { + return (filters) -> new OutputFilteringConfig().filters(filters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filters of this {@link OutputFilteringConfig} instance. + * + * @param filters Configuration for content filtering services that should be used for the given + * filtering step (input filtering or output filtering). + * @return The OutputFilteringConfig instance. + */ + OutputFilteringConfig filters(@Nonnull final List filters); + + /** + * Set the filters of this {@link OutputFilteringConfig} instance. + * + * @param filters Configuration for content filtering services that should be used for the given + * filtering step (input filtering or output filtering). + * @return The OutputFilteringConfig instance. + */ + default OutputFilteringConfig filters(@Nonnull final FilterConfig... filters) { + return filters(Arrays.asList(filters)); + } + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java new file mode 100644 index 00000000..aeb4b77e --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchDocumentKeyValueListPair.java @@ -0,0 +1,304 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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 */ +// 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<>(); + + 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/client/model/SearchSelectOptionEnum.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java new file mode 100644 index 00000000..7dc32a73 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/SearchSelectOptionEnum.java @@ -0,0 +1,63 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/client/model/Template.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/Template.java new file mode 100644 index 00000000..97510a2d --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/Template.java @@ -0,0 +1,243 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.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; + +/** Template */ +// CHECKSTYLE:OFF +public class Template +// CHECKSTYLE:ON +{ + @JsonProperty("template") + private List template; + + @JsonProperty("defaults") + private Object defaults; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected Template() {} + + /** + * Set the template of this {@link Template} instance and return the same instance. + * + * @param template 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. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template template(@Nonnull final List template) { + this.template = template; + return this; + } + + /** + * Add one template instance to this {@link Template}. + * + * @param templateItem The template that should be added + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template addTemplateItem(@Nonnull final ChatMessage templateItem) { + if (this.template == null) { + this.template = new ArrayList<>(); + } + this.template.add(templateItem); + return this; + } + + /** + * 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. + * + * @return template The template of this {@link Template} instance. + */ + @Nonnull + public List getTemplate() { + return template; + } + + /** + * Set the template of this {@link Template} instance. + * + * @param template 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. + */ + public void setTemplate(@Nonnull final List template) { + this.template = template; + } + + /** + * Set the defaults of this {@link Template} instance and return the same instance. + * + * @param defaults Optional default values for the template. If a parameter has no default it is + * required. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template defaults(@Nullable final Object defaults) { + this.defaults = defaults; + return this; + } + + /** + * Optional default values for the template. If a parameter has no default it is required. + * + * @return defaults The defaults of this {@link Template} instance. + */ + @Nonnull + public Object getDefaults() { + return defaults; + } + + /** + * Set the defaults of this {@link Template} instance. + * + * @param defaults Optional default values for the template. If a parameter has no default it is + * required. + */ + public void setDefaults(@Nullable final Object defaults) { + this.defaults = defaults; + } + + /** + * Get the names of the unrecognizable properties of the {@link Template}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link Template} 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("Template has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link Template} 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 Template template = (Template) o; + return Objects.equals(this.cloudSdkCustomFields, template.cloudSdkCustomFields) + && Objects.equals(this.template, template.template) + && Objects.equals(this.defaults, template.defaults); + } + + @Override + public int hashCode() { + return Objects.hash(template, defaults, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Template {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" defaults: ").append(toIndentedString(defaults)).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 Template} instance with + * all required arguments. + */ + public static Builder create() { + return (template) -> new Template().template(template); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the template of this {@link Template} instance. + * + * @param template 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. + * @return The Template instance. + */ + Template template(@Nonnull final List template); + + /** + * Set the template of this {@link Template} instance. + * + * @param template 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. + * @return The Template instance. + */ + default Template template(@Nonnull final ChatMessage... template) { + return template(Arrays.asList(template)); + } + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java new file mode 100644 index 00000000..df784015 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRef.java @@ -0,0 +1,168 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TemplateRef */ +// CHECKSTYLE:OFF +public class TemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty("template_ref") + private TemplateRefTemplateRef templateRef; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + 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/client/model/TemplateRefByID.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java new file mode 100644 index 00000000..05072d86 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByID.java @@ -0,0 +1,168 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TemplateRefByID */ +// CHECKSTYLE:OFF +public class TemplateRefByID +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + 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/client/model/TemplateRefByScenarioNameVersion.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java new file mode 100644 index 00000000..01aea275 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefByScenarioNameVersion.java @@ -0,0 +1,276 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** TemplateRefByScenarioNameVersion */ +// CHECKSTYLE:OFF +public class TemplateRefByScenarioNameVersion +// 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<>(); + + 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/client/model/TemplateRefTemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java new file mode 100644 index 00000000..491593b3 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/TemplateRefTemplateRef.java @@ -0,0 +1,169 @@ +/* + * Internal Orchestration Service API + * SAP AI Core - Orchestration Service API + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.orchestration.client.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Reference to a template in the prompt registry by ID or by scenario, name and version */ +// CHECKSTYLE:OFF +public class TemplateRefTemplateRef +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + protected TemplateRefTemplateRef() {} + + /** + * Set the id of this {@link TemplateRefTemplateRef} instance and return the same instance. + * + * @param id ID of the template in prompt registry + * @return The same instance of this {@link TemplateRefTemplateRef} class + */ + @Nonnull + public TemplateRefTemplateRef id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * ID of the template in prompt registry + * + * @return id The id of this {@link TemplateRefTemplateRef} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link TemplateRefTemplateRef} 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 TemplateRefTemplateRef}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link TemplateRefTemplateRef} 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( + "TemplateRefTemplateRef has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link TemplateRefTemplateRef} 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 TemplateRefTemplateRef templateRefTemplateRef = (TemplateRefTemplateRef) o; + return Objects.equals(this.cloudSdkCustomFields, templateRefTemplateRef.cloudSdkCustomFields) + && Objects.equals(this.id, templateRefTemplateRef.id); + } + + @Override + public int hashCode() { + return Objects.hash(id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRefTemplateRef {\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 TemplateRefTemplateRef} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> new TemplateRefTemplateRef().id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link TemplateRefTemplateRef} instance. + * + * @param id ID of the template in prompt registry + * @return The TemplateRefTemplateRef instance. + */ + TemplateRefTemplateRef id(@Nonnull final String id); + } +} diff --git a/orchestration/src/main/resources/spec/orchestration.yaml b/orchestration/src/main/resources/spec/orchestration.yaml index f19aee51..ace7eee1 100644 --- a/orchestration/src/main/resources/spec/orchestration.yaml +++ b/orchestration/src/main/resources/spec/orchestration.yaml @@ -8,7 +8,7 @@ info: version: 0.0.1 servers: - - url: '/v1' + - url: "/v1" tags: - name: Orchestrated Completion @@ -25,18 +25,18 @@ paths: 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" /healthz: get: @@ -44,15 +44,15 @@ paths: - OrchestrationHealthz operationId: orchestration.v1.endpoints.healthz responses: - '200': - description: 'Service is up and running.' + "200": + description: "Service is up and running." content: text/plain: schema: type: string - example: 'OK' - '503': - description: 'Service is unavailable.' + example: "OK" + "503": + description: "Service is unavailable." content: application/json: schema: @@ -60,7 +60,7 @@ paths: properties: status: type: string - example: 'Service Unavailable' + example: "Service Unavailable" components: schemas: @@ -70,23 +70,24 @@ components: - orchestration_config properties: orchestration_config: - $ref: '#/components/schemas/OrchestrationConfig' + $ref: "#/components/schemas/OrchestrationConfig" input_params: type: object example: - groundingInput: 'What is SAP Joule?' - 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 + minItems: 1 items: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" ChatMessage: type: object @@ -99,7 +100,23 @@ components: example: user content: type: string - example: 'What is SAP S/4HANA?' + + ChatDelta: + type: object + required: + - content + properties: + role: + type: string + content: + type: string + default: "" + + # InputParamsEntry: + # oneOf: + # - type: string + # - type: number + # example: "What is SAP S/4HANA?" CompletionPostResponse: type: object @@ -111,11 +128,24 @@ 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" + orchestration_result: + $ref: "#/components/schemas/LLMModuleResult" + + CompletionPostResponseStreaming: + type: object + required: + - request_id + properties: + request_id: + description: ID of the request + type: string module_results: - $ref: '#/components/schemas/ModuleResults' + $ref: "#/components/schemas/ModuleResults" orchestration_result: - $ref: '#/components/schemas/LLMModuleResult' + $ref: "#/components/schemas/LLMModuleResultStreaming" OrchestrationConfig: type: object @@ -123,7 +153,13 @@ components: - 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" ModuleConfigs: type: object @@ -132,15 +168,15 @@ 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' + $ref: "#/components/schemas/GroundingModuleConfig" ModuleResults: description: Results of each module. @@ -148,21 +184,34 @@ components: additionalProperties: false properties: grounding: - $ref: '#/components/schemas/GenericModuleResult' + $ref: "#/components/schemas/GenericModuleResult" templating: - $ref: '#/components/schemas/ChatMessages' + $ref: "#/components/schemas/ChatMessages" 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: - $ref: '#/components/schemas/LLMChoice' + oneOf: + - $ref: "#/components/schemas/LLMChoice" + + GlobalStreamOptions: + description: Options for streaming. Will be ignored if stream is false. + type: object + additionalProperties: false + properties: + chunk_size: + type: integer + description: Number of characters per chunk that post-LLM modules operate on. + default: 100 + minimum: 1 + maximum: 10000 # currently determined by max_size of ACS text records # --- LLM MODULE --- LLMModuleConfig: @@ -173,7 +222,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 @@ -187,7 +236,7 @@ components: model_version: description: Version of the model to use type: string - default: 'latest' + default: "latest" GenericModuleResult: type: object @@ -204,6 +253,11 @@ components: description: Additional data object from the module LLMModuleResult: + description: Output of LLM module. Follows the OpenAI spec. + oneOf: + - $ref: "#/components/schemas/LLMModuleResultSynchronous" + + LLMModuleResultSynchronous: type: object description: Output of LLM module. Follows the OpenAI spec. required: @@ -217,7 +271,7 @@ components: id: type: string description: ID of the response - example: 'chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr' + example: "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr" object: type: string description: Object type @@ -229,18 +283,51 @@ components: model: type: string description: Model name - example: 'gpt-4' + example: "gpt-4" + system_fingerprint: + type: string + description: System fingerprint + example: "fp_44709d6fcb" + choices: + type: array + description: Choices + items: + $ref: "#/components/schemas/LLMChoice" + usage: + $ref: "#/components/schemas/TokenUsage" + + LLMModuleResultStreaming: + type: object + description: Output of LLM module. Follows the OpenAI spec. + required: + - id + - object + - created + - model + - choices + properties: + id: + type: string + description: ID of the response + object: + type: string + description: Object type + created: + type: integer + description: Unix timestamp + model: + type: string + description: Model name system_fingerprint: type: string description: System fingerprint - example: 'fp_44709d6fcb' choices: type: array description: Choices items: - $ref: '#/components/schemas/LLMChoice' + $ref: "#/components/schemas/LLMChoiceStreaming" usage: - $ref: '#/components/schemas/TokenUsage' + $ref: "#/components/schemas/TokenUsage" LLMChoice: type: object @@ -254,7 +341,7 @@ components: description: Index of the choice example: 0 message: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" logprobs: type: object description: Log probabilities @@ -267,6 +354,28 @@ components: 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: + - index + - delta + properties: + index: + type: integer + description: Index of the choice + delta: + $ref: "#/components/schemas/ChatDelta" + logprobs: + type: object + description: Log probabilities + additionalProperties: + type: array + items: + type: number + finish_reason: + type: string + description: Reason for stopping the model + TokenUsage: type: object description: Usage of tokens in the response @@ -291,13 +400,18 @@ components: # --- Templating Module --- TemplatingModuleConfig: + oneOf: + - $ref: "#/components/schemas/Template" + + # --- Templating Module with User Defined Template --- + Template: type: object required: - template properties: template: allOf: - - $ref: '#/components/schemas/ChatMessages' + - $ref: "#/components/schemas/ChatMessages" 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. @@ -305,9 +419,52 @@ components: example: template: - role: user - content: 'How can the features of AI in SAP BTP specifially {{?groundingOutput}}, 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" + + 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: @@ -315,29 +472,57 @@ components: properties: input: allOf: - - $ref: '#/components/schemas/FilteringConfig' + - $ref: "#/components/schemas/InputFilteringConfig" description: List of provider type and filters output: allOf: - - $ref: '#/components/schemas/FilteringConfig' + - $ref: "#/components/schemas/OutputFilteringConfig" description: List of provider type and filters additionalProperties: false - FilteringConfig: + InputFilteringConfig: + type: object + required: + - filters + additionalProperties: false + properties: + filters: + description: Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering). + type: array + minItems: 1 + items: + $ref: "#/components/schemas/FilterConfig" + + OutputFilteringConfig: type: object required: - filters + additionalProperties: false properties: filters: description: Configuration for content filtering services that should be used for the given filtering step (input filtering or output filtering). type: array minItems: 1 items: - $ref: '#/components/schemas/FilterConfig' + $ref: "#/components/schemas/FilterConfig" + stream_options: + $ref: "#/components/schemas/FilteringStreamOptions" + + FilteringStreamOptions: + description: Stream options for output filtering. Will be ignored if stream is false. + type: object + additionalProperties: false + properties: + overlap: + type: integer + description: Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. + default: 0 + minimum: 0 + maximum: 10000 FilterConfig: oneOf: - - $ref: '#/components/schemas/AzureContentSafetyFilterConfig' + - $ref: "#/components/schemas/AzureContentSafetyFilterConfig" AzureContentSafetyFilterConfig: type: object @@ -351,21 +536,21 @@ 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 @@ -387,22 +572,22 @@ 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: + required: - type - method - entities properties: - type: + type: description: Type of masking service provider type: string enum: @@ -418,7 +603,7 @@ components: type: array minItems: 1 items: - $ref: '#/components/schemas/DPIEntityConfig' + $ref: "#/components/schemas/DPIEntityConfig" DPIEntityConfig: type: object @@ -428,7 +613,7 @@ 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 @@ -460,74 +645,162 @@ components: - profile-trade-union - profile-sensitive-data - # --- Grounding Module --- + # --- Grounding Module --- GroundingModuleConfig: type: object required: - - grounding_service + - type + - config properties: - grounding_service: + type: type: string - enum: + anyOf: + - enum: - document_grounding_service + - {} example: document_grounding_service - grounding_service_configuration: + config: type: object required: - - grounding_input_parameters - - grounding_output_parameter + - input_params + - output_param properties: filters: type: array items: - $ref: '#/components/schemas/GroundingFilter' + oneOf: + - $ref: "#/components/schemas/DocumentGroundingFilter" description: Document grounding service filters to be used - grounding_input_parameters: + input_params: type: array items: type: string example: groundingInput description: Contains the input parameters used for grounding input questions - grounding_output_parameter: + output_param: type: string description: Parameter name used for grounding output example: groundingOutput - GroundingFilter: + DocumentGroundingFilter: type: object + required: + - id + - data_repository_type properties: id: - type: string - example: 'string' - search_configuration: - type: object - example: {} + $ref: "#/components/schemas/GroundingFilterId" + search_config: + $ref: "#/components/schemas/GroundingFilterSearchConfiguration" data_repositories: type: array items: type: string - example: ['*'] + title: DataRepositories + description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. + default: + - "*" data_repository_type: type: string - enum: - - vector - - help.sap.com - example: help.sap.com + $ref: "#/components/schemas/DataRepositoryType" + description: Only include DataRepositories with the given type. data_repository_metadata: type: array items: - type: object - example: [] + $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: - type: object - example: [] + $ref: "#/components/schemas/SearchDocumentKeyValueListPair" + title: Documentmetadata + description: Restrict documents considered during search to those annotated with the given metadata. chunk_metadata: type: array items: - type: object - example: [] + $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 + - help.sap.com + - {} + 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 @@ -539,7 +812,7 @@ components: properties: request_id: type: string - example: 'd4a67ea1-2bf9-4df7-8105-d48203ccff76' + example: "d4a67ea1-2bf9-4df7-8105-d48203ccff76" code: type: integer example: 400 @@ -549,9 +822,9 @@ components: 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: @@ -559,10 +832,10 @@ components: 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" diff --git a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/client/OrchestrationUnitTest.java b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/client/OrchestrationUnitTest.java index df4a6234..860684d2 100644 --- a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/client/OrchestrationUnitTest.java +++ b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/client/OrchestrationUnitTest.java @@ -24,14 +24,15 @@ import com.sap.ai.sdk.orchestration.client.model.DPIEntities; import com.sap.ai.sdk.orchestration.client.model.DPIEntityConfig; import com.sap.ai.sdk.orchestration.client.model.FilterConfig; -import com.sap.ai.sdk.orchestration.client.model.FilteringConfig; import com.sap.ai.sdk.orchestration.client.model.FilteringModuleConfig; import com.sap.ai.sdk.orchestration.client.model.GenericModuleResult; +import com.sap.ai.sdk.orchestration.client.model.InputFilteringConfig; import com.sap.ai.sdk.orchestration.client.model.LLMModuleConfig; import com.sap.ai.sdk.orchestration.client.model.MaskingModuleConfig; import com.sap.ai.sdk.orchestration.client.model.MaskingProviderConfig; import com.sap.ai.sdk.orchestration.client.model.ModuleConfigs; import com.sap.ai.sdk.orchestration.client.model.OrchestrationConfig; +import com.sap.ai.sdk.orchestration.client.model.OutputFilteringConfig; import com.sap.ai.sdk.orchestration.client.model.TemplatingModuleConfig; import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; import java.io.IOException; @@ -204,8 +205,8 @@ void templatingBadRequest() { .violence(filterThreshold)); final var filteringConfig = FilteringModuleConfig.create() - .input(FilteringConfig.create().filters(filter)) - .output(FilteringConfig.create().filters(filter)); + .input(InputFilteringConfig.create().filters(filter)) + .output(OutputFilteringConfig.create().filters(filter)); return CompletionPostRequest.create() .orchestrationConfig( diff --git a/orchestration/src/test/resources/filteringLooseRequest.json b/orchestration/src/test/resources/filteringLooseRequest.json index 40c1aa91..3d322128 100644 --- a/orchestration/src/test/resources/filteringLooseRequest.json +++ b/orchestration/src/test/resources/filteringLooseRequest.json @@ -47,7 +47,8 @@ ] } } - } + }, + "stream" : false }, "input_params": { "disclaimer": "```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent." diff --git a/orchestration/src/test/resources/maskingRequest.json b/orchestration/src/test/resources/maskingRequest.json index d0348451..f20020f5 100644 --- a/orchestration/src/test/resources/maskingRequest.json +++ b/orchestration/src/test/resources/maskingRequest.json @@ -32,7 +32,8 @@ } ] } - } + }, + "stream" : false }, "input_params": { "orgCV": "Patrick Morgan +49 (970) 333-3833" diff --git a/orchestration/src/test/resources/messagesHistoryRequest.json b/orchestration/src/test/resources/messagesHistoryRequest.json index 984e8d08..d2cd95e7 100644 --- a/orchestration/src/test/resources/messagesHistoryRequest.json +++ b/orchestration/src/test/resources/messagesHistoryRequest.json @@ -19,7 +19,8 @@ } ] } - } + }, + "stream" : false }, "input_params": {}, "messages_history": [ diff --git a/orchestration/src/test/resources/templatingRequest.json b/orchestration/src/test/resources/templatingRequest.json index 3cde90a4..eb1c4616 100644 --- a/orchestration/src/test/resources/templatingRequest.json +++ b/orchestration/src/test/resources/templatingRequest.json @@ -19,7 +19,8 @@ }, "model_version": "latest" } - } + }, + "stream" : false }, "input_params": { "input": "Reply with 'Orchestration Service is working!' in German" diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java index c84590ba..68ce41a5 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java @@ -11,14 +11,15 @@ import com.sap.ai.sdk.orchestration.client.model.DPIEntities; import com.sap.ai.sdk.orchestration.client.model.DPIEntityConfig; import com.sap.ai.sdk.orchestration.client.model.FilterConfig; -import com.sap.ai.sdk.orchestration.client.model.FilteringConfig; import com.sap.ai.sdk.orchestration.client.model.FilteringModuleConfig; +import com.sap.ai.sdk.orchestration.client.model.InputFilteringConfig; import com.sap.ai.sdk.orchestration.client.model.LLMModuleConfig; import com.sap.ai.sdk.orchestration.client.model.MaskingModuleConfig; import com.sap.ai.sdk.orchestration.client.model.MaskingProviderConfig; import com.sap.ai.sdk.orchestration.client.model.MaskingProviderConfig.MethodEnum; import com.sap.ai.sdk.orchestration.client.model.ModuleConfigs; import com.sap.ai.sdk.orchestration.client.model.OrchestrationConfig; +import com.sap.ai.sdk.orchestration.client.model.OutputFilteringConfig; import com.sap.ai.sdk.orchestration.client.model.TemplatingModuleConfig; import java.util.List; import java.util.Map; @@ -83,8 +84,8 @@ class OrchestrationController { final var filteringConfig = FilteringModuleConfig.create() - .input(FilteringConfig.create().filters(List.of(filter))) - .output(FilteringConfig.create().filters(List.of(filter))); + .input(InputFilteringConfig.create().filters(List.of(filter))) + .output(OutputFilteringConfig.create().filters(List.of(filter))); return CompletionPostRequest.create() .orchestrationConfig(