diff --git a/.github/workflows/fosstars-report.yml b/.github/workflows/fosstars-report.yml index fadd925db..7557f8a89 100644 --- a/.github/workflows/fosstars-report.yml +++ b/.github/workflows/fosstars-report.yml @@ -1,4 +1,4 @@ -name: "Fosstars (Security)" +name: "Security Rating & Vulnerability Scan" on: workflow_dispatch: schedule: @@ -22,6 +22,12 @@ jobs: - name: "Checkout repository" uses: actions/checkout@v5 + - name: "Run analysis" + uses: ossf/scorecard-action@v2.4.3 + with: + results_file: results.sarif + results_format: sarif + - name: "Setup java" uses: actions/setup-java@v5 with: @@ -75,13 +81,6 @@ jobs: path: ${{ env.CVE_CACHE_DIR }} key: ${{ env.CVE_CACHE_KEY }} - # This action changes the active branch! - - name: "Fosstars Rating" - uses: SAP/fosstars-rating-core-action@v1.14.0 - with: - report-branch: fosstars-report - token: ${{ secrets.GITHUB_TOKEN }} - - name: "Slack Notification" if: failure() uses: slackapi/slack-github-action@v2.1.1 diff --git a/.github/workflows/weekly-spec-update.yaml b/.github/workflows/weekly-spec-update.yaml index ddbbab768..4cf805afa 100644 --- a/.github/workflows/weekly-spec-update.yaml +++ b/.github/workflows/weekly-spec-update.yaml @@ -37,6 +37,21 @@ jobs: TOKEN: ${{ secrets.GH_TOOLS_TOKEN }} + - name: "Get orchestration version" + if: matrix.file == 'orchestration' + run: | + ORCH_VERSION=$(curl --silent --request GET --url "https://github.tools.sap/api/v3/repos/MLF-prod/mlf-gitops-prod/contents/services/llm-orchestration/source/Chart.yaml?ref=aws.eu-central-1.prod-eu/current" -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github.v3.raw" | grep 'version:' | awk '{print $2}') + + if [ -z "$ORCH_VERSION" ]; then + echo "Failed to fetch orchestration version" + exit 1 + fi + echo "Orchestration version: $ORCH_VERSION" + echo "ORCH_VERSION=$ORCH_VERSION" >> $GITHUB_ENV + env: + TOKEN: ${{ secrets.GH_TOOLS_TOKEN }} + + - name: "Trigger spec update" run: | BRANCH="main" diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/client/OrchestrationConfigsApi.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/client/OrchestrationConfigsApi.java index 80b71f022..40e1ffa21 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/client/OrchestrationConfigsApi.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/client/OrchestrationConfigsApi.java @@ -325,8 +325,9 @@ public File exportOrchestrationConfig(@Nonnull final UUID orchestrationConfigId) * * @param orchestrationConfigId (required) The value for the parameter orchestrationConfigId * @param aiResourceGroup (optional) Specify a resource group id to use - * @param resolveTemplateRef (optional, default to false) The value for the parameter - * resolveTemplateRef + * @param resolveTemplateRef (optional, default to false) DEPRECATED: Use resolveTemplateRef + * instead + * @param resolveTemplateRef2 (optional) The value for the parameter resolveTemplateRef2 * @return OrchestrationConfigGetResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -334,7 +335,8 @@ public File exportOrchestrationConfig(@Nonnull final UUID orchestrationConfigId) public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup, - @Nullable final Boolean resolveTemplateRef) + @Nullable final Boolean resolveTemplateRef, + @Nullable final Boolean resolveTemplateRef2) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -360,6 +362,8 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( localVarQueryParams.putAll( apiClient.parameterToMultiValueMap(null, "resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "resolveTemplateRef", resolveTemplateRef2)); if (aiResourceGroup != null) localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); @@ -404,7 +408,7 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( @Nonnull final UUID orchestrationConfigId) throws OpenApiRequestException { - return getOrchestrationConfigByUuid(orchestrationConfigId, null, null); + return getOrchestrationConfigByUuid(orchestrationConfigId, null, null, null); } /** @@ -498,9 +502,11 @@ public OrchestrationConfigPostResponse importOrchestrationConfig() * @param version (required) The value for the parameter version * @param name (required) The value for the parameter name * @param aiResourceGroup (optional) Specify a resource group id to use - * @param includeSpec (optional, default to false) The value for the parameter includeSpec - * @param resolveTemplateRef (optional, default to false) The value for the parameter - * resolveTemplateRef + * @param includeSpec (optional, default to false) DEPRECATED: Use includeSpec instead + * @param includeSpec2 (optional) The value for the parameter includeSpec2 + * @param resolveTemplateRef (optional, default to false) DEPRECATED: Use resolveTemplateRef + * instead + * @param resolveTemplateRef2 (optional) The value for the parameter resolveTemplateRef2 * @return OrchestrationConfigListResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -511,7 +517,9 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( @Nonnull final String name, @Nullable final String aiResourceGroup, @Nullable final Boolean includeSpec, - @Nullable final Boolean resolveTemplateRef) + @Nullable final Boolean includeSpec2, + @Nullable final Boolean resolveTemplateRef, + @Nullable final Boolean resolveTemplateRef2) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -552,8 +560,12 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( localVarQueryParams.putAll( apiClient.parameterToMultiValueMap(null, "include_spec", includeSpec)); + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "includeSpec", includeSpec2)); localVarQueryParams.putAll( apiClient.parameterToMultiValueMap(null, "resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "resolveTemplateRef", resolveTemplateRef2)); if (aiResourceGroup != null) localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); @@ -601,7 +613,7 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( public OrchestrationConfigListResponse listOrchestrationConfigHistory( @Nonnull final String scenario, @Nonnull final String version, @Nonnull final String name) throws OpenApiRequestException { - return listOrchestrationConfigHistory(scenario, version, name, null, null, null); + return listOrchestrationConfigHistory(scenario, version, name, null, null, null, null, null); } /** @@ -620,9 +632,11 @@ public OrchestrationConfigListResponse listOrchestrationConfigHistory( * @param name (optional) The value for the parameter name * @param version (optional) The value for the parameter version * @param retrieve (optional, default to both) The value for the parameter retrieve - * @param includeSpec (optional, default to false) The value for the parameter includeSpec - * @param resolveTemplateRef (optional, default to false) The value for the parameter - * resolveTemplateRef + * @param includeSpec (optional, default to false) DEPRECATED: Use includeSpec instead + * @param includeSpec2 (optional) The value for the parameter includeSpec2 + * @param resolveTemplateRef (optional, default to false) DEPRECATED: Use resolveTemplateRef + * instead + * @param resolveTemplateRef2 (optional) The value for the parameter resolveTemplateRef2 * @return OrchestrationConfigListResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -634,7 +648,9 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( @Nullable final String version, @Nullable final String retrieve, @Nullable final Boolean includeSpec, - @Nullable final Boolean resolveTemplateRef) + @Nullable final Boolean includeSpec2, + @Nullable final Boolean resolveTemplateRef, + @Nullable final Boolean resolveTemplateRef2) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -653,8 +669,12 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "retrieve", retrieve)); localVarQueryParams.putAll( apiClient.parameterToMultiValueMap(null, "include_spec", includeSpec)); + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "includeSpec", includeSpec2)); localVarQueryParams.putAll( apiClient.parameterToMultiValueMap(null, "resolve_template_ref", resolveTemplateRef)); + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "resolveTemplateRef", resolveTemplateRef2)); if (aiResourceGroup != null) localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); @@ -697,6 +717,6 @@ public OrchestrationConfigListResponse listOrchestrationConfigs( */ @Nonnull public OrchestrationConfigListResponse listOrchestrationConfigs() throws OpenApiRequestException { - return listOrchestrationConfigs(null, null, null, null, null, null, null); + return listOrchestrationConfigs(null, null, null, null, null, null, null, null, null); } } diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/CacheControl.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/CacheControl.java new file mode 100644 index 000000000..bba3c551d --- /dev/null +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/CacheControl.java @@ -0,0 +1,345 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.prompt.registry.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; + +/** + * Cache control directive for Anthropic prompt caching. Only applicable to Anthropic Claude models. + * When set, marks the content block as a cache breakpoint. + */ +// CHECKSTYLE:OFF +public class CacheControl +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The EPHEMERAL option of this CacheControl */ + EPHEMERAL("ephemeral"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CacheControl */ + 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 CacheControl + */ + @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; + + /** + * Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 + * hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5). + */ + public enum TtlEnum { + /** The _5M option of this CacheControl */ + _5M("5m"), + + /** The _1H option of this CacheControl */ + _1H("1h"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CacheControl */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TtlEnum(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 CacheControl + */ + @JsonCreator + @Nonnull + public static TtlEnum fromValue(@Nonnull final String value) { + for (TtlEnum b : TtlEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("ttl") + private TtlEnum ttl; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CacheControl. */ + protected CacheControl() {} + + /** + * Set the type of this {@link CacheControl} instance and return the same instance. + * + * @param type The type of this {@link CacheControl} + * @return The same instance of this {@link CacheControl} class + */ + @Nonnull + public CacheControl type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link CacheControl} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link CacheControl} instance. + * + * @param type The type of this {@link CacheControl} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the ttl of this {@link CacheControl} instance and return the same instance. + * + * @param ttl Time-to-live for the cache entry. Default is \"5m\" (5 minutes). + * \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, + * Sonnet 4.5). + * @return The same instance of this {@link CacheControl} class + */ + @Nonnull + public CacheControl ttl(@Nullable final TtlEnum ttl) { + this.ttl = ttl; + return this; + } + + /** + * Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 + * hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5). + * + * @return ttl The ttl of this {@link CacheControl} instance. + */ + @Nonnull + public TtlEnum getTtl() { + return ttl; + } + + /** + * Set the ttl of this {@link CacheControl} instance. + * + * @param ttl Time-to-live for the cache entry. Default is \"5m\" (5 minutes). + * \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, + * Sonnet 4.5). + */ + public void setTtl(@Nullable final TtlEnum ttl) { + this.ttl = ttl; + } + + /** + * Get the names of the unrecognizable properties of the {@link CacheControl}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CacheControl} 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("CacheControl has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link CacheControl} 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 (ttl != null) declaredFields.put("ttl", ttl); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link CacheControl} 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 CacheControl cacheControl = (CacheControl) o; + return Objects.equals(this.cloudSdkCustomFields, cacheControl.cloudSdkCustomFields) + && Objects.equals(this.type, cacheControl.type) + && Objects.equals(this.ttl, cacheControl.ttl); + } + + @Override + public int hashCode() { + return Objects.hash(type, ttl, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CacheControl {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ttl: ").append(toIndentedString(ttl)).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 CacheControl} instance + * with all required arguments. + */ + public static Builder create() { + return (type) -> new CacheControl().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link CacheControl} instance. + * + * @param type The type of this {@link CacheControl} + * @return The CacheControl instance. + */ + CacheControl type(@Nonnull final TypeEnum type); + } +} diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/ChatMessageContent.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/ChatMessageContent.java index a83951aa3..a447eccf0 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/ChatMessageContent.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/ChatMessageContent.java @@ -17,22 +17,24 @@ /** ChatMessageContent */ public interface ChatMessageContent { /** - * Helper class to create {@code List } that implements {@link ChatMessageContent}. + * Helper class to create {@code List } that implements {@link + * ChatMessageContent}. */ - record ListOfTextContents( - @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) + record ListOfSchemasTextContents( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatMessageContent {} /** - * Creator to enable deserialization of {@code List }. + * Creator to enable deserialization of {@code List }. * * @param val the value to use - * @return a new instance of {@link ListOfTextContents}. + * @return a new instance of {@link ListOfSchemasTextContents}. */ @com.fasterxml.jackson.annotation.JsonCreator @Nonnull - static ListOfTextContents createListOfTextContents(@Nonnull final List val) { - return new ListOfTextContents(val); + static ListOfSchemasTextContents createListOfSchemasTextContents( + @Nonnull final List val) { + return new ListOfSchemasTextContents(val); } /** Helper class to create {@code String } that implements {@link ChatMessageContent}. */ diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/DPIConfig.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/DPIConfig.java index 0d609b103..d0ac9d3a3 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/DPIConfig.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/DPIConfig.java @@ -159,6 +159,66 @@ public static MethodEnum fromValue(@Nonnull final String value) { @JsonProperty("mask_grounding_input") private DPIConfigMaskGroundingInput maskGroundingInput; + /** Type of masking method to be used for file inputs. Required if file inputs are provided. */ + public enum MaskFileInputMethodEnum { + /** The ANONYMIZATION option of this DPIConfig */ + ANONYMIZATION("anonymization"), + + /** The SKIP option of this DPIConfig */ + SKIP("skip"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this DPIConfig */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MaskFileInputMethodEnum(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 DPIConfig + */ + @JsonCreator + @Nonnull + public static MaskFileInputMethodEnum fromValue(@Nonnull final String value) { + for (MaskFileInputMethodEnum b : MaskFileInputMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("mask_file_input_method") + private MaskFileInputMethodEnum maskFileInputMethod; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -352,6 +412,40 @@ public void setMaskGroundingInput( this.maskGroundingInput = maskGroundingInput; } + /** + * Set the maskFileInputMethod of this {@link DPIConfig} instance and return the same instance. + * + * @param maskFileInputMethod Type of masking method to be used for file inputs. Required if file + * inputs are provided. + * @return The same instance of this {@link DPIConfig} class + */ + @Nonnull + public DPIConfig maskFileInputMethod( + @Nullable final MaskFileInputMethodEnum maskFileInputMethod) { + this.maskFileInputMethod = maskFileInputMethod; + return this; + } + + /** + * Type of masking method to be used for file inputs. Required if file inputs are provided. + * + * @return maskFileInputMethod The maskFileInputMethod of this {@link DPIConfig} instance. + */ + @Nonnull + public MaskFileInputMethodEnum getMaskFileInputMethod() { + return maskFileInputMethod; + } + + /** + * Set the maskFileInputMethod of this {@link DPIConfig} instance. + * + * @param maskFileInputMethod Type of masking method to be used for file inputs. Required if file + * inputs are provided. + */ + public void setMaskFileInputMethod(@Nullable final MaskFileInputMethodEnum maskFileInputMethod) { + this.maskFileInputMethod = maskFileInputMethod; + } + /** * Get the names of the unrecognizable properties of the {@link DPIConfig}. * @@ -395,6 +489,7 @@ public Map toMap() { if (entities != null) declaredFields.put("entities", entities); if (allowlist != null) declaredFields.put("allowlist", allowlist); if (maskGroundingInput != null) declaredFields.put("maskGroundingInput", maskGroundingInput); + if (maskFileInputMethod != null) declaredFields.put("maskFileInputMethod", maskFileInputMethod); return declaredFields; } @@ -424,13 +519,20 @@ public boolean equals(@Nullable final java.lang.Object o) { && Objects.equals(this.method, dpIConfig.method) && Objects.equals(this.entities, dpIConfig.entities) && Objects.equals(this.allowlist, dpIConfig.allowlist) - && Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput); + && Objects.equals(this.maskGroundingInput, dpIConfig.maskGroundingInput) + && Objects.equals(this.maskFileInputMethod, dpIConfig.maskFileInputMethod); } @Override public int hashCode() { return Objects.hash( - type, method, entities, allowlist, maskGroundingInput, cloudSdkCustomFields); + type, + method, + entities, + allowlist, + maskGroundingInput, + maskFileInputMethod, + cloudSdkCustomFields); } @Override @@ -443,6 +545,9 @@ public String toString() { sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n"); sb.append(" maskGroundingInput: ").append(toIndentedString(maskGroundingInput)).append("\n"); + sb.append(" maskFileInputMethod: ") + .append(toIndentedString(maskFileInputMethod)) + .append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/FileContent.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/FileContent.java new file mode 100644 index 000000000..bab9b78b2 --- /dev/null +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/FileContent.java @@ -0,0 +1,221 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.prompt.registry.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; + +/** FileContent */ +// CHECKSTYLE:OFF +public class FileContent +// CHECKSTYLE:ON +{ + @JsonProperty("file_data") + private String fileData; + + @JsonProperty("filename") + private String filename; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for FileContent. */ + protected FileContent() {} + + /** + * Set the fileData of this {@link FileContent} instance and return the same instance. + * + * @param fileData Base64 encoded file content or file URL + * @return The same instance of this {@link FileContent} class + */ + @Nonnull + public FileContent fileData(@Nonnull final String fileData) { + this.fileData = fileData; + return this; + } + + /** + * Base64 encoded file content or file URL + * + * @return fileData The fileData of this {@link FileContent} instance. + */ + @Nonnull + public String getFileData() { + return fileData; + } + + /** + * Set the fileData of this {@link FileContent} instance. + * + * @param fileData Base64 encoded file content or file URL + */ + public void setFileData(@Nonnull final String fileData) { + this.fileData = fileData; + } + + /** + * Set the filename of this {@link FileContent} instance and return the same instance. + * + * @param filename Name of the file + * @return The same instance of this {@link FileContent} class + */ + @Nonnull + public FileContent filename(@Nullable final String filename) { + this.filename = filename; + return this; + } + + /** + * Name of the file + * + * @return filename The filename of this {@link FileContent} instance. + */ + @Nonnull + public String getFilename() { + return filename; + } + + /** + * Set the filename of this {@link FileContent} instance. + * + * @param filename Name of the file + */ + public void setFilename(@Nullable final String filename) { + this.filename = filename; + } + + /** + * Get the names of the unrecognizable properties of the {@link FileContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FileContent} 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("FileContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link FileContent} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (fileData != null) declaredFields.put("fileData", fileData); + if (filename != null) declaredFields.put("filename", filename); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link FileContent} 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 FileContent fileContent = (FileContent) o; + return Objects.equals(this.cloudSdkCustomFields, fileContent.cloudSdkCustomFields) + && Objects.equals(this.fileData, fileContent.fileData) + && Objects.equals(this.filename, fileContent.filename); + } + + @Override + public int hashCode() { + return Objects.hash(fileData, filename, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FileContent {\n"); + sb.append(" fileData: ").append(toIndentedString(fileData)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).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 FileContent} instance + * with all required arguments. + */ + public static Builder create() { + return (fileData) -> new FileContent().fileData(fileData); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the fileData of this {@link FileContent} instance. + * + * @param fileData Base64 encoded file content or file URL + * @return The FileContent instance. + */ + FileContent fileData(@Nonnull final String fileData); + } +} diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/LLMModelDetails.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/LLMModelDetails.java index 4b0cd3f18..507b8d16a 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/LLMModelDetails.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/LLMModelDetails.java @@ -169,7 +169,7 @@ public void setParams(@Nullable final Map params) { * Set the timeout of this {@link LLMModelDetails} instance and return the same instance. * * @param timeout Timeout for the LLM request in seconds. This parameter is currently ignored for - * Vertex AI models. Minimum: 1 Maximum: 600 + * Vertex AI models. Minimum: 1 Maximum: 1200 * @return The same instance of this {@link LLMModelDetails} class */ @Nonnull @@ -180,7 +180,7 @@ public LLMModelDetails timeout(@Nullable final Integer timeout) { /** * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI - * models. minimum: 1 maximum: 600 + * models. minimum: 1 maximum: 1200 * * @return timeout The timeout of this {@link LLMModelDetails} instance. */ @@ -193,7 +193,7 @@ public Integer getTimeout() { * Set the timeout of this {@link LLMModelDetails} instance. * * @param timeout Timeout for the LLM request in seconds. This parameter is currently ignored for - * Vertex AI models. Minimum: 1 Maximum: 600 + * Vertex AI models. Minimum: 1 Maximum: 1200 */ public void setTimeout(@Nullable final Integer timeout) { this.timeout = timeout; diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/MaskingModuleConfigMaskingProviders.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/MaskingModuleConfigMaskingProviders.java index 7e16a58ac..203140281 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/MaskingModuleConfigMaskingProviders.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/MaskingModuleConfigMaskingProviders.java @@ -44,8 +44,8 @@ protected MaskingModuleConfigMaskingProviders() {} * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance and * return the same instance. * - * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed Sept - * 15, 2026. Use `providers` property instead. + * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed + * March 20, 2027. Use `providers` property instead. * @return The same instance of this {@link MaskingModuleConfigMaskingProviders} class */ @Nonnull @@ -72,7 +72,7 @@ public MaskingModuleConfigMaskingProviders addMaskingProvidersItem( } /** - * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use + * List of masking service providers. **DEPRECATED**: will be removed March 20, 2027. Use * `providers` property instead. * * @return maskingProviders The maskingProviders of this {@link @@ -88,8 +88,8 @@ public List getMaskingProviders() { /** * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. * - * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed Sept - * 15, 2026. Use `providers` property instead. + * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed + * March 20, 2027. Use `providers` property instead. */ public void setMaskingProviders(@Nonnull final List maskingProviders) { this.maskingProviders = maskingProviders; @@ -212,7 +212,7 @@ public interface Builder { * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. * * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed - * Sept 15, 2026. Use `providers` property instead. + * March 20, 2027. Use `providers` property instead. * @return The MaskingModuleConfigMaskingProviders instance. */ MaskingModuleConfigMaskingProviders maskingProviders( @@ -222,7 +222,7 @@ MaskingModuleConfigMaskingProviders maskingProviders( * Set the maskingProviders of this {@link MaskingModuleConfigMaskingProviders} instance. * * @param maskingProviders List of masking service providers. **DEPRECATED**: will be removed - * Sept 15, 2026. Use `providers` property instead. + * March 20, 2027. Use `providers` property instead. * @return The MaskingModuleConfigMaskingProviders instance. */ default MaskingModuleConfigMaskingProviders maskingProviders( diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfig.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfig.java index ab6472801..ba8c0b894 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfig.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfig.java @@ -29,7 +29,7 @@ public class OrchestrationConfig // CHECKSTYLE:ON { @JsonProperty("modules") - private ModuleConfigs modules; + private OrchestrationConfigModules modules; @JsonProperty("stream") private GlobalStreamOptions stream; @@ -47,7 +47,7 @@ protected OrchestrationConfig() {} * @return The same instance of this {@link OrchestrationConfig} class */ @Nonnull - public OrchestrationConfig modules(@Nonnull final ModuleConfigs modules) { + public OrchestrationConfig modules(@Nonnull final OrchestrationConfigModules modules) { this.modules = modules; return this; } @@ -58,7 +58,7 @@ public OrchestrationConfig modules(@Nonnull final ModuleConfigs modules) { * @return modules The modules of this {@link OrchestrationConfig} instance. */ @Nonnull - public ModuleConfigs getModules() { + public OrchestrationConfigModules getModules() { return modules; } @@ -67,7 +67,7 @@ public ModuleConfigs getModules() { * * @param modules The modules of this {@link OrchestrationConfig} */ - public void setModules(@Nonnull final ModuleConfigs modules) { + public void setModules(@Nonnull final OrchestrationConfigModules modules) { this.modules = modules; } @@ -217,6 +217,6 @@ public interface Builder { * @param modules The modules of this {@link OrchestrationConfig} * @return The OrchestrationConfig instance. */ - OrchestrationConfig modules(@Nonnull final ModuleConfigs modules); + OrchestrationConfig modules(@Nonnull final OrchestrationConfigModules modules); } } diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfigModules.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfigModules.java new file mode 100644 index 000000000..02d0bdb01 --- /dev/null +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/OrchestrationConfigModules.java @@ -0,0 +1,58 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.prompt.registry.model; + +import java.util.List; +import javax.annotation.Nonnull; + +/** OrchestrationConfigModules */ +public interface OrchestrationConfigModules { + /** + * Helper class to create {@code ModuleConfigs } that implements {@link + * OrchestrationConfigModules}. + */ + record InnerModuleConfigs( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull ModuleConfigs value) + implements OrchestrationConfigModules {} + + /** + * Creator to enable deserialization of {@code ModuleConfigs }. + * + * @param val the value to use + * @return a new instance of {@link InnerModuleConfigs}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerModuleConfigs createInnerModuleConfigs(@Nonnull final ModuleConfigs val) { + return new InnerModuleConfigs(val); + } + + /** + * Helper class to create {@code List } that implements {@link + * OrchestrationConfigModules}. + */ + record ListOfModuleConfigss( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) + implements OrchestrationConfigModules {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val the value to use + * @return a new instance of {@link ListOfModuleConfigss}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfModuleConfigss createListOfModuleConfigss(@Nonnull final List val) { + return new ListOfModuleConfigss(val); + } +} diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplateSubstitutionRequest.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplateSubstitutionRequest.java index 14c6757e9..b1b2f5e1d 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplateSubstitutionRequest.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplateSubstitutionRequest.java @@ -45,7 +45,7 @@ protected PromptTemplateSubstitutionRequest() {} * @return The same instance of this {@link PromptTemplateSubstitutionRequest} class */ @Nonnull - public PromptTemplateSubstitutionRequest inputParams(@Nullable final Object inputParams) { + public PromptTemplateSubstitutionRequest inputParams(@Nonnull final Object inputParams) { this.inputParams = inputParams; return this; } @@ -65,7 +65,7 @@ public Object getInputParams() { * * @param inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest} */ - public void setInputParams(@Nullable final Object inputParams) { + public void setInputParams(@Nonnull final Object inputParams) { this.inputParams = inputParams; } @@ -170,8 +170,22 @@ private String toIndentedString(final java.lang.Object o) { return o.toString().replace("\n", "\n "); } - /** Create a new {@link PromptTemplateSubstitutionRequest} instance. No arguments are required. */ - public static PromptTemplateSubstitutionRequest create() { - return new PromptTemplateSubstitutionRequest(); + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * PromptTemplateSubstitutionRequest} instance with all required arguments. + */ + public static Builder create() { + return (inputParams) -> new PromptTemplateSubstitutionRequest().inputParams(inputParams); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the inputParams of this {@link PromptTemplateSubstitutionRequest} instance. + * + * @param inputParams The inputParams of this {@link PromptTemplateSubstitutionRequest} + * @return The PromptTemplateSubstitutionRequest instance. + */ + PromptTemplateSubstitutionRequest inputParams(@Nonnull final Object inputParams); } } diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfig.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfig.java index b68654454..38139cbfe 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfig.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfig.java @@ -49,7 +49,7 @@ protected PromptTemplatingModuleConfig() {} */ @Nonnull public PromptTemplatingModuleConfig prompt( - @Nonnull final PromptTemplatingModuleConfigPrompt prompt) { + @Nullable final PromptTemplatingModuleConfigPrompt prompt) { this.prompt = prompt; return this; } @@ -69,7 +69,7 @@ public PromptTemplatingModuleConfigPrompt getPrompt() { * * @param prompt The prompt of this {@link PromptTemplatingModuleConfig} */ - public void setPrompt(@Nonnull final PromptTemplatingModuleConfigPrompt prompt) { + public void setPrompt(@Nullable final PromptTemplatingModuleConfigPrompt prompt) { this.prompt = prompt; } @@ -213,22 +213,11 @@ private String toIndentedString(final java.lang.Object o) { * PromptTemplatingModuleConfig} instance with all required arguments. */ public static Builder create() { - return (prompt) -> (model) -> new PromptTemplatingModuleConfig().prompt(prompt).model(model); + return (model) -> new PromptTemplatingModuleConfig().model(model); } /** Builder helper class. */ public interface Builder { - /** - * Set the prompt of this {@link PromptTemplatingModuleConfig} instance. - * - * @param prompt The prompt of this {@link PromptTemplatingModuleConfig} - * @return The PromptTemplatingModuleConfig builder. - */ - Builder1 prompt(@Nonnull final PromptTemplatingModuleConfigPrompt prompt); - } - - /** Builder helper class. */ - public interface Builder1 { /** * Set the model of this {@link PromptTemplatingModuleConfig} instance. * diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfigPrompt.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfigPrompt.java index d34042e67..d4286e011 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfigPrompt.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplatingModuleConfigPrompt.java @@ -16,7 +16,8 @@ /** * The prompt template to be used. Can be either a user defined template or a reference to a - * template in the prompt registry. + * template in the prompt registry. If omitted, messages_history must be provided in the request + * body. */ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasChatCompletionTool.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasChatCompletionTool.java new file mode 100644 index 000000000..55272f705 --- /dev/null +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasChatCompletionTool.java @@ -0,0 +1,328 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.prompt.registry.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; + +/** SchemasChatCompletionTool */ +// CHECKSTYLE:OFF +public class SchemasChatCompletionTool +// CHECKSTYLE:ON +{ + /** The type of the tool. Currently, only `function` is supported. */ + public enum TypeEnum { + /** The FUNCTION option of this SchemasChatCompletionTool */ + FUNCTION("function"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SchemasChatCompletionTool */ + 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 SchemasChatCompletionTool + */ + @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("function") + private FunctionObject function; + + @JsonProperty("cache_control") + private CacheControl cacheControl; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SchemasChatCompletionTool. */ + protected SchemasChatCompletionTool() {} + + /** + * Set the type of this {@link SchemasChatCompletionTool} instance and return the same instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link SchemasChatCompletionTool} class + */ + @Nonnull + public SchemasChatCompletionTool type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link SchemasChatCompletionTool} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SchemasChatCompletionTool} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the function of this {@link SchemasChatCompletionTool} instance and return the same + * instance. + * + * @param function The function of this {@link SchemasChatCompletionTool} + * @return The same instance of this {@link SchemasChatCompletionTool} class + */ + @Nonnull + public SchemasChatCompletionTool function(@Nonnull final FunctionObject function) { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link SchemasChatCompletionTool} instance. + */ + @Nonnull + public FunctionObject getFunction() { + return function; + } + + /** + * Set the function of this {@link SchemasChatCompletionTool} instance. + * + * @param function The function of this {@link SchemasChatCompletionTool} + */ + public void setFunction(@Nonnull final FunctionObject function) { + this.function = function; + } + + /** + * Set the cacheControl of this {@link SchemasChatCompletionTool} instance and return the same + * instance. + * + * @param cacheControl The cacheControl of this {@link SchemasChatCompletionTool} + * @return The same instance of this {@link SchemasChatCompletionTool} class + */ + @Nonnull + public SchemasChatCompletionTool cacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get cacheControl + * + * @return cacheControl The cacheControl of this {@link SchemasChatCompletionTool} instance. + */ + @Nonnull + public CacheControl getCacheControl() { + return cacheControl; + } + + /** + * Set the cacheControl of this {@link SchemasChatCompletionTool} instance. + * + * @param cacheControl The cacheControl of this {@link SchemasChatCompletionTool} + */ + public void setCacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + } + + /** + * Get the names of the unrecognizable properties of the {@link SchemasChatCompletionTool}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SchemasChatCompletionTool} 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( + "SchemasChatCompletionTool has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SchemasChatCompletionTool} 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 (function != null) declaredFields.put("function", function); + if (cacheControl != null) declaredFields.put("cacheControl", cacheControl); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SchemasChatCompletionTool} 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 SchemasChatCompletionTool schemasChatCompletionTool = (SchemasChatCompletionTool) o; + return Objects.equals(this.cloudSdkCustomFields, schemasChatCompletionTool.cloudSdkCustomFields) + && Objects.equals(this.type, schemasChatCompletionTool.type) + && Objects.equals(this.function, schemasChatCompletionTool.function) + && Objects.equals(this.cacheControl, schemasChatCompletionTool.cacheControl); + } + + @Override + public int hashCode() { + return Objects.hash(type, function, cacheControl, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SchemasChatCompletionTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" cacheControl: ").append(toIndentedString(cacheControl)).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 + * SchemasChatCompletionTool} instance with all required arguments. + */ + public static Builder create() { + return (type) -> (function) -> new SchemasChatCompletionTool().type(type).function(function); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link SchemasChatCompletionTool} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The SchemasChatCompletionTool builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the function of this {@link SchemasChatCompletionTool} instance. + * + * @param function The function of this {@link SchemasChatCompletionTool} + * @return The SchemasChatCompletionTool instance. + */ + SchemasChatCompletionTool function(@Nonnull final FunctionObject function); + } +} diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasTextContent.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasTextContent.java new file mode 100644 index 000000000..38eafc542 --- /dev/null +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/SchemasTextContent.java @@ -0,0 +1,325 @@ +/* + * Prompt Registry API + * Prompt Storage service for Design time & Runtime prompt templates. + * + * + * + * 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.prompt.registry.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; + +/** SchemasTextContent */ +// CHECKSTYLE:OFF +public class SchemasTextContent +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The TEXT option of this SchemasTextContent */ + TEXT("text"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SchemasTextContent */ + 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 SchemasTextContent + */ + @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("text") + private String text; + + @JsonProperty("cache_control") + private CacheControl cacheControl; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SchemasTextContent. */ + protected SchemasTextContent() {} + + /** + * Set the type of this {@link SchemasTextContent} instance and return the same instance. + * + * @param type The type of this {@link SchemasTextContent} + * @return The same instance of this {@link SchemasTextContent} class + */ + @Nonnull + public SchemasTextContent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link SchemasTextContent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SchemasTextContent} instance. + * + * @param type The type of this {@link SchemasTextContent} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the text of this {@link SchemasTextContent} instance and return the same instance. + * + * @param text The text of this {@link SchemasTextContent} + * @return The same instance of this {@link SchemasTextContent} class + */ + @Nonnull + public SchemasTextContent text(@Nonnull final String text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link SchemasTextContent} instance. + */ + @Nonnull + public String getText() { + return text; + } + + /** + * Set the text of this {@link SchemasTextContent} instance. + * + * @param text The text of this {@link SchemasTextContent} + */ + public void setText(@Nonnull final String text) { + this.text = text; + } + + /** + * Set the cacheControl of this {@link SchemasTextContent} instance and return the same instance. + * + * @param cacheControl The cacheControl of this {@link SchemasTextContent} + * @return The same instance of this {@link SchemasTextContent} class + */ + @Nonnull + public SchemasTextContent cacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get cacheControl + * + * @return cacheControl The cacheControl of this {@link SchemasTextContent} instance. + */ + @Nonnull + public CacheControl getCacheControl() { + return cacheControl; + } + + /** + * Set the cacheControl of this {@link SchemasTextContent} instance. + * + * @param cacheControl The cacheControl of this {@link SchemasTextContent} + */ + public void setCacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + } + + /** + * Get the names of the unrecognizable properties of the {@link SchemasTextContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SchemasTextContent} 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("SchemasTextContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SchemasTextContent} 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 (text != null) declaredFields.put("text", text); + if (cacheControl != null) declaredFields.put("cacheControl", cacheControl); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SchemasTextContent} 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 SchemasTextContent schemasTextContent = (SchemasTextContent) o; + return Objects.equals(this.cloudSdkCustomFields, schemasTextContent.cloudSdkCustomFields) + && Objects.equals(this.type, schemasTextContent.type) + && Objects.equals(this.text, schemasTextContent.text) + && Objects.equals(this.cacheControl, schemasTextContent.cacheControl); + } + + @Override + public int hashCode() { + return Objects.hash(type, text, cacheControl, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SchemasTextContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" cacheControl: ").append(toIndentedString(cacheControl)).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 SchemasTextContent} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> (text) -> new SchemasTextContent().type(type).text(text); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link SchemasTextContent} instance. + * + * @param type The type of this {@link SchemasTextContent} + * @return The SchemasTextContent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the text of this {@link SchemasTextContent} instance. + * + * @param text The text of this {@link SchemasTextContent} + * @return The SchemasTextContent instance. + */ + SchemasTextContent text(@Nonnull final String text); + } +} diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/Template.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/Template.java index f3bdc1e01..67dc42610 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/Template.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/Template.java @@ -42,7 +42,7 @@ public class Template implements PromptTemplatingModuleConfigPrompt private TemplateResponseFormat responseFormat; @JsonProperty("tools") - private List tools = new ArrayList<>(); + private List tools = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -189,7 +189,7 @@ public void setResponseFormat(@Nullable final TemplateResponseFormat responseFor * @return The same instance of this {@link Template} class */ @Nonnull - public Template tools(@Nullable final List tools) { + public Template tools(@Nullable final List tools) { this.tools = tools; return this; } @@ -201,7 +201,7 @@ public Template tools(@Nullable final List tools) { * @return The same instance of type {@link Template} */ @Nonnull - public Template addToolsItem(@Nonnull final ChatCompletionTool toolsItem) { + public Template addToolsItem(@Nonnull final SchemasChatCompletionTool toolsItem) { if (this.tools == null) { this.tools = new ArrayList<>(); } @@ -216,7 +216,7 @@ public Template addToolsItem(@Nonnull final ChatCompletionTool toolsItem) { * @return tools The tools of this {@link Template} instance. */ @Nonnull - public List getTools() { + public List getTools() { return tools; } @@ -226,7 +226,7 @@ public List getTools() { * @param tools A list of tools the model may call. Used to provide a list of functions the model * may generate JSON inputs for. This is the same as the OpenAI definition. */ - public void setTools(@Nullable final List tools) { + public void setTools(@Nullable final List tools) { this.tools = tools; } diff --git a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/UserChatMessageContentItem.java b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/UserChatMessageContentItem.java index 0890aa675..3d6af62f7 100644 --- a/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/UserChatMessageContentItem.java +++ b/core-services/prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/UserChatMessageContentItem.java @@ -38,6 +38,9 @@ public enum TypeEnum { /** The IMAGE_URL option of this UserChatMessageContentItem */ IMAGE_URL("image_url"), + /** The FILE option of this UserChatMessageContentItem */ + FILE("file"), + /** The UNKNOWN_DEFAULT_OPEN_API option of this UserChatMessageContentItem */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); @@ -96,6 +99,12 @@ public static TypeEnum fromValue(@Nonnull final String value) { @JsonProperty("image_url") private ImageContentUrl imageUrl; + @JsonProperty("file") + private FileContent _file; + + @JsonProperty("cache_control") + private CacheControl cacheControl; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -196,6 +205,69 @@ public void setImageUrl(@Nullable final ImageContentUrl imageUrl) { this.imageUrl = imageUrl; } + /** + * Set the _file of this {@link UserChatMessageContentItem} instance and return the same instance. + * + * @param _file The _file of this {@link UserChatMessageContentItem} + * @return The same instance of this {@link UserChatMessageContentItem} class + */ + @Nonnull + public UserChatMessageContentItem _file(@Nullable final FileContent _file) { + this._file = _file; + return this; + } + + /** + * Get _file + * + * @return _file The _file of this {@link UserChatMessageContentItem} instance. + */ + @Nonnull + public FileContent getFile() { + return _file; + } + + /** + * Set the _file of this {@link UserChatMessageContentItem} instance. + * + * @param _file The _file of this {@link UserChatMessageContentItem} + */ + public void setFile(@Nullable final FileContent _file) { + this._file = _file; + } + + /** + * Set the cacheControl of this {@link UserChatMessageContentItem} instance and return the same + * instance. + * + * @param cacheControl The cacheControl of this {@link UserChatMessageContentItem} + * @return The same instance of this {@link UserChatMessageContentItem} class + */ + @Nonnull + public UserChatMessageContentItem cacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get cacheControl + * + * @return cacheControl The cacheControl of this {@link UserChatMessageContentItem} instance. + */ + @Nonnull + public CacheControl getCacheControl() { + return cacheControl; + } + + /** + * Set the cacheControl of this {@link UserChatMessageContentItem} instance. + * + * @param cacheControl The cacheControl of this {@link UserChatMessageContentItem} + */ + public void setCacheControl(@Nullable final CacheControl cacheControl) { + this.cacheControl = cacheControl; + } + /** * Get the names of the unrecognizable properties of the {@link UserChatMessageContentItem}. * @@ -239,6 +311,8 @@ public Map toMap() { if (type != null) declaredFields.put("type", type); if (text != null) declaredFields.put("text", text); if (imageUrl != null) declaredFields.put("imageUrl", imageUrl); + if (_file != null) declaredFields.put("_file", _file); + if (cacheControl != null) declaredFields.put("cacheControl", cacheControl); return declaredFields; } @@ -267,12 +341,14 @@ public boolean equals(@Nullable final java.lang.Object o) { this.cloudSdkCustomFields, userChatMessageContentItem.cloudSdkCustomFields) && Objects.equals(this.type, userChatMessageContentItem.type) && Objects.equals(this.text, userChatMessageContentItem.text) - && Objects.equals(this.imageUrl, userChatMessageContentItem.imageUrl); + && Objects.equals(this.imageUrl, userChatMessageContentItem.imageUrl) + && Objects.equals(this._file, userChatMessageContentItem._file) + && Objects.equals(this.cacheControl, userChatMessageContentItem.cacheControl); } @Override public int hashCode() { - return Objects.hash(type, text, imageUrl, cloudSdkCustomFields); + return Objects.hash(type, text, imageUrl, _file, cacheControl, cloudSdkCustomFields); } @Override @@ -283,6 +359,8 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" cacheControl: ").append(toIndentedString(cacheControl)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml b/core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml index dc137966e..ed147d504 100644 --- a/core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml +++ b/core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml @@ -381,14 +381,26 @@ paths: - declarative - name: include_spec in: query + deprecated: true + description: 'DEPRECATED: Use includeSpec instead' schema: type: boolean default: false + - name: includeSpec + in: query + schema: + type: boolean - name: resolve_template_ref in: query + deprecated: true + description: 'DEPRECATED: Use resolveTemplateRef instead' schema: type: boolean default: false + - name: resolveTemplateRef + in: query + schema: + type: boolean responses: '200': description: Successful response @@ -428,14 +440,26 @@ paths: type: string - name: include_spec in: query + deprecated: true + description: 'DEPRECATED: Use includeSpec instead' schema: type: boolean default: false + - name: includeSpec + in: query + schema: + type: boolean - name: resolve_template_ref in: query + deprecated: true + description: 'DEPRECATED: Use resolveTemplateRef instead' schema: type: boolean default: false + - name: resolveTemplateRef + in: query + schema: + type: boolean responses: '200': description: Successful response @@ -466,9 +490,15 @@ paths: format: uuid - name: resolve_template_ref in: query + deprecated: true + description: 'DEPRECATED: Use resolveTemplateRef instead' schema: type: boolean default: false + - name: resolveTemplateRef + in: query + schema: + type: boolean responses: '200': description: Successful response @@ -867,6 +897,8 @@ components: $ref: '#/components/schemas/PromptTemplateSpec' PromptTemplateSubstitutionRequest: type: object + required: + - inputParams properties: inputParams: type: object @@ -1014,12 +1046,46 @@ components: type: string spec: $ref: '#/components/schemas/OrchestrationConfig' + CacheControl: + type: object + description: | + Cache control directive for Anthropic prompt caching. Only applicable to Anthropic Claude models. When set, marks the content block as a cache breakpoint. + additionalProperties: false + required: + - type + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + description: | + Time-to-live for the cache entry. Default is "5m" (5 minutes). "1h" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5). + enum: + - 5m + - 1h + schemas-TextContent: + type: object + required: + - type + - text + additionalProperties: false + properties: + type: + type: string + enum: + - text + text: + type: string + cache_control: + $ref: '#/components/schemas/CacheControl' ChatMessageContent: oneOf: - type: string - type: array items: - $ref: '#/components/schemas/TextContent' + $ref: '#/components/schemas/schemas-TextContent' minItems: 1 SystemChatMessage: type: object @@ -1045,6 +1111,18 @@ components: detail: type: string default: auto + FileContent: + type: object + required: + - file_data + additionalProperties: false + properties: + file_data: + type: string + description: Base64 encoded file content or file URL + filename: + type: string + description: Name of the file UserChatMessageContentItem: type: object additionalProperties: false @@ -1054,10 +1132,15 @@ components: enum: - text - image_url + - file text: type: string image_url: $ref: '#/components/schemas/ImageContentUrl' + file: + $ref: '#/components/schemas/FileContent' + cache_control: + $ref: '#/components/schemas/CacheControl' required: - type UserChatMessageContent: @@ -1171,6 +1254,22 @@ components: minItems: 1 items: $ref: '#/components/schemas/ChatMessage' + schemas-ChatCompletionTool: + type: object + additionalProperties: false + properties: + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + $ref: '#/components/schemas/FunctionObject' + cache_control: + $ref: '#/components/schemas/CacheControl' + required: + - type + - function Template: type: object required: @@ -1198,7 +1297,7 @@ components: description: | A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. This is the same as the OpenAI definition. items: - $ref: '#/components/schemas/ChatCompletionTool' + $ref: '#/components/schemas/schemas-ChatCompletionTool' example: template: - role: user @@ -1283,7 +1382,7 @@ components: description: Additional parameters for the model. Default values are used for mandatory parameters. additionalProperties: true example: - max_tokens: 300 + max_completion_tokens: 300 temperature: 0.1 frequency_penalty: 0 presence_penalty: 0 @@ -1295,7 +1394,7 @@ components: type: integer default: 600 minimum: 1 - maximum: 600 + maximum: 1200 max_retries: description: Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. type: integer @@ -1305,13 +1404,12 @@ components: PromptTemplatingModuleConfig: type: object required: - - prompt - model additionalProperties: false properties: prompt: description: | - The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. + The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. If omitted, messages_history must be provided in the request body. oneOf: - $ref: '#/components/schemas/Template' - $ref: '#/components/schemas/TemplateRef' @@ -1623,6 +1721,12 @@ components: type: boolean default: false description: controls whether the input to the grounding module will be masked with the configuration supplied in the masking module + mask_file_input_method: + description: Type of masking method to be used for file inputs. Required if file inputs are provided. + type: string + enum: + - anonymization + - skip MaskingProviderConfig: oneOf: - $ref: '#/components/schemas/DPIConfig' @@ -1645,7 +1749,7 @@ components: properties: masking_providers: deprecated: true - description: 'List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` property instead.' + description: 'List of masking service providers. **DEPRECATED**: will be removed March 20, 2027. Use `providers` property instead.' type: array minItems: 1 items: @@ -1942,6 +2046,13 @@ components: $ref: '#/components/schemas/GroundingModuleConfig' translation: $ref: '#/components/schemas/TranslationModuleConfig' + ModuleConfigsList: + type: array + items: + $ref: '#/components/schemas/ModuleConfigs' + minItems: 1 + description: | + A list of module configurations. The first configuration in the list that succeeds will be used. GlobalStreamOptions: description: Options for streaming. Will be ignored if enabled is false. type: object @@ -1976,7 +2087,9 @@ components: additionalProperties: false properties: modules: - $ref: '#/components/schemas/ModuleConfigs' + oneOf: + - $ref: '#/components/schemas/ModuleConfigs' + - $ref: '#/components/schemas/ModuleConfigsList' stream: $ref: '#/components/schemas/GlobalStreamOptions' responses: