diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AfterLastRoleTargetSelector.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AfterLastRoleTargetSelector.java deleted file mode 100644 index 40a851bbd..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AfterLastRoleTargetSelector.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import 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; - -/** AfterLastRoleTargetSelector */ -// CHECKSTYLE:OFF -public class AfterLastRoleTargetSelector implements InputFilterTargetSelector -// CHECKSTYLE:ON -{ - /** - * Filter all messages after the last message with this role in the combined message list. If no - * message is scoped after applying this filter, then the filter is skipped. - */ - public enum AfterLastRoleEnum { - /** The SYSTEM option of this AfterLastRoleTargetSelector */ - SYSTEM("system"), - - /** The USER option of this AfterLastRoleTargetSelector */ - USER("user"), - - /** The ASSISTANT option of this AfterLastRoleTargetSelector */ - ASSISTANT("assistant"), - - /** The DEVELOPER option of this AfterLastRoleTargetSelector */ - DEVELOPER("developer"), - - /** The TOOL option of this AfterLastRoleTargetSelector */ - TOOL("tool"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this AfterLastRoleTargetSelector */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - AfterLastRoleEnum(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 AfterLastRoleTargetSelector - */ - @JsonCreator - @Nonnull - public static AfterLastRoleEnum fromValue(@Nonnull final String value) { - for (AfterLastRoleEnum b : AfterLastRoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("after_last_role") - private AfterLastRoleEnum afterLastRole; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AfterLastRoleTargetSelector. */ - protected AfterLastRoleTargetSelector() {} - - /** - * Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance and return the same - * instance. - * - * @param afterLastRole Filter all messages after the last message with this role in the combined - * message list. If no message is scoped after applying this filter, then the filter is - * skipped. - * @return The same instance of this {@link AfterLastRoleTargetSelector} class - */ - @Nonnull - public AfterLastRoleTargetSelector afterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole) { - this.afterLastRole = afterLastRole; - return this; - } - - /** - * Filter all messages after the last message with this role in the combined message list. If no - * message is scoped after applying this filter, then the filter is skipped. - * - * @return afterLastRole The afterLastRole of this {@link AfterLastRoleTargetSelector} instance. - */ - @Nonnull - public AfterLastRoleEnum getAfterLastRole() { - return afterLastRole; - } - - /** - * Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance. - * - * @param afterLastRole Filter all messages after the last message with this role in the combined - * message list. If no message is scoped after applying this filter, then the filter is - * skipped. - */ - public void setAfterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole) { - this.afterLastRole = afterLastRole; - } - - /** - * Get the names of the unrecognizable properties of the {@link AfterLastRoleTargetSelector}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AfterLastRoleTargetSelector} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @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 - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AfterLastRoleTargetSelector has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AfterLastRoleTargetSelector} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (afterLastRole != null) declaredFields.put("afterLastRole", afterLastRole); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AfterLastRoleTargetSelector} 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 AfterLastRoleTargetSelector afterLastRoleTargetSelector = (AfterLastRoleTargetSelector) o; - return Objects.equals( - this.cloudSdkCustomFields, afterLastRoleTargetSelector.cloudSdkCustomFields) - && Objects.equals(this.afterLastRole, afterLastRoleTargetSelector.afterLastRole); - } - - @Override - public int hashCode() { - return Objects.hash(afterLastRole, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AfterLastRoleTargetSelector {\n"); - sb.append(" afterLastRole: ").append(toIndentedString(afterLastRole)).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 - * AfterLastRoleTargetSelector} instance with all required arguments. - */ - public static Builder create() { - return (afterLastRole) -> new AfterLastRoleTargetSelector().afterLastRole(afterLastRole); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance. - * - * @param afterLastRole Filter all messages after the last message with this role in the - * combined message list. If no message is scoped after applying this filter, then the - * filter is skipped. - * @return The AfterLastRoleTargetSelector instance. - */ - AfterLastRoleTargetSelector afterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyInputFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyInputFilterConfig.java index c9c00481e..9214a7ad6 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyInputFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyInputFilterConfig.java @@ -90,9 +90,6 @@ public static TypeEnum fromValue(@Nonnull final String value) { @JsonProperty("config") private AzureContentSafetyInput config; - @JsonProperty("target_selector") - private InputFilterTargetSelector targetSelector; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -164,40 +161,6 @@ public void setConfig(@Nullable final AzureContentSafetyInput config) { this.config = config; } - /** - * Set the targetSelector of this {@link AzureContentSafetyInputFilterConfig} instance and return - * the same instance. - * - * @param targetSelector The targetSelector of this {@link AzureContentSafetyInputFilterConfig} - * @return The same instance of this {@link AzureContentSafetyInputFilterConfig} class - */ - @Nonnull - public AzureContentSafetyInputFilterConfig targetSelector( - @Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - return this; - } - - /** - * Get targetSelector - * - * @return targetSelector The targetSelector of this {@link AzureContentSafetyInputFilterConfig} - * instance. - */ - @Nonnull - public InputFilterTargetSelector getTargetSelector() { - return targetSelector; - } - - /** - * Set the targetSelector of this {@link AzureContentSafetyInputFilterConfig} instance. - * - * @param targetSelector The targetSelector of this {@link AzureContentSafetyInputFilterConfig} - */ - public void setTargetSelector(@Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - } - /** * Get the names of the unrecognizable properties of the {@link * AzureContentSafetyInputFilterConfig}. @@ -241,7 +204,6 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (type != null) declaredFields.put("type", type); if (config != null) declaredFields.put("config", config); - if (targetSelector != null) declaredFields.put("targetSelector", targetSelector); return declaredFields; } @@ -271,13 +233,12 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals( this.cloudSdkCustomFields, azureContentSafetyInputFilterConfig.cloudSdkCustomFields) && Objects.equals(this.type, azureContentSafetyInputFilterConfig.type) - && Objects.equals(this.config, azureContentSafetyInputFilterConfig.config) - && Objects.equals(this.targetSelector, azureContentSafetyInputFilterConfig.targetSelector); + && Objects.equals(this.config, azureContentSafetyInputFilterConfig.config); } @Override public int hashCode() { - return Objects.hash(type, config, targetSelector, cloudSdkCustomFields); + return Objects.hash(type, config, cloudSdkCustomFields); } @Override @@ -287,7 +248,6 @@ public String toString() { sb.append("class AzureContentSafetyInputFilterConfig {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" targetSelector: ").append(toIndentedString(targetSelector)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41.java deleted file mode 100644 index 7ff1474da..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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; - -/** Configuration for IBM Granite Guardian 4.1 filter provider. */ -// CHECKSTYLE:OFF -public class GraniteGuardian41 -// CHECKSTYLE:ON -{ - @JsonProperty("enable_reasoning") - private Boolean enableReasoning = false; - - @JsonProperty("categories") - private GraniteGuardian41Categories categories; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for GraniteGuardian41. */ - protected GraniteGuardian41() {} - - /** - * Set the enableReasoning of this {@link GraniteGuardian41} instance and return the same - * instance. - * - * @param enableReasoning Enable reasoning (think) mode for Granite Guardian. Applies to every - * configured category. Returns reasoning content when enabled, e.g. 'harm': - * {'verdict': true, 'reasoning': '...'} - * @return The same instance of this {@link GraniteGuardian41} class - */ - @Nonnull - public GraniteGuardian41 enableReasoning(@Nullable final Boolean enableReasoning) { - this.enableReasoning = enableReasoning; - return this; - } - - /** - * Enable reasoning (think) mode for Granite Guardian. Applies to every configured category. - * Returns reasoning content when enabled, e.g. 'harm': {'verdict': true, - * 'reasoning': '...'} - * - * @return enableReasoning The enableReasoning of this {@link GraniteGuardian41} instance. - */ - @Nonnull - public Boolean isEnableReasoning() { - return enableReasoning; - } - - /** - * Set the enableReasoning of this {@link GraniteGuardian41} instance. - * - * @param enableReasoning Enable reasoning (think) mode for Granite Guardian. Applies to every - * configured category. Returns reasoning content when enabled, e.g. 'harm': - * {'verdict': true, 'reasoning': '...'} - */ - public void setEnableReasoning(@Nullable final Boolean enableReasoning) { - this.enableReasoning = enableReasoning; - } - - /** - * Set the categories of this {@link GraniteGuardian41} instance and return the same instance. - * - * @param categories The categories of this {@link GraniteGuardian41} - * @return The same instance of this {@link GraniteGuardian41} class - */ - @Nonnull - public GraniteGuardian41 categories(@Nonnull final GraniteGuardian41Categories categories) { - this.categories = categories; - return this; - } - - /** - * Get categories - * - * @return categories The categories of this {@link GraniteGuardian41} instance. - */ - @Nonnull - public GraniteGuardian41Categories getCategories() { - return categories; - } - - /** - * Set the categories of this {@link GraniteGuardian41} instance. - * - * @param categories The categories of this {@link GraniteGuardian41} - */ - public void setCategories(@Nonnull final GraniteGuardian41Categories categories) { - this.categories = categories; - } - - /** - * Get the names of the unrecognizable properties of the {@link GraniteGuardian41}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GraniteGuardian41} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @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 - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("GraniteGuardian41 has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GraniteGuardian41} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (enableReasoning != null) declaredFields.put("enableReasoning", enableReasoning); - if (categories != null) declaredFields.put("categories", categories); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GraniteGuardian41} 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 GraniteGuardian41 graniteGuardian41 = (GraniteGuardian41) o; - return Objects.equals(this.cloudSdkCustomFields, graniteGuardian41.cloudSdkCustomFields) - && Objects.equals(this.enableReasoning, graniteGuardian41.enableReasoning) - && Objects.equals(this.categories, graniteGuardian41.categories); - } - - @Override - public int hashCode() { - return Objects.hash(enableReasoning, categories, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GraniteGuardian41 {\n"); - sb.append(" enableReasoning: ").append(toIndentedString(enableReasoning)).append("\n"); - sb.append(" categories: ").append(toIndentedString(categories)).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 GraniteGuardian41} - * instance with all required arguments. - */ - public static Builder create() { - return (categories) -> new GraniteGuardian41().categories(categories); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the categories of this {@link GraniteGuardian41} instance. - * - * @param categories The categories of this {@link GraniteGuardian41} - * @return The GraniteGuardian41 instance. - */ - GraniteGuardian41 categories(@Nonnull final GraniteGuardian41Categories categories); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41Categories.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41Categories.java deleted file mode 100644 index afdbb2183..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardian41Categories.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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; - -/** - * Content criteria to evaluate. Note: Granite Guardian requires separate calls for each configured - * content category. Recommendation: Use only `harm` catch all content category. - */ -// CHECKSTYLE:OFF -public class GraniteGuardian41Categories -// CHECKSTYLE:ON -{ - @JsonProperty("harm") - private Boolean harm; - - @JsonProperty("social_bias") - private Boolean socialBias; - - @JsonProperty("jailbreak") - private Boolean jailbreak; - - @JsonProperty("violence") - private Boolean violence; - - @JsonProperty("profanity") - private Boolean profanity; - - @JsonProperty("sexual_content") - private Boolean sexualContent; - - @JsonProperty("unethical_behavior") - private Boolean unethicalBehavior; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for GraniteGuardian41Categories. */ - protected GraniteGuardian41Categories() {} - - /** - * Set the harm of this {@link GraniteGuardian41Categories} instance and return the same instance. - * - * @param harm Catch-all criterion for generally harmful content. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories harm(@Nullable final Boolean harm) { - this.harm = harm; - return this; - } - - /** - * Catch-all criterion for generally harmful content. - * - * @return harm The harm of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isHarm() { - return harm; - } - - /** - * Set the harm of this {@link GraniteGuardian41Categories} instance. - * - * @param harm Catch-all criterion for generally harmful content. - */ - public void setHarm(@Nullable final Boolean harm) { - this.harm = harm; - } - - /** - * Set the socialBias of this {@link GraniteGuardian41Categories} instance and return the same - * instance. - * - * @param socialBias Detect prejudice or discrimination based on identity or protected - * characteristics. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories socialBias(@Nullable final Boolean socialBias) { - this.socialBias = socialBias; - return this; - } - - /** - * Detect prejudice or discrimination based on identity or protected characteristics. - * - * @return socialBias The socialBias of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isSocialBias() { - return socialBias; - } - - /** - * Set the socialBias of this {@link GraniteGuardian41Categories} instance. - * - * @param socialBias Detect prejudice or discrimination based on identity or protected - * characteristics. - */ - public void setSocialBias(@Nullable final Boolean socialBias) { - this.socialBias = socialBias; - } - - /** - * Set the jailbreak of this {@link GraniteGuardian41Categories} instance and return the same - * instance. - * - * @param jailbreak Detect attempts to manipulate the model into producing harmful or otherwise - * undesired outputs. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories jailbreak(@Nullable final Boolean jailbreak) { - this.jailbreak = jailbreak; - return this; - } - - /** - * Detect attempts to manipulate the model into producing harmful or otherwise undesired outputs. - * - * @return jailbreak The jailbreak of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isJailbreak() { - return jailbreak; - } - - /** - * Set the jailbreak of this {@link GraniteGuardian41Categories} instance. - * - * @param jailbreak Detect attempts to manipulate the model into producing harmful or otherwise - * undesired outputs. - */ - public void setJailbreak(@Nullable final Boolean jailbreak) { - this.jailbreak = jailbreak; - } - - /** - * Set the violence of this {@link GraniteGuardian41Categories} instance and return the same - * instance. - * - * @param violence Detect content promoting or depicting physical, mental, or sexual harm. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories violence(@Nullable final Boolean violence) { - this.violence = violence; - return this; - } - - /** - * Detect content promoting or depicting physical, mental, or sexual harm. - * - * @return violence The violence of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isViolence() { - return violence; - } - - /** - * Set the violence of this {@link GraniteGuardian41Categories} instance. - * - * @param violence Detect content promoting or depicting physical, mental, or sexual harm. - */ - public void setViolence(@Nullable final Boolean violence) { - this.violence = violence; - } - - /** - * Set the profanity of this {@link GraniteGuardian41Categories} instance and return the same - * instance. - * - * @param profanity Detect offensive language or insults. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories profanity(@Nullable final Boolean profanity) { - this.profanity = profanity; - return this; - } - - /** - * Detect offensive language or insults. - * - * @return profanity The profanity of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isProfanity() { - return profanity; - } - - /** - * Set the profanity of this {@link GraniteGuardian41Categories} instance. - * - * @param profanity Detect offensive language or insults. - */ - public void setProfanity(@Nullable final Boolean profanity) { - this.profanity = profanity; - } - - /** - * Set the sexualContent of this {@link GraniteGuardian41Categories} instance and return the same - * instance. - * - * @param sexualContent Detect explicit or suggestive material of a sexual nature. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories sexualContent(@Nullable final Boolean sexualContent) { - this.sexualContent = sexualContent; - return this; - } - - /** - * Detect explicit or suggestive material of a sexual nature. - * - * @return sexualContent The sexualContent of this {@link GraniteGuardian41Categories} instance. - */ - @Nonnull - public Boolean isSexualContent() { - return sexualContent; - } - - /** - * Set the sexualContent of this {@link GraniteGuardian41Categories} instance. - * - * @param sexualContent Detect explicit or suggestive material of a sexual nature. - */ - public void setSexualContent(@Nullable final Boolean sexualContent) { - this.sexualContent = sexualContent; - } - - /** - * Set the unethicalBehavior of this {@link GraniteGuardian41Categories} instance and return the - * same instance. - * - * @param unethicalBehavior Detect content describing actions that violate moral or legal - * standards. - * @return The same instance of this {@link GraniteGuardian41Categories} class - */ - @Nonnull - public GraniteGuardian41Categories unethicalBehavior(@Nullable final Boolean unethicalBehavior) { - this.unethicalBehavior = unethicalBehavior; - return this; - } - - /** - * Detect content describing actions that violate moral or legal standards. - * - * @return unethicalBehavior The unethicalBehavior of this {@link GraniteGuardian41Categories} - * instance. - */ - @Nonnull - public Boolean isUnethicalBehavior() { - return unethicalBehavior; - } - - /** - * Set the unethicalBehavior of this {@link GraniteGuardian41Categories} instance. - * - * @param unethicalBehavior Detect content describing actions that violate moral or legal - * standards. - */ - public void setUnethicalBehavior(@Nullable final Boolean unethicalBehavior) { - this.unethicalBehavior = unethicalBehavior; - } - - /** - * Get the names of the unrecognizable properties of the {@link GraniteGuardian41Categories}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GraniteGuardian41Categories} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @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 - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "GraniteGuardian41Categories has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GraniteGuardian41Categories} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (harm != null) declaredFields.put("harm", harm); - if (socialBias != null) declaredFields.put("socialBias", socialBias); - if (jailbreak != null) declaredFields.put("jailbreak", jailbreak); - if (violence != null) declaredFields.put("violence", violence); - if (profanity != null) declaredFields.put("profanity", profanity); - if (sexualContent != null) declaredFields.put("sexualContent", sexualContent); - if (unethicalBehavior != null) declaredFields.put("unethicalBehavior", unethicalBehavior); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GraniteGuardian41Categories} 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 GraniteGuardian41Categories graniteGuardian41Categories = (GraniteGuardian41Categories) o; - return Objects.equals( - this.cloudSdkCustomFields, graniteGuardian41Categories.cloudSdkCustomFields) - && Objects.equals(this.harm, graniteGuardian41Categories.harm) - && Objects.equals(this.socialBias, graniteGuardian41Categories.socialBias) - && Objects.equals(this.jailbreak, graniteGuardian41Categories.jailbreak) - && Objects.equals(this.violence, graniteGuardian41Categories.violence) - && Objects.equals(this.profanity, graniteGuardian41Categories.profanity) - && Objects.equals(this.sexualContent, graniteGuardian41Categories.sexualContent) - && Objects.equals(this.unethicalBehavior, graniteGuardian41Categories.unethicalBehavior); - } - - @Override - public int hashCode() { - return Objects.hash( - harm, - socialBias, - jailbreak, - violence, - profanity, - sexualContent, - unethicalBehavior, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GraniteGuardian41Categories {\n"); - sb.append(" harm: ").append(toIndentedString(harm)).append("\n"); - sb.append(" socialBias: ").append(toIndentedString(socialBias)).append("\n"); - sb.append(" jailbreak: ").append(toIndentedString(jailbreak)).append("\n"); - sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); - sb.append(" profanity: ").append(toIndentedString(profanity)).append("\n"); - sb.append(" sexualContent: ").append(toIndentedString(sexualContent)).append("\n"); - sb.append(" unethicalBehavior: ").append(toIndentedString(unethicalBehavior)).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 GraniteGuardian41Categories} instance. No arguments are required. */ - public static GraniteGuardian41Categories create() { - return new GraniteGuardian41Categories(); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardianFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardianFilterConfig.java deleted file mode 100644 index cf98e5b74..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GraniteGuardianFilterConfig.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import 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; - -/** Filter configuration for IBM Granite Guardian filter provider. */ -// CHECKSTYLE:OFF -public class GraniteGuardianFilterConfig implements InputFilterConfig, OutputFilterConfig -// CHECKSTYLE:ON -{ - /** Name of the filter provider type */ - public enum TypeEnum { - /** The GRANITE_GUARDIAN_4_1 option of this GraniteGuardianFilterConfig */ - GRANITE_GUARDIAN_4_1("granite_guardian_4_1"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this GraniteGuardianFilterConfig */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type GraniteGuardianFilterConfig - */ - @JsonCreator - @Nonnull - 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; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("config") - private GraniteGuardian41 config; - - @JsonProperty("target_selector") - private InputFilterTargetSelector targetSelector; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for GraniteGuardianFilterConfig. */ - protected GraniteGuardianFilterConfig() {} - - /** - * Set the type of this {@link GraniteGuardianFilterConfig} instance and return the same instance. - * - * @param type Name of the filter provider type - * @return The same instance of this {@link GraniteGuardianFilterConfig} class - */ - @Nonnull - public GraniteGuardianFilterConfig type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * Name of the filter provider type - * - * @return type The type of this {@link GraniteGuardianFilterConfig} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link GraniteGuardianFilterConfig} instance. - * - * @param type Name of the filter provider type - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the config of this {@link GraniteGuardianFilterConfig} instance and return the same - * instance. - * - * @param config The config of this {@link GraniteGuardianFilterConfig} - * @return The same instance of this {@link GraniteGuardianFilterConfig} class - */ - @Nonnull - public GraniteGuardianFilterConfig config(@Nonnull final GraniteGuardian41 config) { - this.config = config; - return this; - } - - /** - * Get config - * - * @return config The config of this {@link GraniteGuardianFilterConfig} instance. - */ - @Nonnull - public GraniteGuardian41 getConfig() { - return config; - } - - /** - * Set the config of this {@link GraniteGuardianFilterConfig} instance. - * - * @param config The config of this {@link GraniteGuardianFilterConfig} - */ - public void setConfig(@Nonnull final GraniteGuardian41 config) { - this.config = config; - } - - /** - * Set the targetSelector of this {@link GraniteGuardianFilterConfig} instance and return the same - * instance. - * - * @param targetSelector The targetSelector of this {@link GraniteGuardianFilterConfig} - * @return The same instance of this {@link GraniteGuardianFilterConfig} class - */ - @Nonnull - public GraniteGuardianFilterConfig targetSelector( - @Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - return this; - } - - /** - * Get targetSelector - * - * @return targetSelector The targetSelector of this {@link GraniteGuardianFilterConfig} instance. - */ - @Nonnull - public InputFilterTargetSelector getTargetSelector() { - return targetSelector; - } - - /** - * Set the targetSelector of this {@link GraniteGuardianFilterConfig} instance. - * - * @param targetSelector The targetSelector of this {@link GraniteGuardianFilterConfig} - */ - public void setTargetSelector(@Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - } - - /** - * Get the names of the unrecognizable properties of the {@link GraniteGuardianFilterConfig}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GraniteGuardianFilterConfig} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @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 - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "GraniteGuardianFilterConfig has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GraniteGuardianFilterConfig} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (config != null) declaredFields.put("config", config); - if (targetSelector != null) declaredFields.put("targetSelector", targetSelector); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GraniteGuardianFilterConfig} 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 GraniteGuardianFilterConfig graniteGuardianFilterConfig = (GraniteGuardianFilterConfig) o; - return Objects.equals( - this.cloudSdkCustomFields, graniteGuardianFilterConfig.cloudSdkCustomFields) - && Objects.equals(this.type, graniteGuardianFilterConfig.type) - && Objects.equals(this.config, graniteGuardianFilterConfig.config) - && Objects.equals(this.targetSelector, graniteGuardianFilterConfig.targetSelector); - } - - @Override - public int hashCode() { - return Objects.hash(type, config, targetSelector, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GraniteGuardianFilterConfig {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" targetSelector: ").append(toIndentedString(targetSelector)).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 - * GraniteGuardianFilterConfig} instance with all required arguments. - */ - public static Builder create() { - return (type) -> (config) -> new GraniteGuardianFilterConfig().type(type).config(config); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link GraniteGuardianFilterConfig} instance. - * - * @param type Name of the filter provider type - * @return The GraniteGuardianFilterConfig builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the config of this {@link GraniteGuardianFilterConfig} instance. - * - * @param config The config of this {@link GraniteGuardianFilterConfig} - * @return The GraniteGuardianFilterConfig instance. - */ - GraniteGuardianFilterConfig config(@Nonnull final GraniteGuardian41 config); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterConfig.java index c0341d223..4994e9809 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterConfig.java @@ -18,7 +18,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = AzureContentSafetyInputFilterConfig.class), - @JsonSubTypes.Type(value = GraniteGuardianFilterConfig.class), @JsonSubTypes.Type(value = LlamaGuard38bFilterConfig.class), }) public interface InputFilterConfig {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterTargetSelector.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterTargetSelector.java deleted file mode 100644 index 5eb25b063..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilterTargetSelector.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** - * Selector for scoping input filtering to a subset of the combined message list (messages_history - * prepended to template). If not present, all input content is filtered. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) -@JsonSubTypes({ - @JsonSubTypes.Type(value = AfterLastRoleTargetSelector.class), - @JsonSubTypes.Type(value = LastMessagesTargetSelector.class), -}) -public interface InputFilterTargetSelector {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModelDetails.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModelDetails.java index b8b8b0216..20cc34ea4 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModelDetails.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModelDetails.java @@ -47,9 +47,6 @@ public class LLMModelDetails @JsonProperty("max_retries") private Integer maxRetries = 2; - @JsonProperty("drop_unsupported_params") - private Boolean dropUnsupportedParams = true; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -242,53 +239,6 @@ public void setMaxRetries(@Nullable final Integer maxRetries) { this.maxRetries = maxRetries; } - /** - * Set the dropUnsupportedParams of this {@link LLMModelDetails} instance and return the same - * instance. - * - * @param dropUnsupportedParams Controls behaviour when Chat Completions parameters not supported - * by the Responses API are present in the request. Only applies to models that use the - * Responses API (responsesApiOnly: true in the model registry). When true (default): - * unsupported params are silently dropped and reported in the - * X-Orchestration-Dropped-Model-Params response header. When false: any unsupported parameter - * causes a 400 error with an actionable message. - * @return The same instance of this {@link LLMModelDetails} class - */ - @Nonnull - public LLMModelDetails dropUnsupportedParams(@Nullable final Boolean dropUnsupportedParams) { - this.dropUnsupportedParams = dropUnsupportedParams; - return this; - } - - /** - * Controls behaviour when Chat Completions parameters not supported by the Responses API are - * present in the request. Only applies to models that use the Responses API (responsesApiOnly: - * true in the model registry). When true (default): unsupported params are silently dropped and - * reported in the X-Orchestration-Dropped-Model-Params response header. When false: any - * unsupported parameter causes a 400 error with an actionable message. - * - * @return dropUnsupportedParams The dropUnsupportedParams of this {@link LLMModelDetails} - * instance. - */ - @Nonnull - public Boolean isDropUnsupportedParams() { - return dropUnsupportedParams; - } - - /** - * Set the dropUnsupportedParams of this {@link LLMModelDetails} instance. - * - * @param dropUnsupportedParams Controls behaviour when Chat Completions parameters not supported - * by the Responses API are present in the request. Only applies to models that use the - * Responses API (responsesApiOnly: true in the model registry). When true (default): - * unsupported params are silently dropped and reported in the - * X-Orchestration-Dropped-Model-Params response header. When false: any unsupported parameter - * causes a 400 error with an actionable message. - */ - public void setDropUnsupportedParams(@Nullable final Boolean dropUnsupportedParams) { - this.dropUnsupportedParams = dropUnsupportedParams; - } - /** * Get the names of the unrecognizable properties of the {@link LLMModelDetails}. * @@ -332,8 +282,6 @@ public Map toMap() { if (params != null) declaredFields.put("params", params); if (timeout != null) declaredFields.put("timeout", timeout); if (maxRetries != null) declaredFields.put("maxRetries", maxRetries); - if (dropUnsupportedParams != null) - declaredFields.put("dropUnsupportedParams", dropUnsupportedParams); return declaredFields; } @@ -363,14 +311,12 @@ public boolean equals(@Nullable final java.lang.Object o) { && Objects.equals(this.version, llMModelDetails.version) && Objects.equals(this.params, llMModelDetails.params) && Objects.equals(this.timeout, llMModelDetails.timeout) - && Objects.equals(this.maxRetries, llMModelDetails.maxRetries) - && Objects.equals(this.dropUnsupportedParams, llMModelDetails.dropUnsupportedParams); + && Objects.equals(this.maxRetries, llMModelDetails.maxRetries); } @Override public int hashCode() { - return Objects.hash( - name, version, params, timeout, maxRetries, dropUnsupportedParams, cloudSdkCustomFields); + return Objects.hash(name, version, params, timeout, maxRetries, cloudSdkCustomFields); } @Override @@ -383,9 +329,6 @@ public String toString() { sb.append(" params: ").append(toIndentedString(params)).append("\n"); sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); - sb.append(" dropUnsupportedParams: ") - .append(toIndentedString(dropUnsupportedParams)) - .append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LastMessagesTargetSelector.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LastMessagesTargetSelector.java deleted file mode 100644 index 72f140729..000000000 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LastMessagesTargetSelector.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Orchestration v2 - * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.orchestration.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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; - -/** LastMessagesTargetSelector */ -// CHECKSTYLE:OFF -public class LastMessagesTargetSelector implements InputFilterTargetSelector -// CHECKSTYLE:ON -{ - @JsonProperty("last_messages") - private Integer lastMessages; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for LastMessagesTargetSelector. */ - protected LastMessagesTargetSelector() {} - - /** - * Set the lastMessages of this {@link LastMessagesTargetSelector} instance and return the same - * instance. - * - * @param lastMessages Number of messages from the end of the combined message list to include in - * filtering. Must be >= 1 (0 is not allowed and returns 400 Bad Request). If - * specified value is larger than the combined message list length, all messages are filtered. - * Minimum: 1 - * @return The same instance of this {@link LastMessagesTargetSelector} class - */ - @Nonnull - public LastMessagesTargetSelector lastMessages(@Nonnull final Integer lastMessages) { - this.lastMessages = lastMessages; - return this; - } - - /** - * Number of messages from the end of the combined message list to include in filtering. Must be - * >= 1 (0 is not allowed and returns 400 Bad Request). If specified value is larger than - * the combined message list length, all messages are filtered. minimum: 1 - * - * @return lastMessages The lastMessages of this {@link LastMessagesTargetSelector} instance. - */ - @Nonnull - public Integer getLastMessages() { - return lastMessages; - } - - /** - * Set the lastMessages of this {@link LastMessagesTargetSelector} instance. - * - * @param lastMessages Number of messages from the end of the combined message list to include in - * filtering. Must be >= 1 (0 is not allowed and returns 400 Bad Request). If - * specified value is larger than the combined message list length, all messages are filtered. - * Minimum: 1 - */ - public void setLastMessages(@Nonnull final Integer lastMessages) { - this.lastMessages = lastMessages; - } - - /** - * Get the names of the unrecognizable properties of the {@link LastMessagesTargetSelector}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link LastMessagesTargetSelector} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @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 - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "LastMessagesTargetSelector has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link LastMessagesTargetSelector} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (lastMessages != null) declaredFields.put("lastMessages", lastMessages); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link LastMessagesTargetSelector} 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 LastMessagesTargetSelector lastMessagesTargetSelector = (LastMessagesTargetSelector) o; - return Objects.equals( - this.cloudSdkCustomFields, lastMessagesTargetSelector.cloudSdkCustomFields) - && Objects.equals(this.lastMessages, lastMessagesTargetSelector.lastMessages); - } - - @Override - public int hashCode() { - return Objects.hash(lastMessages, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class LastMessagesTargetSelector {\n"); - sb.append(" lastMessages: ").append(toIndentedString(lastMessages)).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 - * LastMessagesTargetSelector} instance with all required arguments. - */ - public static Builder create() { - return (lastMessages) -> new LastMessagesTargetSelector().lastMessages(lastMessages); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the lastMessages of this {@link LastMessagesTargetSelector} instance. - * - * @param lastMessages Number of messages from the end of the combined message list to include - * in filtering. Must be >= 1 (0 is not allowed and returns 400 Bad Request). If - * specified value is larger than the combined message list length, all messages are - * filtered. - * @return The LastMessagesTargetSelector instance. - */ - LastMessagesTargetSelector lastMessages(@Nonnull final Integer lastMessages); - } -} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java index 28dab5030..0ef54e84d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java @@ -95,9 +95,6 @@ public static TypeEnum fromValue(@Nonnull final String value) { @JsonProperty("config") private LlamaGuard38b config; - @JsonProperty("target_selector") - private InputFilterTargetSelector targetSelector; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -168,39 +165,6 @@ public void setConfig(@Nonnull final LlamaGuard38b config) { this.config = config; } - /** - * Set the targetSelector of this {@link LlamaGuard38bFilterConfig} instance and return the same - * instance. - * - * @param targetSelector The targetSelector of this {@link LlamaGuard38bFilterConfig} - * @return The same instance of this {@link LlamaGuard38bFilterConfig} class - */ - @Nonnull - public LlamaGuard38bFilterConfig targetSelector( - @Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - return this; - } - - /** - * Get targetSelector - * - * @return targetSelector The targetSelector of this {@link LlamaGuard38bFilterConfig} instance. - */ - @Nonnull - public InputFilterTargetSelector getTargetSelector() { - return targetSelector; - } - - /** - * Set the targetSelector of this {@link LlamaGuard38bFilterConfig} instance. - * - * @param targetSelector The targetSelector of this {@link LlamaGuard38bFilterConfig} - */ - public void setTargetSelector(@Nullable final InputFilterTargetSelector targetSelector) { - this.targetSelector = targetSelector; - } - /** * Get the names of the unrecognizable properties of the {@link LlamaGuard38bFilterConfig}. * @@ -242,7 +206,6 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (type != null) declaredFields.put("type", type); if (config != null) declaredFields.put("config", config); - if (targetSelector != null) declaredFields.put("targetSelector", targetSelector); return declaredFields; } @@ -269,13 +232,12 @@ public boolean equals(@Nullable final java.lang.Object o) { final LlamaGuard38bFilterConfig llamaGuard38bFilterConfig = (LlamaGuard38bFilterConfig) o; return Objects.equals(this.cloudSdkCustomFields, llamaGuard38bFilterConfig.cloudSdkCustomFields) && Objects.equals(this.type, llamaGuard38bFilterConfig.type) - && Objects.equals(this.config, llamaGuard38bFilterConfig.config) - && Objects.equals(this.targetSelector, llamaGuard38bFilterConfig.targetSelector); + && Objects.equals(this.config, llamaGuard38bFilterConfig.config); } @Override public int hashCode() { - return Objects.hash(type, config, targetSelector, cloudSdkCustomFields); + return Objects.hash(type, config, cloudSdkCustomFields); } @Override @@ -285,7 +247,6 @@ public String toString() { sb.append("class LlamaGuard38bFilterConfig {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" targetSelector: ").append(toIndentedString(targetSelector)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilterConfig.java index 6343250e5..bc7f437a3 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilterConfig.java @@ -18,7 +18,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = AzureContentSafetyOutputFilterConfig.class), - @JsonSubTypes.Type(value = GraniteGuardianFilterConfig.class), @JsonSubTypes.Type(value = LlamaGuard38bFilterConfig.class), }) public interface OutputFilterConfig {} diff --git a/orchestration/src/main/resources/spec/orchestration.yaml b/orchestration/src/main/resources/spec/orchestration.yaml index 2ce1037fa..02b2e9e36 100644 --- a/orchestration/src/main/resources/spec/orchestration.yaml +++ b/orchestration/src/main/resources/spec/orchestration.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Orchestration v2 description: Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - version: 1.13.2 + version: 0.110.12 contact: name: SAP AI Core x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. @@ -54,16 +54,6 @@ paths: responses: "200": description: "Successful response" - headers: - X-Orchestration-Dropped-Model-Params: - schema: - type: string - description: > - Comma-separated sorted list of Chat Completions parameters silently - dropped because they are not supported by the Responses API. - Present only when at least one parameter was dropped and - drop_unsupported_params is true (the default). Applies to both - synchronous (application/json) and streaming (text/event-stream) responses. content: application/json: schema: @@ -1313,16 +1303,6 @@ components: default: 2 minimum: 0 maximum: 5 - drop_unsupported_params: - type: boolean - default: true - description: > - Controls behaviour when Chat Completions parameters not supported by the Responses API - are present in the request. Only applies to models that use the Responses API - (responsesApiOnly: true in the model registry). - When true (default): unsupported params are silently dropped and reported in the - X-Orchestration-Dropped-Model-Params response header. - When false: any unsupported parameter causes a 400 error with an actionable message. # --- Templating Module with User Defined Template --- # response_format api definition taken from: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L12286 @@ -1618,13 +1598,11 @@ components: oneOf: - $ref: "#/components/schemas/AzureContentSafetyInputFilterConfig" - $ref: "#/components/schemas/LlamaGuard38bFilterConfig" - - $ref: "#/components/schemas/GraniteGuardianFilterConfig" OutputFilterConfig: oneOf: - $ref: "#/components/schemas/AzureContentSafetyOutputFilterConfig" - $ref: "#/components/schemas/LlamaGuard38bFilterConfig" - - $ref: "#/components/schemas/GraniteGuardianFilterConfig" AzureContentSafetyInputFilterConfig: type: object @@ -1640,8 +1618,6 @@ components: example: azure_content_safety config: $ref: "#/components/schemas/AzureContentSafetyInput" - target_selector: - $ref: "#/components/schemas/InputFilterTargetSelector" AzureContentSafetyOutputFilterConfig: type: object @@ -1720,8 +1696,6 @@ components: example: llama_guard_3_8b config: $ref: "#/components/schemas/LlamaGuard38b" - target_selector: - $ref: "#/components/schemas/InputFilterTargetSelector" LlamaGuard38b: deprecated: true @@ -1759,64 +1733,6 @@ components: code_interpreter_abuse: type: boolean - GraniteGuardianFilterConfig: - type: object - description: Filter configuration for IBM Granite Guardian filter provider. - required: - - type - - config - additionalProperties: false - properties: - type: - description: Name of the filter provider type - type: string - enum: - - granite_guardian_4_1 - example: granite_guardian_4_1 - config: - $ref: "#/components/schemas/GraniteGuardian41" - target_selector: - $ref: "#/components/schemas/InputFilterTargetSelector" - - GraniteGuardian41: - description: Configuration for IBM Granite Guardian 4.1 filter provider. - type: object - additionalProperties: false - required: - - categories - properties: - enable_reasoning: - type: boolean - default: false - description: "Enable reasoning (think) mode for Granite Guardian. Applies to every configured category. Returns reasoning content when enabled, e.g. 'harm': {'verdict': true, 'reasoning': '...'}" - categories: - description: "Content criteria to evaluate. Note: Granite Guardian requires separate calls for each configured content category. Recommendation: Use only `harm` catch all content category." - type: object - additionalProperties: false - minProperties: 1 - properties: - harm: - type: boolean - description: Catch-all criterion for generally harmful content. - social_bias: - type: boolean - description: Detect prejudice or discrimination based on identity or protected characteristics. - jailbreak: - type: boolean - description: Detect attempts to manipulate the model into producing harmful or otherwise undesired outputs. - violence: - type: boolean - description: Detect content promoting or depicting physical, mental, or sexual harm. - profanity: - type: boolean - description: Detect offensive language or insults. - sexual_content: - type: boolean - description: Detect explicit or suggestive material of a sexual nature. - unethical_behavior: - type: boolean - description: Detect content describing actions that violate moral or legal standards. - # --- Masking module --- MaskingModuleConfig: oneOf: @@ -2527,47 +2443,6 @@ components: type: string default: "" - InputFilterTargetSelector: - oneOf: - - $ref: "#/components/schemas/AfterLastRoleTargetSelector" - - $ref: "#/components/schemas/LastMessagesTargetSelector" - description: > - Selector for scoping input filtering to a subset of the combined - message list (messages_history prepended to template). - If not present, all input content is filtered. - - AfterLastRoleTargetSelector: - type: object - additionalProperties: false - required: - - after_last_role - properties: - after_last_role: - type: string - description: > - Filter all messages after the last message with this role in the combined - message list. If no message is scoped after applying this filter, then the filter is skipped. - enum: - - system - - user - - assistant - - developer - - tool - - LastMessagesTargetSelector: - type: object - additionalProperties: false - required: - - last_messages - properties: - last_messages: - type: integer - minimum: 1 - description: > - Number of messages from the end of the combined message list to include - in filtering. Must be >= 1 (0 is not allowed and returns 400 Bad Request). - If specified value is larger than the combined message list length, all messages are filtered. - responses: BadRequest: description: Bad Request @@ -2580,4 +2455,4 @@ components: content: application/json: schema: - $ref: "#/components/schemas/ErrorResponse" \ No newline at end of file + $ref: "#/components/schemas/ErrorResponse"