();
+ if (contentEncoding != null)
+ localVarHeaderParams.put("Content-Encoding", ApiClient.parameterToString(contentEncoding));
+
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {"application/json"};
@@ -122,11 +171,36 @@ public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predi
}
/**
- * Make in-context predictions for specified target columns based on provided table data Parquet
- * file.
+ * Make predictions from JSON (optionally gzip-compressed).
+ *
+ *
+ *
+ *
200 - Successful Prediction
+ *
+ *
400 - Bad Request - Invalid input data
+ *
+ *
413 - Payload Too Large
+ *
+ *
422 - Validation Error
+ *
+ *
500 - Internal Server Error
+ *
+ *
503 - Service Unavailable
+ *
+ * @param predictRequestPayload The value for the parameter predictRequestPayload
+ * @return PredictResponsePayload
+ * @throws OpenApiRequestException if an error occurs while attempting to invoke the API
+ */
+ @Nonnull
+ public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predictRequestPayload)
+ throws OpenApiRequestException {
+ return predict(predictRequestPayload, null);
+ }
+
+ /**
+ * Make predictions from Parquet file
*
- *
Make in-context predictions for specified target columns based on provided table data
- * Parquet file.
+ *
*
*
200 - Successful Prediction
*
@@ -138,17 +212,20 @@ public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predi
*
*
500 - Internal Server Error
*
- * @param _file (required) Parquet file containing the data
- * @param predictionConfig (required) JSON string for prediction_config
- * @param indexColumn (optional) Optional index column name
- * @param parseDataTypes (optional, default to true) Whether to parse data types
+ *
503 - Service Unavailable
+ *
+ * @param _file (required) The value for the parameter _file
+ * @param predictionConfig (required) JSON string containing the prediction configuration (see
+ * PredictionConfig schema).
+ * @param indexColumn (optional) The value for the parameter indexColumn
+ * @param parseDataTypes (optional, default to false) The value for the parameter parseDataTypes
* @return PredictResponsePayload
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
*/
@Nonnull
public PredictResponsePayload predictParquet(
@Nonnull final File _file,
- @Nonnull final String predictionConfig,
+ @Nonnull final File predictionConfig,
@Nullable final String indexColumn,
@Nullable final Boolean parseDataTypes)
throws OpenApiRequestException {
@@ -204,11 +281,9 @@ public PredictResponsePayload predictParquet(
}
/**
- * Make in-context predictions for specified target columns based on provided table data Parquet
- * file.
+ * Make predictions from Parquet file
*
- *
Make in-context predictions for specified target columns based on provided table data
- * Parquet file.
+ *
*
*
200 - Successful Prediction
*
@@ -220,14 +295,17 @@ public PredictResponsePayload predictParquet(
*
*
500 - Internal Server Error
*
- * @param _file Parquet file containing the data
- * @param predictionConfig JSON string for prediction_config
+ *
503 - Service Unavailable
+ *
+ * @param _file The value for the parameter _file
+ * @param predictionConfig JSON string containing the prediction configuration (see
+ * PredictionConfig schema).
* @return PredictResponsePayload
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
*/
@Nonnull
public PredictResponsePayload predictParquet(
- @Nonnull final File _file, @Nonnull final String predictionConfig)
+ @Nonnull final File _file, @Nonnull final File predictionConfig)
throws OpenApiRequestException {
return predictParquet(_file, predictionConfig, null, null);
}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ColumnType.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ColumnType.java
index 1afaa9b08..b099a210e 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ColumnType.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ColumnType.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -15,7 +15,12 @@
import com.fasterxml.jackson.annotation.JsonValue;
import javax.annotation.Nonnull;
-/** Gets or Sets ColumnType */
+/**
+ * Supported column data types for the data schema. Includes base types (string, numeric, date) and
+ * additional types derived from SAP CDS (https://cap.cloud.sap/docs/cds/types#core-built-in-types).
+ * Additional types are mapped to the corresponding base type internally. All values are lowercase
+ * for case-insensitive matching.
+ */
public enum ColumnType {
STRING("string"),
@@ -23,6 +28,32 @@ public enum ColumnType {
DATE("date"),
+ BOOLEAN("boolean"),
+
+ LARGESTRING("largestring"),
+
+ UUID("uuid"),
+
+ INTEGER("integer"),
+
+ INT16("int16"),
+
+ INT32("int32"),
+
+ INT64("int64"),
+
+ UINT8("uint8"),
+
+ DECIMAL("decimal"),
+
+ DOUBLE("double"),
+
+ TIME("time"),
+
+ DATETIME("datetime"),
+
+ TIMESTAMP("timestamp"),
+
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");
private final String value;
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationConfig.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationConfig.java
new file mode 100644
index 000000000..e211790c9
--- /dev/null
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationConfig.java
@@ -0,0 +1,221 @@
+/*
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
+ *
+ *
+ *
+ * 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.foundationmodels.rpt.generated.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 explainability outputs. */
+// CHECKSTYLE:OFF
+public class ExplanationConfig
+// CHECKSTYLE:ON
+{
+ @JsonProperty("top_column_scores")
+ private Integer topColumnScores = 0;
+
+ @JsonProperty("top_relevant_context_rows")
+ private Integer topRelevantContextRows = 0;
+
+ @JsonAnySetter @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /** Default constructor for ExplanationConfig. */
+ protected ExplanationConfig() {}
+
+ /**
+ * Set the topColumnScores of this {@link ExplanationConfig} instance and return the same
+ * instance.
+ *
+ * @param topColumnScores For how many columns to output column scores (optional, default is 0). 0
+ * by default (no explainability). Max value is 20. Minimum: 0 Maximum: 20
+ * @return The same instance of this {@link ExplanationConfig} class
+ */
+ @Nonnull
+ public ExplanationConfig topColumnScores(@Nullable final Integer topColumnScores) {
+ this.topColumnScores = topColumnScores;
+ return this;
+ }
+
+ /**
+ * For how many columns to output column scores (optional, default is 0). 0 by default (no
+ * explainability). Max value is 20. minimum: 0 maximum: 20
+ *
+ * @return topColumnScores The topColumnScores of this {@link ExplanationConfig} instance.
+ */
+ @Nonnull
+ public Integer getTopColumnScores() {
+ return topColumnScores;
+ }
+
+ /**
+ * Set the topColumnScores of this {@link ExplanationConfig} instance.
+ *
+ * @param topColumnScores For how many columns to output column scores (optional, default is 0). 0
+ * by default (no explainability). Max value is 20. Minimum: 0 Maximum: 20
+ */
+ public void setTopColumnScores(@Nullable final Integer topColumnScores) {
+ this.topColumnScores = topColumnScores;
+ }
+
+ /**
+ * Set the topRelevantContextRows of this {@link ExplanationConfig} instance and return the same
+ * instance.
+ *
+ * @param topRelevantContextRows For how many context rows to return indices per query row
+ * (optional, default is 0). 0 by default (no explainability). Max value is 20. Minimum: 0
+ * Maximum: 20
+ * @return The same instance of this {@link ExplanationConfig} class
+ */
+ @Nonnull
+ public ExplanationConfig topRelevantContextRows(@Nullable final Integer topRelevantContextRows) {
+ this.topRelevantContextRows = topRelevantContextRows;
+ return this;
+ }
+
+ /**
+ * For how many context rows to return indices per query row (optional, default is 0). 0 by
+ * default (no explainability). Max value is 20. minimum: 0 maximum: 20
+ *
+ * @return topRelevantContextRows The topRelevantContextRows of this {@link ExplanationConfig}
+ * instance.
+ */
+ @Nonnull
+ public Integer getTopRelevantContextRows() {
+ return topRelevantContextRows;
+ }
+
+ /**
+ * Set the topRelevantContextRows of this {@link ExplanationConfig} instance.
+ *
+ * @param topRelevantContextRows For how many context rows to return indices per query row
+ * (optional, default is 0). 0 by default (no explainability). Max value is 20. Minimum: 0
+ * Maximum: 20
+ */
+ public void setTopRelevantContextRows(@Nullable final Integer topRelevantContextRows) {
+ this.topRelevantContextRows = topRelevantContextRows;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link ExplanationConfig}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link ExplanationConfig} 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("ExplanationConfig has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Get the value of all properties of this {@link ExplanationConfig} instance including
+ * unrecognized properties.
+ *
+ * @return The map of all properties
+ */
+ @JsonIgnore
+ @Nonnull
+ public Map toMap() {
+ final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
+ if (topColumnScores != null) declaredFields.put("topColumnScores", topColumnScores);
+ if (topRelevantContextRows != null)
+ declaredFields.put("topRelevantContextRows", topRelevantContextRows);
+ return declaredFields;
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link ExplanationConfig} 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 ExplanationConfig explanationConfig = (ExplanationConfig) o;
+ return Objects.equals(this.cloudSdkCustomFields, explanationConfig.cloudSdkCustomFields)
+ && Objects.equals(this.topColumnScores, explanationConfig.topColumnScores)
+ && Objects.equals(this.topRelevantContextRows, explanationConfig.topRelevantContextRows);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topColumnScores, topRelevantContextRows, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class ExplanationConfig {\n");
+ sb.append(" topColumnScores: ").append(toIndentedString(topColumnScores)).append("\n");
+ sb.append(" topRelevantContextRows: ")
+ .append(toIndentedString(topRelevantContextRows))
+ .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 ExplanationConfig} instance. No arguments are required. */
+ public static ExplanationConfig create() {
+ return new ExplanationConfig();
+ }
+}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationResult.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationResult.java
new file mode 100644
index 000000000..0215d2d2d
--- /dev/null
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/ExplanationResult.java
@@ -0,0 +1,260 @@
+/*
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
+ *
+ *
+ *
+ * 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.foundationmodels.rpt.generated.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/** Explanation data for predictions. */
+// CHECKSTYLE:OFF
+public class ExplanationResult
+// CHECKSTYLE:ON
+{
+ @JsonProperty("top_column_scores")
+ private List> topColumnScores;
+
+ @JsonProperty("top_relevant_context_rows")
+ private List> topRelevantContextRows;
+
+ @JsonAnySetter @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /** Default constructor for ExplanationResult. */
+ protected ExplanationResult() {}
+
+ /**
+ * Set the topColumnScores of this {@link ExplanationResult} instance and return the same
+ * instance.
+ *
+ * @param topColumnScores Column scores per query row extracted from the model (higher means more
+ * weight was put on this column).
+ * @return The same instance of this {@link ExplanationResult} class
+ */
+ @Nonnull
+ public ExplanationResult topColumnScores(
+ @Nullable final List> topColumnScores) {
+ this.topColumnScores = topColumnScores;
+ return this;
+ }
+
+ /**
+ * Add one topColumnScores instance to this {@link ExplanationResult}.
+ *
+ * @param topColumnScoresItem The topColumnScores that should be added
+ * @return The same instance of type {@link ExplanationResult}
+ */
+ @Nonnull
+ public ExplanationResult addTopColumnScoresItem(
+ @Nonnull final Map topColumnScoresItem) {
+ if (this.topColumnScores == null) {
+ this.topColumnScores = new ArrayList<>();
+ }
+ this.topColumnScores.add(topColumnScoresItem);
+ return this;
+ }
+
+ /**
+ * Column scores per query row extracted from the model (higher means more weight was put on this
+ * column).
+ *
+ * @return topColumnScores The topColumnScores of this {@link ExplanationResult} instance.
+ */
+ @Nullable
+ public List> getTopColumnScores() {
+ return topColumnScores;
+ }
+
+ /**
+ * Set the topColumnScores of this {@link ExplanationResult} instance.
+ *
+ * @param topColumnScores Column scores per query row extracted from the model (higher means more
+ * weight was put on this column).
+ */
+ public void setTopColumnScores(@Nullable final List> topColumnScores) {
+ this.topColumnScores = topColumnScores;
+ }
+
+ /**
+ * Set the topRelevantContextRows of this {@link ExplanationResult} instance and return the same
+ * instance.
+ *
+ * @param topRelevantContextRows 2D array where each subarray contains indices of most relevant
+ * context rows for that query row. The first dimension indexes query rows, the second
+ * dimension indexes all rows as a sequential integer index.
+ * @return The same instance of this {@link ExplanationResult} class
+ */
+ @Nonnull
+ public ExplanationResult topRelevantContextRows(
+ @Nullable final List> topRelevantContextRows) {
+ this.topRelevantContextRows = topRelevantContextRows;
+ return this;
+ }
+
+ /**
+ * Add one topRelevantContextRows instance to this {@link ExplanationResult}.
+ *
+ * @param topRelevantContextRowsItem The topRelevantContextRows that should be added
+ * @return The same instance of type {@link ExplanationResult}
+ */
+ @Nonnull
+ public ExplanationResult addTopRelevantContextRowsItem(
+ @Nonnull final List topRelevantContextRowsItem) {
+ if (this.topRelevantContextRows == null) {
+ this.topRelevantContextRows = new ArrayList<>();
+ }
+ this.topRelevantContextRows.add(topRelevantContextRowsItem);
+ return this;
+ }
+
+ /**
+ * 2D array where each subarray contains indices of most relevant context rows for that query row.
+ * The first dimension indexes query rows, the second dimension indexes all rows as a sequential
+ * integer index.
+ *
+ * @return topRelevantContextRows The topRelevantContextRows of this {@link ExplanationResult}
+ * instance.
+ */
+ @Nullable
+ public List> getTopRelevantContextRows() {
+ return topRelevantContextRows;
+ }
+
+ /**
+ * Set the topRelevantContextRows of this {@link ExplanationResult} instance.
+ *
+ * @param topRelevantContextRows 2D array where each subarray contains indices of most relevant
+ * context rows for that query row. The first dimension indexes query rows, the second
+ * dimension indexes all rows as a sequential integer index.
+ */
+ public void setTopRelevantContextRows(
+ @Nullable final List> topRelevantContextRows) {
+ this.topRelevantContextRows = topRelevantContextRows;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link ExplanationResult}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link ExplanationResult} 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("ExplanationResult has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Get the value of all properties of this {@link ExplanationResult} instance including
+ * unrecognized properties.
+ *
+ * @return The map of all properties
+ */
+ @JsonIgnore
+ @Nonnull
+ public Map toMap() {
+ final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
+ if (topColumnScores != null) declaredFields.put("topColumnScores", topColumnScores);
+ if (topRelevantContextRows != null)
+ declaredFields.put("topRelevantContextRows", topRelevantContextRows);
+ return declaredFields;
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link ExplanationResult} 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 ExplanationResult explanationResult = (ExplanationResult) o;
+ return Objects.equals(this.cloudSdkCustomFields, explanationResult.cloudSdkCustomFields)
+ && Objects.equals(this.topColumnScores, explanationResult.topColumnScores)
+ && Objects.equals(this.topRelevantContextRows, explanationResult.topRelevantContextRows);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(topColumnScores, topRelevantContextRows, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class ExplanationResult {\n");
+ sb.append(" topColumnScores: ").append(toIndentedString(topColumnScores)).append("\n");
+ sb.append(" topRelevantContextRows: ")
+ .append(toIndentedString(topRelevantContextRows))
+ .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 ExplanationResult} instance. No arguments are required. */
+ public static ExplanationResult create() {
+ return new ExplanationResult();
+ }
+}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayload.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayload.java
index ffaab255f..dff188dcb 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayload.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayload.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -11,452 +11,19 @@
package com.sap.ai.sdk.foundationmodels.rpt.generated.model;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
/**
* Users need to specify a list of rows, which contains both the context rows and the rows for which
* to predict a label, and a mapping of column names to placeholder values. The model will predict
- * the value for any column specified in `predict_columns` for all rows that have the
- * placeholder value in that column.
+ * the value for any column specified in `target_columns` for all rows that have the
+ * prediction placeholder in that column. Either \"rows\" or \"columns\" must be
+ * provided, but not both.
*/
-// CHECKSTYLE:OFF
-public class PredictRequestPayload
-// CHECKSTYLE:ON
-{
- @JsonProperty("prediction_config")
- private PredictionConfig predictionConfig;
-
- @JsonProperty("rows")
- private List> rows = new ArrayList<>();
-
- @JsonProperty("columns")
- private Map> columns;
-
- @JsonProperty("index_column")
- private String indexColumn;
-
- @JsonProperty("parse_data_types")
- private Boolean parseDataTypes = true;
-
- @JsonProperty("data_schema")
- private Map dataSchema;
-
- @JsonAnySetter @JsonAnyGetter
- private final Map cloudSdkCustomFields = new LinkedHashMap<>();
-
- /** Default constructor for PredictRequestPayload. */
- protected PredictRequestPayload() {}
-
- /**
- * Set the predictionConfig of this {@link PredictRequestPayload} instance and return the same
- * instance.
- *
- * @param predictionConfig Configuration of target columns and placeholder value.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload predictionConfig(@Nonnull final PredictionConfig predictionConfig) {
- this.predictionConfig = predictionConfig;
- return this;
- }
-
- /**
- * Configuration of target columns and placeholder value.
- *
- * @return predictionConfig The predictionConfig of this {@link PredictRequestPayload} instance.
- */
- @Nonnull
- public PredictionConfig getPredictionConfig() {
- return predictionConfig;
- }
-
- /**
- * Set the predictionConfig of this {@link PredictRequestPayload} instance.
- *
- * @param predictionConfig Configuration of target columns and placeholder value.
- */
- public void setPredictionConfig(@Nonnull final PredictionConfig predictionConfig) {
- this.predictionConfig = predictionConfig;
- }
-
- /**
- * Set the rows of this {@link PredictRequestPayload} instance and return the same instance.
- *
- * @param rows Table rows, i.e. list of objects where each object is a mapping of column names to
- * values. Either \"rows\" or \"columns\" must be provided.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload rows(@Nullable final List> rows) {
- this.rows = rows;
- return this;
- }
-
- /**
- * Add one rows instance to this {@link PredictRequestPayload}.
- *
- * @param rowsItem The rows that should be added
- * @return The same instance of type {@link PredictRequestPayload}
- */
- @Nonnull
- public PredictRequestPayload addRowsItem(@Nonnull final Map rowsItem) {
- if (this.rows == null) {
- this.rows = new ArrayList<>();
- }
- this.rows.add(rowsItem);
- return this;
- }
-
- /**
- * Table rows, i.e. list of objects where each object is a mapping of column names to values.
- * Either \"rows\" or \"columns\" must be provided.
- *
- * @return rows The rows of this {@link PredictRequestPayload} instance.
- */
- @Nonnull
- public List> getRows() {
- return rows;
- }
-
- /**
- * Set the rows of this {@link PredictRequestPayload} instance.
- *
- * @param rows Table rows, i.e. list of objects where each object is a mapping of column names to
- * values. Either \"rows\" or \"columns\" must be provided.
- */
- public void setRows(@Nullable final List> rows) {
- this.rows = rows;
- }
-
- /**
- * Set the columns of this {@link PredictRequestPayload} instance and return the same instance.
- *
- * @param columns Alternative to rows: columns of data where each key is a column name and the
- * value is a list of all column values. Either \"rows\" or \"columns\"
- * must be provided.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload columns(@Nullable final Map> columns) {
- this.columns = columns;
- return this;
- }
-
- /**
- * Put one columns instance to this {@link PredictRequestPayload} instance.
- *
- * @param key The String key of this columns instance
- * @param columnsItem The columns that should be added under the given key
- * @return The same instance of type {@link PredictRequestPayload}
- */
- @Nonnull
- public PredictRequestPayload putcolumnsItem(
- @Nonnull final String key, @Nonnull final List columnsItem) {
- if (this.columns == null) {
- this.columns = new HashMap<>();
- }
- this.columns.put(key, columnsItem);
- return this;
- }
-
- /**
- * Alternative to rows: columns of data where each key is a column name and the value is a list of
- * all column values. Either \"rows\" or \"columns\" must be provided.
- *
- * @return columns The columns of this {@link PredictRequestPayload} instance.
- */
- @Nullable
- public Map> getColumns() {
- return columns;
- }
-
- /**
- * Set the columns of this {@link PredictRequestPayload} instance.
- *
- * @param columns Alternative to rows: columns of data where each key is a column name and the
- * value is a list of all column values. Either \"rows\" or \"columns\"
- * must be provided.
- */
- public void setColumns(@Nullable final Map> columns) {
- this.columns = columns;
- }
-
- /**
- * Set the indexColumn of this {@link PredictRequestPayload} instance and return the same
- * instance.
- *
- * @param indexColumn The name of the index column. If provided, the service will return this
- * column's value in each prediction object to facilitate aligning the output predictions
- * with the input rows on the client side. If not provided, the column will not be included in
- * the output.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload indexColumn(@Nullable final String indexColumn) {
- this.indexColumn = indexColumn;
- return this;
- }
-
- /**
- * The name of the index column. If provided, the service will return this column's value in
- * each prediction object to facilitate aligning the output predictions with the input rows on the
- * client side. If not provided, the column will not be included in the output.
- *
- * @return indexColumn The indexColumn of this {@link PredictRequestPayload} instance.
- */
- @Nullable
- public String getIndexColumn() {
- return indexColumn;
- }
-
- /**
- * Set the indexColumn of this {@link PredictRequestPayload} instance.
- *
- * @param indexColumn The name of the index column. If provided, the service will return this
- * column's value in each prediction object to facilitate aligning the output predictions
- * with the input rows on the client side. If not provided, the column will not be included in
- * the output.
- */
- public void setIndexColumn(@Nullable final String indexColumn) {
- this.indexColumn = indexColumn;
- }
-
- /**
- * Set the parseDataTypes of this {@link PredictRequestPayload} instance and return the same
- * instance.
- *
- * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
- * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
- * parsed.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload parseDataTypes(@Nullable final Boolean parseDataTypes) {
- this.parseDataTypes = parseDataTypes;
- return this;
- }
-
- /**
- * Whether to parse the data types of the columns. If set to True, numeric columns will be parsed
- * to float or integer and dates in ISO format YYYY-MM-DD will be parsed.
- *
- * @return parseDataTypes The parseDataTypes of this {@link PredictRequestPayload} instance.
- */
- @Nonnull
- public Boolean isParseDataTypes() {
- return parseDataTypes;
- }
-
- /**
- * Set the parseDataTypes of this {@link PredictRequestPayload} instance.
- *
- * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
- * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
- * parsed.
- */
- public void setParseDataTypes(@Nullable final Boolean parseDataTypes) {
- this.parseDataTypes = parseDataTypes;
- }
-
- /**
- * Set the dataSchema of this {@link PredictRequestPayload} instance and return the same instance.
- *
- * @param dataSchema Optional schema defining the data types of each column. If provided, this
- * will override automatic data type parsing.
- * @return The same instance of this {@link PredictRequestPayload} class
- */
- @Nonnull
- public PredictRequestPayload dataSchema(
- @Nullable final Map dataSchema) {
- this.dataSchema = dataSchema;
- return this;
- }
-
- /**
- * Put one dataSchema instance to this {@link PredictRequestPayload} instance.
- *
- * @param key The String key of this dataSchema instance
- * @param dataSchemaItem The dataSchema that should be added under the given key
- * @return The same instance of type {@link PredictRequestPayload}
- */
- @Nonnull
- public PredictRequestPayload putdataSchemaItem(
- @Nonnull final String key, @Nonnull final SchemaFieldConfig dataSchemaItem) {
- if (this.dataSchema == null) {
- this.dataSchema = new HashMap<>();
- }
- this.dataSchema.put(key, dataSchemaItem);
- return this;
- }
-
- /**
- * Optional schema defining the data types of each column. If provided, this will override
- * automatic data type parsing.
- *
- * @return dataSchema The dataSchema of this {@link PredictRequestPayload} instance.
- */
- @Nullable
- public Map getDataSchema() {
- return dataSchema;
- }
-
- /**
- * Set the dataSchema of this {@link PredictRequestPayload} instance.
- *
- * @param dataSchema Optional schema defining the data types of each column. If provided, this
- * will override automatic data type parsing.
- */
- public void setDataSchema(@Nullable final Map dataSchema) {
- this.dataSchema = dataSchema;
- }
-
- /**
- * Get the names of the unrecognizable properties of the {@link PredictRequestPayload}.
- *
- * @return The set of properties names
- */
- @JsonIgnore
- @Nonnull
- public Set getCustomFieldNames() {
- return cloudSdkCustomFields.keySet();
- }
-
- /**
- * Get the value of an unrecognizable property of this {@link PredictRequestPayload} 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(
- "PredictRequestPayload has no field with name '" + name + "'.");
- }
- return cloudSdkCustomFields.get(name);
- }
-
- /**
- * Get the value of all properties of this {@link PredictRequestPayload} instance including
- * unrecognized properties.
- *
- * @return The map of all properties
- */
- @JsonIgnore
- @Nonnull
- public Map toMap() {
- final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
- if (predictionConfig != null) declaredFields.put("predictionConfig", predictionConfig);
- if (rows != null) declaredFields.put("rows", rows);
- if (columns != null) declaredFields.put("columns", columns);
- if (indexColumn != null) declaredFields.put("indexColumn", indexColumn);
- if (parseDataTypes != null) declaredFields.put("parseDataTypes", parseDataTypes);
- if (dataSchema != null) declaredFields.put("dataSchema", dataSchema);
- return declaredFields;
- }
-
- /**
- * Set an unrecognizable property of this {@link PredictRequestPayload} 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 PredictRequestPayload predictRequestPayload = (PredictRequestPayload) o;
- return Objects.equals(this.cloudSdkCustomFields, predictRequestPayload.cloudSdkCustomFields)
- && Objects.equals(this.predictionConfig, predictRequestPayload.predictionConfig)
- && Objects.equals(this.rows, predictRequestPayload.rows)
- && Objects.equals(this.columns, predictRequestPayload.columns)
- && Objects.equals(this.indexColumn, predictRequestPayload.indexColumn)
- && Objects.equals(this.parseDataTypes, predictRequestPayload.parseDataTypes)
- && Objects.equals(this.dataSchema, predictRequestPayload.dataSchema);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(
- predictionConfig,
- rows,
- columns,
- indexColumn,
- parseDataTypes,
- dataSchema,
- cloudSdkCustomFields);
- }
-
- @Override
- @Nonnull
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("class PredictRequestPayload {\n");
- sb.append(" predictionConfig: ").append(toIndentedString(predictionConfig)).append("\n");
- sb.append(" rows: ").append(toIndentedString(rows)).append("\n");
- sb.append(" columns: ").append(toIndentedString(columns)).append("\n");
- sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n");
- sb.append(" parseDataTypes: ").append(toIndentedString(parseDataTypes)).append("\n");
- sb.append(" dataSchema: ").append(toIndentedString(dataSchema)).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 PredictRequestPayload}
- * instance with all required arguments.
- */
- public static Builder create() {
- return (predictionConfig) -> new PredictRequestPayload().predictionConfig(predictionConfig);
- }
-
- /** Builder helper class. */
- public interface Builder {
- /**
- * Set the predictionConfig of this {@link PredictRequestPayload} instance.
- *
- * @param predictionConfig Configuration of target columns and placeholder value.
- * @return The PredictRequestPayload instance.
- */
- PredictRequestPayload predictionConfig(@Nonnull final PredictionConfig predictionConfig);
- }
-}
+@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = PredictRequestPayloadOneOf.class),
+ @JsonSubTypes.Type(value = PredictRequestPayloadOneOf1.class),
+})
+public interface PredictRequestPayload {}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf.java
new file mode 100644
index 000000000..a7326ae87
--- /dev/null
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf.java
@@ -0,0 +1,423 @@
+/*
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
+ *
+ *
+ *
+ * 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.foundationmodels.rpt.generated.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/** PredictRequestPayloadOneOf */
+// CHECKSTYLE:OFF
+public class PredictRequestPayloadOneOf implements PredictRequestPayload
+// CHECKSTYLE:ON
+{
+ @JsonProperty("prediction_config")
+ private PredictionConfig predictionConfig;
+
+ @JsonProperty("index_column")
+ private String indexColumn;
+
+ @JsonProperty("parse_data_types")
+ private Boolean parseDataTypes = true;
+
+ @JsonProperty("data_schema")
+ private Map dataSchema;
+
+ @JsonProperty("rows")
+ private List> rows = new ArrayList<>();
+
+ @JsonAnySetter @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /** Default constructor for PredictRequestPayloadOneOf. */
+ protected PredictRequestPayloadOneOf() {}
+
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf} instance and return the
+ * same instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf predictionConfig(
+ @Nonnull final PredictionConfig predictionConfig) {
+ this.predictionConfig = predictionConfig;
+ return this;
+ }
+
+ /**
+ * Configuration of target columns and placeholder value.
+ *
+ * @return predictionConfig The predictionConfig of this {@link PredictRequestPayloadOneOf}
+ * instance.
+ */
+ @Nonnull
+ public PredictionConfig getPredictionConfig() {
+ return predictionConfig;
+ }
+
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ */
+ public void setPredictionConfig(@Nonnull final PredictionConfig predictionConfig) {
+ this.predictionConfig = predictionConfig;
+ }
+
+ /**
+ * Set the indexColumn of this {@link PredictRequestPayloadOneOf} instance and return the same
+ * instance.
+ *
+ * @param indexColumn The name of the index column. If provided, the service will return this
+ * column's value in each prediction object to facilitate aligning the output predictions
+ * with the input rows on the client side. If not provided, the column will not be included in
+ * the output.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf indexColumn(@Nullable final String indexColumn) {
+ this.indexColumn = indexColumn;
+ return this;
+ }
+
+ /**
+ * The name of the index column. If provided, the service will return this column's value in
+ * each prediction object to facilitate aligning the output predictions with the input rows on the
+ * client side. If not provided, the column will not be included in the output.
+ *
+ * @return indexColumn The indexColumn of this {@link PredictRequestPayloadOneOf} instance.
+ */
+ @Nullable
+ public String getIndexColumn() {
+ return indexColumn;
+ }
+
+ /**
+ * Set the indexColumn of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param indexColumn The name of the index column. If provided, the service will return this
+ * column's value in each prediction object to facilitate aligning the output predictions
+ * with the input rows on the client side. If not provided, the column will not be included in
+ * the output.
+ */
+ public void setIndexColumn(@Nullable final String indexColumn) {
+ this.indexColumn = indexColumn;
+ }
+
+ /**
+ * Set the parseDataTypes of this {@link PredictRequestPayloadOneOf} instance and return the same
+ * instance.
+ *
+ * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
+ * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
+ * parsed.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf parseDataTypes(@Nullable final Boolean parseDataTypes) {
+ this.parseDataTypes = parseDataTypes;
+ return this;
+ }
+
+ /**
+ * Whether to parse the data types of the columns. If set to True, numeric columns will be parsed
+ * to float or integer and dates in ISO format YYYY-MM-DD will be parsed.
+ *
+ * @return parseDataTypes The parseDataTypes of this {@link PredictRequestPayloadOneOf} instance.
+ */
+ @Nonnull
+ public Boolean isParseDataTypes() {
+ return parseDataTypes;
+ }
+
+ /**
+ * Set the parseDataTypes of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
+ * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
+ * parsed.
+ */
+ public void setParseDataTypes(@Nullable final Boolean parseDataTypes) {
+ this.parseDataTypes = parseDataTypes;
+ }
+
+ /**
+ * Set the dataSchema of this {@link PredictRequestPayloadOneOf} instance and return the same
+ * instance.
+ *
+ * @param dataSchema Optional schema defining the data types of each column. If provided, this
+ * will override automatic data type parsing.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf dataSchema(
+ @Nullable final Map dataSchema) {
+ this.dataSchema = dataSchema;
+ return this;
+ }
+
+ /**
+ * Put one dataSchema instance to this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param key The String key of this dataSchema instance
+ * @param dataSchemaItem The dataSchema that should be added under the given key
+ * @return The same instance of type {@link PredictRequestPayloadOneOf}
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf putdataSchemaItem(
+ @Nonnull final String key, @Nonnull final SchemaFieldConfig dataSchemaItem) {
+ if (this.dataSchema == null) {
+ this.dataSchema = new HashMap<>();
+ }
+ this.dataSchema.put(key, dataSchemaItem);
+ return this;
+ }
+
+ /**
+ * Optional schema defining the data types of each column. If provided, this will override
+ * automatic data type parsing.
+ *
+ * @return dataSchema The dataSchema of this {@link PredictRequestPayloadOneOf} instance.
+ */
+ @Nullable
+ public Map getDataSchema() {
+ return dataSchema;
+ }
+
+ /**
+ * Set the dataSchema of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param dataSchema Optional schema defining the data types of each column. If provided, this
+ * will override automatic data type parsing.
+ */
+ public void setDataSchema(@Nullable final Map dataSchema) {
+ this.dataSchema = dataSchema;
+ }
+
+ /**
+ * Set the rows of this {@link PredictRequestPayloadOneOf} instance and return the same instance.
+ *
+ * @param rows Table rows, i.e. list of objects where each object is a mapping of column names to
+ * values. Either \"rows\" or \"columns\" must be provided.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf rows(@Nonnull final List> rows) {
+ this.rows = rows;
+ return this;
+ }
+
+ /**
+ * Add one rows instance to this {@link PredictRequestPayloadOneOf}.
+ *
+ * @param rowsItem The rows that should be added
+ * @return The same instance of type {@link PredictRequestPayloadOneOf}
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf addRowsItem(
+ @Nonnull final Map rowsItem) {
+ if (this.rows == null) {
+ this.rows = new ArrayList<>();
+ }
+ this.rows.add(rowsItem);
+ return this;
+ }
+
+ /**
+ * Table rows, i.e. list of objects where each object is a mapping of column names to values.
+ * Either \"rows\" or \"columns\" must be provided.
+ *
+ * @return rows The rows of this {@link PredictRequestPayloadOneOf} instance.
+ */
+ @Nonnull
+ public List> getRows() {
+ return rows;
+ }
+
+ /**
+ * Set the rows of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param rows Table rows, i.e. list of objects where each object is a mapping of column names to
+ * values. Either \"rows\" or \"columns\" must be provided.
+ */
+ public void setRows(@Nonnull final List> rows) {
+ this.rows = rows;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link PredictRequestPayloadOneOf}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link PredictRequestPayloadOneOf}
+ * 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(
+ "PredictRequestPayloadOneOf has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Get the value of all properties of this {@link PredictRequestPayloadOneOf} instance including
+ * unrecognized properties.
+ *
+ * @return The map of all properties
+ */
+ @JsonIgnore
+ @Nonnull
+ public Map toMap() {
+ final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
+ if (predictionConfig != null) declaredFields.put("predictionConfig", predictionConfig);
+ if (indexColumn != null) declaredFields.put("indexColumn", indexColumn);
+ if (parseDataTypes != null) declaredFields.put("parseDataTypes", parseDataTypes);
+ if (dataSchema != null) declaredFields.put("dataSchema", dataSchema);
+ if (rows != null) declaredFields.put("rows", rows);
+ return declaredFields;
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link PredictRequestPayloadOneOf} 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 PredictRequestPayloadOneOf predictRequestPayloadOneOf = (PredictRequestPayloadOneOf) o;
+ return Objects.equals(
+ this.cloudSdkCustomFields, predictRequestPayloadOneOf.cloudSdkCustomFields)
+ && Objects.equals(this.predictionConfig, predictRequestPayloadOneOf.predictionConfig)
+ && Objects.equals(this.indexColumn, predictRequestPayloadOneOf.indexColumn)
+ && Objects.equals(this.parseDataTypes, predictRequestPayloadOneOf.parseDataTypes)
+ && Objects.equals(this.dataSchema, predictRequestPayloadOneOf.dataSchema)
+ && Objects.equals(this.rows, predictRequestPayloadOneOf.rows);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ predictionConfig, indexColumn, parseDataTypes, dataSchema, rows, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class PredictRequestPayloadOneOf {\n");
+ sb.append(" predictionConfig: ").append(toIndentedString(predictionConfig)).append("\n");
+ sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n");
+ sb.append(" parseDataTypes: ").append(toIndentedString(parseDataTypes)).append("\n");
+ sb.append(" dataSchema: ").append(toIndentedString(dataSchema)).append("\n");
+ sb.append(" rows: ").append(toIndentedString(rows)).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
+ * PredictRequestPayloadOneOf} instance with all required arguments.
+ */
+ public static Builder create() {
+ return (predictionConfig) ->
+ (rows) -> new PredictRequestPayloadOneOf().predictionConfig(predictionConfig).rows(rows);
+ }
+
+ /** Builder helper class. */
+ public interface Builder {
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ * @return The PredictRequestPayloadOneOf builder.
+ */
+ Builder1 predictionConfig(@Nonnull final PredictionConfig predictionConfig);
+ }
+
+ /** Builder helper class. */
+ public interface Builder1 {
+ /**
+ * Set the rows of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param rows Table rows, i.e. list of objects where each object is a mapping of column names
+ * to values. Either \"rows\" or \"columns\" must be provided.
+ * @return The PredictRequestPayloadOneOf instance.
+ */
+ PredictRequestPayloadOneOf rows(@Nonnull final List> rows);
+
+ /**
+ * Set the rows of this {@link PredictRequestPayloadOneOf} instance.
+ *
+ * @param rows Table rows, i.e. list of objects where each object is a mapping of column names
+ * to values. Either \"rows\" or \"columns\" must be provided.
+ * @return The PredictRequestPayloadOneOf instance.
+ */
+ default PredictRequestPayloadOneOf rows(@Nonnull final Map... rows) {
+ return rows(Arrays.asList(rows));
+ }
+ }
+}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf1.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf1.java
new file mode 100644
index 000000000..c81d6f335
--- /dev/null
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictRequestPayloadOneOf1.java
@@ -0,0 +1,414 @@
+/*
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
+ *
+ *
+ *
+ * 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.foundationmodels.rpt.generated.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.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+/** PredictRequestPayloadOneOf1 */
+// CHECKSTYLE:OFF
+public class PredictRequestPayloadOneOf1 implements PredictRequestPayload
+// CHECKSTYLE:ON
+{
+ @JsonProperty("prediction_config")
+ private PredictionConfig predictionConfig;
+
+ @JsonProperty("index_column")
+ private String indexColumn;
+
+ @JsonProperty("parse_data_types")
+ private Boolean parseDataTypes = true;
+
+ @JsonProperty("data_schema")
+ private Map dataSchema;
+
+ @JsonProperty("columns")
+ private Map> columns = new HashMap<>();
+
+ @JsonAnySetter @JsonAnyGetter
+ private final Map cloudSdkCustomFields = new LinkedHashMap<>();
+
+ /** Default constructor for PredictRequestPayloadOneOf1. */
+ protected PredictRequestPayloadOneOf1() {}
+
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf1} instance and return the
+ * same instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf1} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 predictionConfig(
+ @Nonnull final PredictionConfig predictionConfig) {
+ this.predictionConfig = predictionConfig;
+ return this;
+ }
+
+ /**
+ * Configuration of target columns and placeholder value.
+ *
+ * @return predictionConfig The predictionConfig of this {@link PredictRequestPayloadOneOf1}
+ * instance.
+ */
+ @Nonnull
+ public PredictionConfig getPredictionConfig() {
+ return predictionConfig;
+ }
+
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ */
+ public void setPredictionConfig(@Nonnull final PredictionConfig predictionConfig) {
+ this.predictionConfig = predictionConfig;
+ }
+
+ /**
+ * Set the indexColumn of this {@link PredictRequestPayloadOneOf1} instance and return the same
+ * instance.
+ *
+ * @param indexColumn The name of the index column. If provided, the service will return this
+ * column's value in each prediction object to facilitate aligning the output predictions
+ * with the input rows on the client side. If not provided, the column will not be included in
+ * the output.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf1} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 indexColumn(@Nullable final String indexColumn) {
+ this.indexColumn = indexColumn;
+ return this;
+ }
+
+ /**
+ * The name of the index column. If provided, the service will return this column's value in
+ * each prediction object to facilitate aligning the output predictions with the input rows on the
+ * client side. If not provided, the column will not be included in the output.
+ *
+ * @return indexColumn The indexColumn of this {@link PredictRequestPayloadOneOf1} instance.
+ */
+ @Nullable
+ public String getIndexColumn() {
+ return indexColumn;
+ }
+
+ /**
+ * Set the indexColumn of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param indexColumn The name of the index column. If provided, the service will return this
+ * column's value in each prediction object to facilitate aligning the output predictions
+ * with the input rows on the client side. If not provided, the column will not be included in
+ * the output.
+ */
+ public void setIndexColumn(@Nullable final String indexColumn) {
+ this.indexColumn = indexColumn;
+ }
+
+ /**
+ * Set the parseDataTypes of this {@link PredictRequestPayloadOneOf1} instance and return the same
+ * instance.
+ *
+ * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
+ * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
+ * parsed.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf1} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 parseDataTypes(@Nullable final Boolean parseDataTypes) {
+ this.parseDataTypes = parseDataTypes;
+ return this;
+ }
+
+ /**
+ * Whether to parse the data types of the columns. If set to True, numeric columns will be parsed
+ * to float or integer and dates in ISO format YYYY-MM-DD will be parsed.
+ *
+ * @return parseDataTypes The parseDataTypes of this {@link PredictRequestPayloadOneOf1} instance.
+ */
+ @Nonnull
+ public Boolean isParseDataTypes() {
+ return parseDataTypes;
+ }
+
+ /**
+ * Set the parseDataTypes of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param parseDataTypes Whether to parse the data types of the columns. If set to True, numeric
+ * columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be
+ * parsed.
+ */
+ public void setParseDataTypes(@Nullable final Boolean parseDataTypes) {
+ this.parseDataTypes = parseDataTypes;
+ }
+
+ /**
+ * Set the dataSchema of this {@link PredictRequestPayloadOneOf1} instance and return the same
+ * instance.
+ *
+ * @param dataSchema Optional schema defining the data types of each column. If provided, this
+ * will override automatic data type parsing.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf1} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 dataSchema(
+ @Nullable final Map dataSchema) {
+ this.dataSchema = dataSchema;
+ return this;
+ }
+
+ /**
+ * Put one dataSchema instance to this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param key The String key of this dataSchema instance
+ * @param dataSchemaItem The dataSchema that should be added under the given key
+ * @return The same instance of type {@link PredictRequestPayloadOneOf1}
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 putdataSchemaItem(
+ @Nonnull final String key, @Nonnull final SchemaFieldConfig dataSchemaItem) {
+ if (this.dataSchema == null) {
+ this.dataSchema = new HashMap<>();
+ }
+ this.dataSchema.put(key, dataSchemaItem);
+ return this;
+ }
+
+ /**
+ * Optional schema defining the data types of each column. If provided, this will override
+ * automatic data type parsing.
+ *
+ * @return dataSchema The dataSchema of this {@link PredictRequestPayloadOneOf1} instance.
+ */
+ @Nullable
+ public Map getDataSchema() {
+ return dataSchema;
+ }
+
+ /**
+ * Set the dataSchema of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param dataSchema Optional schema defining the data types of each column. If provided, this
+ * will override automatic data type parsing.
+ */
+ public void setDataSchema(@Nullable final Map dataSchema) {
+ this.dataSchema = dataSchema;
+ }
+
+ /**
+ * Set the columns of this {@link PredictRequestPayloadOneOf1} instance and return the same
+ * instance.
+ *
+ * @param columns Alternative to rows: columns of data where each key is a column name and the
+ * value is a list of all column values. Either \"rows\" or \"columns\"
+ * must be provided.
+ * @return The same instance of this {@link PredictRequestPayloadOneOf1} class
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 columns(
+ @Nonnull final Map> columns) {
+ this.columns = columns;
+ return this;
+ }
+
+ /**
+ * Put one columns instance to this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param key The String key of this columns instance
+ * @param columnsItem The columns that should be added under the given key
+ * @return The same instance of type {@link PredictRequestPayloadOneOf1}
+ */
+ @Nonnull
+ public PredictRequestPayloadOneOf1 putcolumnsItem(
+ @Nonnull final String key, @Nonnull final List columnsItem) {
+ this.columns.put(key, columnsItem);
+ return this;
+ }
+
+ /**
+ * Alternative to rows: columns of data where each key is a column name and the value is a list of
+ * all column values. Either \"rows\" or \"columns\" must be provided.
+ *
+ * @return columns The columns of this {@link PredictRequestPayloadOneOf1} instance.
+ */
+ @Nonnull
+ public Map> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Set the columns of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param columns Alternative to rows: columns of data where each key is a column name and the
+ * value is a list of all column values. Either \"rows\" or \"columns\"
+ * must be provided.
+ */
+ public void setColumns(@Nonnull final Map> columns) {
+ this.columns = columns;
+ }
+
+ /**
+ * Get the names of the unrecognizable properties of the {@link PredictRequestPayloadOneOf1}.
+ *
+ * @return The set of properties names
+ */
+ @JsonIgnore
+ @Nonnull
+ public Set getCustomFieldNames() {
+ return cloudSdkCustomFields.keySet();
+ }
+
+ /**
+ * Get the value of an unrecognizable property of this {@link PredictRequestPayloadOneOf1}
+ * 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(
+ "PredictRequestPayloadOneOf1 has no field with name '" + name + "'.");
+ }
+ return cloudSdkCustomFields.get(name);
+ }
+
+ /**
+ * Get the value of all properties of this {@link PredictRequestPayloadOneOf1} instance including
+ * unrecognized properties.
+ *
+ * @return The map of all properties
+ */
+ @JsonIgnore
+ @Nonnull
+ public Map toMap() {
+ final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
+ if (predictionConfig != null) declaredFields.put("predictionConfig", predictionConfig);
+ if (indexColumn != null) declaredFields.put("indexColumn", indexColumn);
+ if (parseDataTypes != null) declaredFields.put("parseDataTypes", parseDataTypes);
+ if (dataSchema != null) declaredFields.put("dataSchema", dataSchema);
+ if (columns != null) declaredFields.put("columns", columns);
+ return declaredFields;
+ }
+
+ /**
+ * Set an unrecognizable property of this {@link PredictRequestPayloadOneOf1} 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 PredictRequestPayloadOneOf1 predictRequestPayloadOneOf1 = (PredictRequestPayloadOneOf1) o;
+ return Objects.equals(
+ this.cloudSdkCustomFields, predictRequestPayloadOneOf1.cloudSdkCustomFields)
+ && Objects.equals(this.predictionConfig, predictRequestPayloadOneOf1.predictionConfig)
+ && Objects.equals(this.indexColumn, predictRequestPayloadOneOf1.indexColumn)
+ && Objects.equals(this.parseDataTypes, predictRequestPayloadOneOf1.parseDataTypes)
+ && Objects.equals(this.dataSchema, predictRequestPayloadOneOf1.dataSchema)
+ && Objects.equals(this.columns, predictRequestPayloadOneOf1.columns);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ predictionConfig, indexColumn, parseDataTypes, dataSchema, columns, cloudSdkCustomFields);
+ }
+
+ @Override
+ @Nonnull
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("class PredictRequestPayloadOneOf1 {\n");
+ sb.append(" predictionConfig: ").append(toIndentedString(predictionConfig)).append("\n");
+ sb.append(" indexColumn: ").append(toIndentedString(indexColumn)).append("\n");
+ sb.append(" parseDataTypes: ").append(toIndentedString(parseDataTypes)).append("\n");
+ sb.append(" dataSchema: ").append(toIndentedString(dataSchema)).append("\n");
+ sb.append(" columns: ").append(toIndentedString(columns)).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
+ * PredictRequestPayloadOneOf1} instance with all required arguments.
+ */
+ public static Builder create() {
+ return (predictionConfig) ->
+ (columns) ->
+ new PredictRequestPayloadOneOf1().predictionConfig(predictionConfig).columns(columns);
+ }
+
+ /** Builder helper class. */
+ public interface Builder {
+ /**
+ * Set the predictionConfig of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param predictionConfig Configuration of target columns and placeholder value.
+ * @return The PredictRequestPayloadOneOf1 builder.
+ */
+ Builder1 predictionConfig(@Nonnull final PredictionConfig predictionConfig);
+ }
+
+ /** Builder helper class. */
+ public interface Builder1 {
+ /**
+ * Set the columns of this {@link PredictRequestPayloadOneOf1} instance.
+ *
+ * @param columns Alternative to rows: columns of data where each key is a column name and the
+ * value is a list of all column values. Either \"rows\" or \"columns\"
+ * must be provided.
+ * @return The PredictRequestPayloadOneOf1 instance.
+ */
+ PredictRequestPayloadOneOf1 columns(@Nonnull final Map> columns);
+ }
+}
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseMetadata.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseMetadata.java
index 06a8eede1..7ed265cd0 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseMetadata.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseMetadata.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponsePayload.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponsePayload.java
index c27539238..cb491369f 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponsePayload.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponsePayload.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -40,6 +40,9 @@ public class PredictResponsePayload
@JsonProperty("predictions")
private List> predictions = new ArrayList<>();
+ @JsonProperty("explanations")
+ private ExplanationResult explanations;
+
@JsonProperty("metadata")
private PredictResponseMetadata metadata;
@@ -160,6 +163,38 @@ public void setPredictions(@Nonnull final List toMap() {
if (id != null) declaredFields.put("id", id);
if (status != null) declaredFields.put("status", status);
if (predictions != null) declaredFields.put("predictions", predictions);
+ if (explanations != null) declaredFields.put("explanations", explanations);
if (metadata != null) declaredFields.put("metadata", metadata);
return declaredFields;
}
@@ -262,12 +298,13 @@ public boolean equals(@Nullable final java.lang.Object o) {
&& Objects.equals(this.id, predictResponsePayload.id)
&& Objects.equals(this.status, predictResponsePayload.status)
&& Objects.equals(this.predictions, predictResponsePayload.predictions)
+ && Objects.equals(this.explanations, predictResponsePayload.explanations)
&& Objects.equals(this.metadata, predictResponsePayload.metadata);
}
@Override
public int hashCode() {
- return Objects.hash(id, status, predictions, metadata, cloudSdkCustomFields);
+ return Objects.hash(id, status, predictions, explanations, metadata, cloudSdkCustomFields);
}
@Override
@@ -278,6 +315,7 @@ public String toString() {
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" predictions: ").append(toIndentedString(predictions)).append("\n");
+ sb.append(" explanations: ").append(toIndentedString(explanations)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseStatus.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseStatus.java
index 89bfed250..756da7827 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseStatus.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictResponseStatus.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -43,7 +43,7 @@ protected PredictResponseStatus() {}
/**
* Set the code of this {@link PredictResponseStatus} instance and return the same instance.
*
- * @param code Status code (zero means success, other status codes indicate warnings)
+ * @param code Status code (zero means success, other status codes indicate warnings or errors)
* @return The same instance of this {@link PredictResponseStatus} class
*/
@Nonnull
@@ -53,7 +53,7 @@ public PredictResponseStatus code(@Nonnull final Integer code) {
}
/**
- * Status code (zero means success, other status codes indicate warnings)
+ * Status code (zero means success, other status codes indicate warnings or errors)
*
* @return code The code of this {@link PredictResponseStatus} instance.
*/
@@ -65,7 +65,7 @@ public Integer getCode() {
/**
* Set the code of this {@link PredictResponseStatus} instance.
*
- * @param code Status code (zero means success, other status codes indicate warnings)
+ * @param code Status code (zero means success, other status codes indicate warnings or errors)
*/
public void setCode(@Nonnull final Integer code) {
this.code = code;
@@ -216,7 +216,7 @@ public interface Builder {
/**
* Set the code of this {@link PredictResponseStatus} instance.
*
- * @param code Status code (zero means success, other status codes indicate warnings)
+ * @param code Status code (zero means success, other status codes indicate warnings or errors)
* @return The PredictResponseStatus builder.
*/
Builder1 code(@Nonnull final Integer code);
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/Prediction.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/Prediction.java
index 17a13e67d..e55e3f284 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/Prediction.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/Prediction.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -14,7 +14,7 @@
import java.math.BigDecimal;
import javax.annotation.Nonnull;
-/** The predicted value for the column. */
+/** The predicted value for the column (string for classification, number for regression). */
public interface Prediction {
/** Helper class to create {@code String } that implements {@link Prediction}. */
record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value)
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionConfig.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionConfig.java
index c3c6a014f..82daac6d4 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionConfig.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionConfig.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -34,6 +34,9 @@ public class PredictionConfig
@JsonProperty("target_columns")
private List targetColumns = new ArrayList<>();
+ @JsonProperty("explanations")
+ private ExplanationConfig explanations;
+
@JsonAnySetter @JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
@@ -87,6 +90,39 @@ public void setTargetColumns(@Nonnull final List targetColum
this.targetColumns = targetColumns;
}
+ /**
+ * Set the explanations of this {@link PredictionConfig} instance and return the same instance.
+ *
+ * @param explanations Optional configuration for explainability outputs (column scores and
+ * relevant context rows).
+ * @return The same instance of this {@link PredictionConfig} class
+ */
+ @Nonnull
+ public PredictionConfig explanations(@Nullable final ExplanationConfig explanations) {
+ this.explanations = explanations;
+ return this;
+ }
+
+ /**
+ * Optional configuration for explainability outputs (column scores and relevant context rows).
+ *
+ * @return explanations The explanations of this {@link PredictionConfig} instance.
+ */
+ @Nonnull
+ public ExplanationConfig getExplanations() {
+ return explanations;
+ }
+
+ /**
+ * Set the explanations of this {@link PredictionConfig} instance.
+ *
+ * @param explanations Optional configuration for explainability outputs (column scores and
+ * relevant context rows).
+ */
+ public void setExplanations(@Nullable final ExplanationConfig explanations) {
+ this.explanations = explanations;
+ }
+
/**
* Get the names of the unrecognizable properties of the {@link PredictionConfig}.
*
@@ -126,6 +162,7 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc
public Map toMap() {
final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (targetColumns != null) declaredFields.put("targetColumns", targetColumns);
+ if (explanations != null) declaredFields.put("explanations", explanations);
return declaredFields;
}
@@ -151,12 +188,13 @@ public boolean equals(@Nullable final java.lang.Object o) {
}
final PredictionConfig predictionConfig = (PredictionConfig) o;
return Objects.equals(this.cloudSdkCustomFields, predictionConfig.cloudSdkCustomFields)
- && Objects.equals(this.targetColumns, predictionConfig.targetColumns);
+ && Objects.equals(this.targetColumns, predictionConfig.targetColumns)
+ && Objects.equals(this.explanations, predictionConfig.explanations);
}
@Override
public int hashCode() {
- return Objects.hash(targetColumns, cloudSdkCustomFields);
+ return Objects.hash(targetColumns, explanations, cloudSdkCustomFields);
}
@Override
@@ -165,6 +203,7 @@ public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class PredictionConfig {\n");
sb.append(" targetColumns: ").append(toIndentedString(targetColumns)).append("\n");
+ sb.append(" explanations: ").append(toIndentedString(explanations)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionPlaceholder.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionPlaceholder.java
index a454b170a..adb75ee12 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionPlaceholder.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionPlaceholder.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionResult.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionResult.java
index 431380a7f..d72560269 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionResult.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionResult.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -16,7 +16,9 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
@@ -35,6 +37,9 @@ public class PredictionResult
@JsonProperty("confidence")
private BigDecimal confidence;
+ @JsonProperty("confidence_interval")
+ private List confidenceInterval;
+
@JsonAnySetter @JsonAnyGetter
private final Map cloudSdkCustomFields = new LinkedHashMap<>();
@@ -75,7 +80,8 @@ public void setPrediction(@Nonnull final Prediction prediction) {
/**
* Set the confidence of this {@link PredictionResult} instance and return the same instance.
*
- * @param confidence The confidence of the prediction (currently not provided).
+ * @param confidence The confidence of the prediction (null for regression predictions). Minimum:
+ * 0 Maximum: 1
* @return The same instance of this {@link PredictionResult} class
*/
@Nonnull
@@ -85,7 +91,7 @@ public PredictionResult confidence(@Nullable final BigDecimal confidence) {
}
/**
- * The confidence of the prediction (currently not provided).
+ * The confidence of the prediction (null for regression predictions). minimum: 0 maximum: 1
*
* @return confidence The confidence of this {@link PredictionResult} instance.
*/
@@ -97,12 +103,63 @@ public BigDecimal getConfidence() {
/**
* Set the confidence of this {@link PredictionResult} instance.
*
- * @param confidence The confidence of the prediction (currently not provided).
+ * @param confidence The confidence of the prediction (null for regression predictions). Minimum:
+ * 0 Maximum: 1
*/
public void setConfidence(@Nullable final BigDecimal confidence) {
this.confidence = confidence;
}
+ /**
+ * Set the confidenceInterval of this {@link PredictionResult} instance and return the same
+ * instance.
+ *
+ * @param confidenceInterval Lower and upper bounds of the prediction confidence interval (null
+ * for classification predictions).
+ * @return The same instance of this {@link PredictionResult} class
+ */
+ @Nonnull
+ public PredictionResult confidenceInterval(@Nullable final List confidenceInterval) {
+ this.confidenceInterval = confidenceInterval;
+ return this;
+ }
+
+ /**
+ * Add one confidenceInterval instance to this {@link PredictionResult}.
+ *
+ * @param confidenceIntervalItem The confidenceInterval that should be added
+ * @return The same instance of type {@link PredictionResult}
+ */
+ @Nonnull
+ public PredictionResult addConfidenceIntervalItem(@Nonnull final Object confidenceIntervalItem) {
+ if (this.confidenceInterval == null) {
+ this.confidenceInterval = new ArrayList<>();
+ }
+ this.confidenceInterval.add(confidenceIntervalItem);
+ return this;
+ }
+
+ /**
+ * Lower and upper bounds of the prediction confidence interval (null for classification
+ * predictions).
+ *
+ * @return confidenceInterval The confidenceInterval of this {@link PredictionResult} instance.
+ */
+ @Nullable
+ public List getConfidenceInterval() {
+ return confidenceInterval;
+ }
+
+ /**
+ * Set the confidenceInterval of this {@link PredictionResult} instance.
+ *
+ * @param confidenceInterval Lower and upper bounds of the prediction confidence interval (null
+ * for classification predictions).
+ */
+ public void setConfidenceInterval(@Nullable final List confidenceInterval) {
+ this.confidenceInterval = confidenceInterval;
+ }
+
/**
* Get the names of the unrecognizable properties of the {@link PredictionResult}.
*
@@ -143,6 +200,7 @@ public Map toMap() {
final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (prediction != null) declaredFields.put("prediction", prediction);
if (confidence != null) declaredFields.put("confidence", confidence);
+ if (confidenceInterval != null) declaredFields.put("confidenceInterval", confidenceInterval);
return declaredFields;
}
@@ -169,12 +227,13 @@ public boolean equals(@Nullable final java.lang.Object o) {
final PredictionResult predictionResult = (PredictionResult) o;
return Objects.equals(this.cloudSdkCustomFields, predictionResult.cloudSdkCustomFields)
&& Objects.equals(this.prediction, predictionResult.prediction)
- && Objects.equals(this.confidence, predictionResult.confidence);
+ && Objects.equals(this.confidence, predictionResult.confidence)
+ && Objects.equals(this.confidenceInterval, predictionResult.confidenceInterval);
}
@Override
public int hashCode() {
- return Objects.hash(prediction, confidence, cloudSdkCustomFields);
+ return Objects.hash(prediction, confidence, confidenceInterval, cloudSdkCustomFields);
}
@Override
@@ -184,6 +243,7 @@ public String toString() {
sb.append("class PredictionResult {\n");
sb.append(" prediction: ").append(toIndentedString(prediction)).append("\n");
sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n");
+ sb.append(" confidenceInterval: ").append(toIndentedString(confidenceInterval)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionsInnerValue.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionsInnerValue.java
index d817ff9fb..fc2a6abfe 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionsInnerValue.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/PredictionsInnerValue.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/RowsInnerValue.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/RowsInnerValue.java
index 286c7006c..f16085811 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/RowsInnerValue.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/RowsInnerValue.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/SchemaFieldConfig.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/SchemaFieldConfig.java
index c089bfd3b..19e6952b6 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/SchemaFieldConfig.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/SchemaFieldConfig.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -40,8 +40,9 @@ protected SchemaFieldConfig() {}
/**
* Set the dtype of this {@link SchemaFieldConfig} instance and return the same instance.
*
- * @param dtype The data type of the target column. Supported types are ['string',
- * 'numeric', 'date'].
+ * @param dtype The data type of the column. Supports base types (string, numeric, date) and
+ * extended types (e.g., Boolean, Integer, Timestamp). Extended types are mapped to
+ * corresponding base types internally. Case-insensitive.
* @return The same instance of this {@link SchemaFieldConfig} class
*/
@Nonnull
@@ -51,8 +52,9 @@ public SchemaFieldConfig dtype(@Nonnull final ColumnType dtype) {
}
/**
- * The data type of the target column. Supported types are ['string', 'numeric',
- * 'date'].
+ * The data type of the column. Supports base types (string, numeric, date) and extended types
+ * (e.g., Boolean, Integer, Timestamp). Extended types are mapped to corresponding base types
+ * internally. Case-insensitive.
*
* @return dtype The dtype of this {@link SchemaFieldConfig} instance.
*/
@@ -64,8 +66,9 @@ public ColumnType getDtype() {
/**
* Set the dtype of this {@link SchemaFieldConfig} instance.
*
- * @param dtype The data type of the target column. Supported types are ['string',
- * 'numeric', 'date'].
+ * @param dtype The data type of the column. Supports base types (string, numeric, date) and
+ * extended types (e.g., Boolean, Integer, Timestamp). Extended types are mapped to
+ * corresponding base types internally. Case-insensitive.
*/
public void setDtype(@Nonnull final ColumnType dtype) {
this.dtype = dtype;
@@ -179,8 +182,9 @@ public interface Builder {
/**
* Set the dtype of this {@link SchemaFieldConfig} instance.
*
- * @param dtype The data type of the target column. Supported types are ['string',
- * 'numeric', 'date'].
+ * @param dtype The data type of the column. Supports base types (string, numeric, date) and
+ * extended types (e.g., Boolean, Integer, Timestamp). Extended types are mapped to
+ * corresponding base types internally. Case-insensitive.
* @return The SchemaFieldConfig instance.
*/
SchemaFieldConfig dtype(@Nonnull final ColumnType dtype);
diff --git a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/TargetColumnConfig.java b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/TargetColumnConfig.java
index c44ecaea0..7496e5f2a 100644
--- a/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/TargetColumnConfig.java
+++ b/foundation-models/sap-rpt/src/main/java/com/sap/ai/sdk/foundationmodels/rpt/generated/model/TargetColumnConfig.java
@@ -1,6 +1,6 @@
/*
- * SAP-RPT-1 Tabular AI
- * A REST API for in-context learning with the SAP-RPT-1 model.
+ * SAP RPT
+ * A REST API for in-context learning with SAP RPT models.
*
*
*
@@ -145,7 +145,7 @@ public void setName(@Nonnull final String name) {
*/
@Nonnull
public TargetColumnConfig predictionPlaceholder(
- @Nonnull final PredictionPlaceholder predictionPlaceholder) {
+ @Nullable final PredictionPlaceholder predictionPlaceholder) {
this.predictionPlaceholder = predictionPlaceholder;
return this;
}
@@ -156,7 +156,7 @@ public TargetColumnConfig predictionPlaceholder(
* @return predictionPlaceholder The predictionPlaceholder of this {@link TargetColumnConfig}
* instance.
*/
- @Nonnull
+ @Nullable
public PredictionPlaceholder getPredictionPlaceholder() {
return predictionPlaceholder;
}
@@ -166,7 +166,8 @@ public PredictionPlaceholder getPredictionPlaceholder() {
*
* @param predictionPlaceholder The predictionPlaceholder of this {@link TargetColumnConfig}
*/
- public void setPredictionPlaceholder(@Nonnull final PredictionPlaceholder predictionPlaceholder) {
+ public void setPredictionPlaceholder(
+ @Nullable final PredictionPlaceholder predictionPlaceholder) {
this.predictionPlaceholder = predictionPlaceholder;
}
@@ -338,6 +339,6 @@ public interface Builder1 {
* @return The TargetColumnConfig instance.
*/
TargetColumnConfig predictionPlaceholder(
- @Nonnull final PredictionPlaceholder predictionPlaceholder);
+ @Nullable final PredictionPlaceholder predictionPlaceholder);
}
}
diff --git a/foundation-models/sap-rpt/src/main/resources/spec/sap-rpt-1_openapi.json b/foundation-models/sap-rpt/src/main/resources/spec/sap-rpt_openapi.json
similarity index 58%
rename from foundation-models/sap-rpt/src/main/resources/spec/sap-rpt-1_openapi.json
rename to foundation-models/sap-rpt/src/main/resources/spec/sap-rpt_openapi.json
index a047fb708..e3df281fd 100644
--- a/foundation-models/sap-rpt/src/main/resources/spec/sap-rpt-1_openapi.json
+++ b/foundation-models/sap-rpt/src/main/resources/spec/sap-rpt_openapi.json
@@ -1,160 +1,36 @@
{
"openapi": "3.1.0",
"info": {
- "title": "SAP-RPT-1 Tabular AI",
- "description": "A REST API for in-context learning with the SAP-RPT-1 model.",
- "version": "0.1.0",
- "x-logo": {
- "url": "https://www.sap.com/favicon.ico"
- }
+ "title": "SAP RPT",
+ "description": "A REST API for in-context learning with SAP RPT models.",
+ "version": "1.5.0"
},
"servers": [
{
- "url": "/v1"
+ "url": "/"
}
],
"paths": {
+ "/health": {
+ "get": {
+ "summary": "Health Check",
+ "operationId": "health",
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ }
+ }
+ },
"/predict": {
"post": {
- "summary": "Make in-context predictions for specified target columns based on provided table data JSON (optionally gzip-compressed).",
- "description": "Make in-context predictions for specified target columns.\nEither \"rows\" or \"columns\" must be provided and must contain both context and query rows.\nYou can optionally send gzip-compressed JSON payloads and set a \"Content-Encoding: gzip\" header.",
+ "summary": "Make predictions from JSON (optionally gzip-compressed).",
"operationId": "predict",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PredictRequestPayload"
- },
- "examples": {
- "classification_example": {
- "summary": "Classification Example",
- "description": "Predict product category using in-context learning",
- "value": {
- "index_column": "id",
- "prediction_config": {
- "target_columns": [
- {
- "name": "category",
- "prediction_placeholder": "?",
- "task_type": "classification"
- }
- ]
- },
- "columns": {
- "id": [1, 2, 3, 4],
- "product": [
- "Laptop",
- "Mouse",
- "Keyboard",
- "Monitor"
- ],
- "price": [899, 25, 75, 350],
- "category": [
- "Electronics",
- "Accessories",
- "Accessories",
- "?"
- ],
- "stock": [
- "150",
- "500",
- "320",
- "200"
- ]
- },
- "data_schema": {
- "id": {
- "dtype": "numeric"
- },
- "product": {
- "dtype": "string"
- },
- "price": {
- "dtype": "numeric"
- },
- "category": {
- "dtype": "string"
- },
- "stock": {
- "dtype": "numeric"
- }
- }
- }
- },
- "regression_example": {
- "summary": "Regression Example",
- "description": "Predict multiple columns including regression using in-context learning",
- "value": {
- "index_column": "ID",
- "prediction_config": {
- "target_columns": [
- {
- "name": "PRICE",
- "prediction_placeholder": "[?]",
- "task_type": "regression"
- },
- {
- "name": "COSTCENTER",
- "prediction_placeholder": "[PREDICT]",
- "task_type": "classification"
- }
- ]
- },
- "columns": {
- "PRODUCT": [
- "Couch",
- "Office Chair",
- "Server Rack",
- "Server Rack"
- ],
- "PRICE": [
- "[?]",
- 150.8, "210.0",
- "[?]"
- ],
- "ORDERDATE": [
- "2025-11-28",
- "2025-11-02",
- "2025-11-01",
- "2025-11-01"
- ],
- "ID": [
- "35",
- "44",
- "108",
- "104"
- ],
- "COSTCENTER": [
- "[PREDICT]",
- "Office Furniture",
- "Data Infrastructure",
- "[PREDICT]"
- ]
- },
- "data_schema": {
- "PRODUCT": {
- "dtype": "string"
- },
- "PRICE": {
- "dtype": "numeric"
- },
- "ORDERDATE": {
- "dtype": "date"
- },
- "ID": {
- "dtype": "string"
- },
- "COSTCENTER": {
- "dtype": "string"
- }
- }
- }
- }
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"description": "Successful Prediction",
@@ -179,7 +55,11 @@
],
"PRICE": [
{
- "prediction": 195.090179443359
+ "prediction": 195.09017944335938,
+ "confidence_interval": [
+ 191.4201023,
+ 198.7602565
+ ]
}
],
"ID": "35"
@@ -188,17 +68,45 @@
"COSTCENTER": [
{
"prediction": "Data Infrastructure",
- "confidence": 1
+ "confidence": 1.0
}
],
"PRICE": [
{
- "prediction": 209.380523681641
+ "prediction": 209.38052368164062,
+ "confidence_interval": [
+ 198.182501013,
+ 220.57854635
+ ]
}
],
"ID": "104"
}
],
+ "explanations": {
+ "top_column_scores": [
+ {
+ "PRODUCT": 0.08,
+ "ORDERDATE": 0.03
+ },
+ {
+ "PRODUCT": 0.07,
+ "ORDERDATE": 0.02
+ }
+ ],
+ "top_relevant_context_rows": [
+ [
+ 3,
+ 4,
+ 1
+ ],
+ [
+ 2,
+ 1,
+ 4
+ ]
+ ]
+ },
"metadata": {
"num_columns": 5,
"num_rows": 2,
@@ -246,7 +154,7 @@
"detail": [
{
"loc": [],
- "msg": "Request body too large (\u003E10485760 bytes)",
+ "msg": "Request body too large (>576716800 bytes)",
"type": "value_error"
}
]
@@ -292,20 +200,201 @@
}
}
}
+ },
+ "503": {
+ "description": "Service Unavailable",
+ "content": {
+ "application/json": {
+ "example": {
+ "id": "550e8400-e29b-41d4-a716-446655440000",
+ "status": {
+ "code": 4,
+ "message": "Server under high load, please try again later"
+ },
+ "detail": []
+ }
+ }
+ }
}
- }
+ },
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PredictRequestPayload"
+ },
+ "examples": {
+ "classification_example": {
+ "summary": "Classification Example",
+ "description": "Predict product category using in-context learning",
+ "value": {
+ "index_column": "id",
+ "prediction_config": {
+ "target_columns": [
+ {
+ "name": "category",
+ "prediction_placeholder": "?",
+ "task_type": "classification",
+ "top_k": 1
+ }
+ ]
+ },
+ "columns": {
+ "id": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "product": [
+ "Laptop",
+ "Mouse",
+ "Keyboard",
+ "Monitor"
+ ],
+ "price": [
+ 899,
+ 25,
+ 75,
+ 350
+ ],
+ "category": [
+ "Electronics",
+ "Accessories",
+ "Accessories",
+ "?"
+ ],
+ "stock": [
+ "150",
+ "500",
+ "320",
+ "200"
+ ]
+ },
+ "data_schema": {
+ "id": {
+ "dtype": "numeric"
+ },
+ "product": {
+ "dtype": "string"
+ },
+ "price": {
+ "dtype": "numeric"
+ },
+ "category": {
+ "dtype": "string"
+ },
+ "stock": {
+ "dtype": "numeric"
+ }
+ }
+ }
+ },
+ "regression_example": {
+ "summary": "Regression Example",
+ "description": "Predict multiple columns including regression using in-context learning (note that you can also use null or numeric values as placeholders)",
+ "value": {
+ "index_column": "ID",
+ "prediction_config": {
+ "target_columns": [
+ {
+ "name": "PRICE",
+ "prediction_placeholder": "[?]",
+ "task_type": "regression"
+ },
+ {
+ "name": "COSTCENTER",
+ "prediction_placeholder": "[PREDICT]",
+ "task_type": "classification"
+ }
+ ]
+ },
+ "columns": {
+ "PRODUCT": [
+ "Couch",
+ "Office Chair",
+ "Server Rack",
+ "Server Rack"
+ ],
+ "PRICE": [
+ "[?]",
+ 150.8,
+ "210.0",
+ "[?]"
+ ],
+ "ORDERDATE": [
+ "2025-11-28",
+ "2025-11-02",
+ "2025-11-01",
+ "2025-11-01"
+ ],
+ "ID": [
+ "35",
+ "44",
+ "108",
+ "104"
+ ],
+ "COSTCENTER": [
+ "[PREDICT]",
+ "Office Furniture",
+ "Data Infrastructure",
+ "[PREDICT]"
+ ]
+ },
+ "data_schema": {
+ "PRODUCT": {
+ "dtype": "string"
+ },
+ "PRICE": {
+ "dtype": "numeric"
+ },
+ "ORDERDATE": {
+ "dtype": "date"
+ },
+ "ID": {
+ "dtype": "string"
+ },
+ "COSTCENTER": {
+ "dtype": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "Content-Encoding",
+ "in": "header",
+ "description": "Content encoding of the request body. Use 'gzip' for gzip-compressed payloads. Use compression level 1.",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "gzip"
+ ]
+ }
+ }
+ ]
}
},
"/predict_parquet": {
"post": {
- "summary": "Make in-context predictions for specified target columns based on provided table data Parquet file.",
- "description": "Make in-context predictions for specified target columns based on provided table data Parquet file.",
+ "summary": "Make predictions from Parquet file",
"operationId": "predict_parquet",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/Body_predict_parquet"
+ },
+ "encoding": {
+ "file": {
+ "contentType": "application/vnd.apache.parquet"
+ }
}
}
},
@@ -335,7 +424,11 @@
],
"PRICE": [
{
- "prediction": 195.090179443359
+ "prediction": 195.09017944335938,
+ "confidence_interval": [
+ 191.4201023,
+ 198.7602565
+ ]
}
],
"ID": "35"
@@ -344,17 +437,45 @@
"COSTCENTER": [
{
"prediction": "Data Infrastructure",
- "confidence": 1
+ "confidence": 1.0
}
],
"PRICE": [
{
- "prediction": 209.380523681641
+ "prediction": 209.38052368164062,
+ "confidence_interval": [
+ 198.182501013,
+ 220.57854635
+ ]
}
],
"ID": "104"
}
],
+ "explanations": {
+ "top_column_scores": [
+ {
+ "PRODUCT": 0.08,
+ "ORDERDATE": 0.03
+ },
+ {
+ "PRODUCT": 0.07,
+ "ORDERDATE": 0.02
+ }
+ ],
+ "top_relevant_context_rows": [
+ [
+ 3,
+ 4,
+ 1
+ ],
+ [
+ 2,
+ 1,
+ 4
+ ]
+ ]
+ },
"metadata": {
"num_columns": 5,
"num_rows": 2,
@@ -402,7 +523,7 @@
"detail": [
{
"loc": [],
- "msg": "Request body too large (\u003E10485760 bytes)",
+ "msg": "Request body too large (>10485760 bytes)",
"type": "value_error"
}
]
@@ -448,6 +569,21 @@
}
}
}
+ },
+ "503": {
+ "description": "Service Unavailable",
+ "content": {
+ "application/json": {
+ "example": {
+ "id": "550e8400-e29b-41d4-a716-446655440000",
+ "status": {
+ "code": 4,
+ "message": "Server under high load, please try again later"
+ },
+ "detail": []
+ }
+ }
+ }
}
}
}
@@ -459,25 +595,27 @@
"properties": {
"file": {
"type": "string",
- "format": "binary",
- "title": "File",
- "description": "Parquet file containing the data"
+ "contentMediaType": "application/vnd.apache.parquet",
+ "title": "File"
},
"prediction_config": {
"type": "string",
"title": "Prediction Config",
- "description": "JSON string for prediction_config"
+ "description": "JSON string containing the prediction configuration (see PredictionConfig schema).",
+ "example": "{\"target_columns\":[{\"name\": \"PRICE\",\"prediction_placeholder\": null,\"task_type\": \"regression\"}]}",
+ "contentMediaType": "application/json",
+ "contentSchema": {
+ "$ref": "#/components/schemas/PredictionConfig"
+ }
},
"index_column": {
"type": "string",
- "title": "Index Column",
- "description": "Optional index column name"
+ "title": "Index Column"
},
"parse_data_types": {
"type": "boolean",
"title": "Parse Data Types",
- "description": "Whether to parse data types",
- "default": true
+ "default": false
}
},
"type": "object",
@@ -487,6 +625,49 @@
],
"title": "Body_predict_parquet"
},
+ "ExplanationResult": {
+ "properties": {
+ "top_column_scores": {
+ "anyOf": [
+ {
+ "items": {
+ "additionalProperties": {
+ "type": "number"
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Top Column Scores",
+ "description": "Column scores per query row extracted from the model (higher means more weight was put on this column)."
+ },
+ "top_relevant_context_rows": {
+ "anyOf": [
+ {
+ "items": {
+ "items": {
+ "type": "integer"
+ },
+ "type": "array"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Top Relevant Context Rows",
+ "description": "2D array where each subarray contains indices of most relevant context rows for that query row. The first dimension indexes query rows, the second dimension indexes all rows as a sequential integer index."
+ }
+ },
+ "type": "object",
+ "title": "ExplanationResult",
+ "description": "Explanation data for predictions."
+ },
"PredictResponseMetadata": {
"properties": {
"num_columns": {
@@ -555,6 +736,17 @@
"title": "Predictions",
"description": "Mapping of column names to their list of prediction results or index column."
},
+ "explanations": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/ExplanationResult"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Explanation data containing context row and column scores."
+ },
"metadata": {
"$ref": "#/components/schemas/PredictResponseMetadata"
}
@@ -575,7 +767,7 @@
"code": {
"type": "integer",
"title": "Code",
- "description": "Status code (zero means success, other status codes indicate warnings)"
+ "description": "Status code (zero means success, other status codes indicate warnings or errors)"
},
"message": {
"type": "string",
@@ -603,19 +795,43 @@
}
],
"title": "Prediction",
- "description": "The predicted value for the column."
+ "description": "The predicted value for the column (string for classification, number for regression)."
},
"confidence": {
"anyOf": [
{
- "type": "number"
+ "type": "number",
+ "minimum": 0,
+ "maximum": 1
},
{
"type": "null"
}
],
"title": "Confidence",
- "description": "The confidence of the prediction (currently not provided)."
+ "description": "The confidence of the prediction (null for regression predictions)."
+ },
+ "confidence_interval": {
+ "anyOf": [
+ {
+ "prefixItems": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "number"
+ }
+ ],
+ "type": "array",
+ "maxItems": 2,
+ "minItems": 2
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Confidence Interval",
+ "description": "Lower and upper bounds of the prediction confidence interval (null for classification predictions)."
}
},
"additionalProperties": true,
@@ -627,14 +843,52 @@
"description": "A single prediction result for a single column in a single row."
},
"ColumnType": {
+ "description": "Supported column data types for the data schema.\n\nIncludes base types (string, numeric, date) and additional types\nderived from SAP CDS (https://cap.cloud.sap/docs/cds/types#core-built-in-types).\nAdditional types are mapped to the corresponding base type internally.\nAll values are lowercase for case-insensitive matching.",
"enum": [
"string",
"numeric",
- "date"
+ "date",
+ "boolean",
+ "largestring",
+ "uuid",
+ "integer",
+ "int16",
+ "int32",
+ "int64",
+ "uint8",
+ "decimal",
+ "double",
+ "time",
+ "datetime",
+ "timestamp"
],
"title": "ColumnType",
"type": "string"
},
+ "ExplanationConfig": {
+ "additionalProperties": false,
+ "description": "Configuration for explainability outputs.",
+ "properties": {
+ "top_column_scores": {
+ "default": 0,
+ "description": "For how many columns to output column scores (optional, default is 0). 0 by default (no explainability). Max value is 20.",
+ "maximum": 20,
+ "minimum": 0,
+ "title": "Top Column Scores",
+ "type": "integer"
+ },
+ "top_relevant_context_rows": {
+ "default": 0,
+ "description": "For how many context rows to return indices per query row (optional, default is 0). 0 by default (no explainability). Max value is 20.",
+ "maximum": 20,
+ "minimum": 0,
+ "title": "Top Relevant Context Rows",
+ "type": "integer"
+ }
+ },
+ "title": "ExplanationConfig",
+ "type": "object"
+ },
"PredictionConfig": {
"additionalProperties": false,
"description": "Configuration of the prediction model.",
@@ -645,6 +899,10 @@
},
"title": "Target Columns",
"type": "array"
+ },
+ "explanations": {
+ "$ref": "#/components/schemas/ExplanationConfig",
+ "description": "Optional configuration for explainability outputs (column scores and relevant context rows)."
}
},
"required": [
@@ -654,11 +912,12 @@
"type": "object"
},
"SchemaFieldConfig": {
+ "additionalProperties": false,
"description": "Configuration for a single field in the input data schema.",
"properties": {
"dtype": {
"$ref": "#/components/schemas/ColumnType",
- "description": "The data type of the target column. Supported types are ['string', 'numeric', 'date']."
+ "description": "The data type of the column. Supports base types (string, numeric, date) and extended types (e.g., Boolean, Integer, Timestamp). Extended types are mapped to corresponding base types internally. Case-insensitive."
}
},
"required": [
@@ -668,6 +927,7 @@
"type": "object"
},
"TargetColumnConfig": {
+ "additionalProperties": false,
"description": "Configuration for a target column in the prediction model.",
"properties": {
"name": {
@@ -682,6 +942,9 @@
},
{
"type": "number"
+ },
+ {
+ "type": "null"
}
],
"description": "The placeholder value in any column for which to predict a value. The model will predict a value for all table cells containing this value.",
@@ -714,7 +977,7 @@
}
],
"default": null,
- "description": "How many predictions to output per classification column.If not provided, only a single prediction is returned. Only relevant for classification.",
+ "description": "How many predictions to output for this classification column.If not provided, only a single prediction is returned. Only relevant for classification.",
"title": "Top K"
}
},
@@ -726,43 +989,53 @@
"type": "object"
},
"PredictRequestPayload": {
- "additionalProperties": false,
- "description": "Users need to specify a list of rows, which contains both the context rows\nand the rows for which to predict a label, and a mapping of column names\nto placeholder values. The model will predict the value for any column\nspecified in `predict_columns` for all rows that have the placeholder\nvalue in that column.",
- "properties": {
- "prediction_config": {
- "$ref": "#/components/schemas/PredictionConfig",
- "description": "Configuration of target columns and placeholder value."
- },
- "rows": {
- "default": null,
- "description": "Table rows, i.e. list of objects where each object is a mapping of column names to values. Either \"rows\" or \"columns\" must be provided.",
- "items": {
- "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "prediction_config": {
+ "$ref": "#/components/schemas/PredictionConfig",
+ "description": "Configuration of target columns and placeholder value."
+ },
+ "index_column": {
"anyOf": [
{
"type": "string"
},
{
- "type": "number"
- },
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The name of the index column. If provided, the service will return this column's value in each prediction object to facilitate aligning the output predictions with the input rows on the client side. If not provided, the column will not be included in the output.",
+ "title": "Index Column"
+ },
+ "parse_data_types": {
+ "default": true,
+ "description": "Whether to parse the data types of the columns. If set to True, numeric columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be parsed.",
+ "title": "Parse Data Types",
+ "type": "boolean"
+ },
+ "data_schema": {
+ "anyOf": [
{
- "type": "integer"
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SchemaFieldConfig"
+ },
+ "type": "object"
},
{
"type": "null"
}
- ]
+ ],
+ "default": null,
+ "description": "Optional schema defining the data types of each column. If provided, this will override automatic data type parsing.",
+ "title": "Data Schema"
},
- "type": "object"
- },
- "title": "Rows",
- "type": "array"
- },
- "columns": {
- "anyOf": [
- {
- "additionalProperties": {
- "items": {
+ "rows": {
+ "description": "Table rows, i.e. list of objects where each object is a mapping of column names to values. Either \"rows\" or \"columns\" must be provided.",
+ "items": {
+ "additionalProperties": {
"anyOf": [
{
"type": "string"
@@ -778,59 +1051,93 @@
}
]
},
- "type": "array"
+ "type": "object"
},
- "type": "object"
- },
- {
- "type": "null"
+ "title": "Rows",
+ "type": "array"
}
+ },
+ "required": [
+ "prediction_config",
+ "rows"
],
- "default": null,
- "description": "Alternative to rows: columns of data where each key is a column name and the value is a list of all column values. Either \"rows\" or \"columns\" must be provided.",
- "title": "Columns"
+ "additionalProperties": false
},
- "index_column": {
- "anyOf": [
- {
- "type": "string"
+ {
+ "type": "object",
+ "properties": {
+ "prediction_config": {
+ "$ref": "#/components/schemas/PredictionConfig",
+ "description": "Configuration of target columns and placeholder value."
},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The name of the index column. If provided, the service will return this column's value in each prediction object to facilitate aligning the output predictions with the input rows on the client side. If not provided, the column will not be included in the output.",
- "title": "Index Column"
- },
- "parse_data_types": {
- "default": true,
- "description": "Whether to parse the data types of the columns. If set to True, numeric columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be parsed.",
- "title": "Parse Data Types",
- "type": "boolean"
- },
- "data_schema": {
- "anyOf": [
- {
+ "index_column": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The name of the index column. If provided, the service will return this column's value in each prediction object to facilitate aligning the output predictions with the input rows on the client side. If not provided, the column will not be included in the output.",
+ "title": "Index Column"
+ },
+ "parse_data_types": {
+ "default": true,
+ "description": "Whether to parse the data types of the columns. If set to True, numeric columns will be parsed to float or integer and dates in ISO format YYYY-MM-DD will be parsed.",
+ "title": "Parse Data Types",
+ "type": "boolean"
+ },
+ "data_schema": {
+ "anyOf": [
+ {
+ "additionalProperties": {
+ "$ref": "#/components/schemas/SchemaFieldConfig"
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Optional schema defining the data types of each column. If provided, this will override automatic data type parsing.",
+ "title": "Data Schema"
+ },
+ "columns": {
+ "description": "Alternative to rows: columns of data where each key is a column name and the value is a list of all column values. Either \"rows\" or \"columns\" must be provided.",
+ "title": "Columns",
"additionalProperties": {
- "$ref": "#/components/schemas/SchemaFieldConfig"
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": "array"
},
"type": "object"
- },
- {
- "type": "null"
}
+ },
+ "required": [
+ "prediction_config",
+ "columns"
],
- "default": null,
- "description": "Optional schema defining the data types of each column. If provided, this will override automatic data type parsing.",
- "title": "Data Schema"
+ "additionalProperties": false
}
- },
- "required": [
- "prediction_config"
],
- "title": "PredictRequestPayload",
- "type": "object"
+ "description": "Users need to specify a list of rows, which contains both the context rows and the rows for which to predict a label, and a mapping of column names to placeholder values. The model will predict the value for any column specified in `target_columns` for all rows that have the prediction placeholder in that column. Either \"rows\" or \"columns\" must be provided, but not both."
}
}
}
diff --git a/foundation-models/sap-rpt/src/test/java/com/sap/ai/sdk/foundationmodels/rpt/RptClientTest.java b/foundation-models/sap-rpt/src/test/java/com/sap/ai/sdk/foundationmodels/rpt/RptClientTest.java
index 81cbb09d5..9ec307fa4 100644
--- a/foundation-models/sap-rpt/src/test/java/com/sap/ai/sdk/foundationmodels/rpt/RptClientTest.java
+++ b/foundation-models/sap-rpt/src/test/java/com/sap/ai/sdk/foundationmodels/rpt/RptClientTest.java
@@ -1,5 +1,7 @@
package com.sap.ai.sdk.foundationmodels.rpt;
+import static com.sap.ai.sdk.foundationmodels.rpt.generated.model.ColumnType.STRING;
+import static com.sap.ai.sdk.foundationmodels.rpt.generated.model.TargetColumnConfig.TaskTypeEnum.CLASSIFICATION;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
@@ -16,13 +18,12 @@
import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor;
import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache;
import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination;
-import java.io.File;
-import java.io.IOException;
import java.math.BigDecimal;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import lombok.SneakyThrows;
+import lombok.val;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericRecord;
@@ -39,6 +40,21 @@
class RptClientTest {
private static RptClient client;
+ private static final Map DATA_SCHEMA =
+ Map.of(
+ "PRODUCT", SchemaFieldConfig.create().dtype(STRING),
+ "PRICE", SchemaFieldConfig.create().dtype(STRING),
+ "ORDERDATE", SchemaFieldConfig.create().dtype(ColumnType.DATE),
+ "ID", SchemaFieldConfig.create().dtype(STRING),
+ "COSTCENTER", SchemaFieldConfig.create().dtype(STRING));
+
+ private static final List TARGET_COLUMN =
+ List.of(
+ TargetColumnConfig.create()
+ .name("COSTCENTER")
+ .predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
+ .taskType(CLASSIFICATION));
+
@BeforeEach
void setup(final WireMockRuntimeInfo server) {
final DefaultHttpDestination destination =
@@ -49,39 +65,17 @@ void setup(final WireMockRuntimeInfo server) {
@Test
void testRptModels() {
- assertThat(RptModel.SAP_RPT_1_SMALL.name()).isEqualTo("sap-rpt-1-small");
- assertThat(RptModel.SAP_RPT_1_SMALL.version()).isNull();
+ assertThat(RptModel.SAP_RPT_15.name()).isEqualTo("sap-rpt-1.5");
+ assertThat(RptModel.SAP_RPT_15.version()).isNull();
- assertThat(RptModel.SAP_RPT_1_LARGE.name()).isEqualTo("sap-rpt-1-large");
- assertThat(RptModel.SAP_RPT_1_LARGE.version()).isNull();
+ assertThat(RptModel.SAP_RPT_15_LARGE.name()).isEqualTo("sap-rpt-1.5-large");
+ assertThat(RptModel.SAP_RPT_15_LARGE.version()).isEqualTo(null);
- final var modelWithVersion = RptModel.SAP_RPT_1_SMALL.withVersion("v1.0");
- assertThat(modelWithVersion.name()).isEqualTo("sap-rpt-1-small");
+ val modelWithVersion = RptModel.SAP_RPT_15.withVersion("v1.0");
+ assertThat(modelWithVersion.name()).isEqualTo("sap-rpt-1.5");
assertThat(modelWithVersion.version()).isEqualTo("v1.0");
}
- static PredictRequestPayload createBaseRequest() {
- final var dataSchema =
- Map.of(
- "PRODUCT", SchemaFieldConfig.create().dtype(ColumnType.STRING),
- "PRICE", SchemaFieldConfig.create().dtype(ColumnType.STRING),
- "ORDERDATE", SchemaFieldConfig.create().dtype(ColumnType.DATE),
- "ID", SchemaFieldConfig.create().dtype(ColumnType.STRING),
- "COSTCENTER", SchemaFieldConfig.create().dtype(ColumnType.STRING));
- final var targetColumns =
- List.of(
- TargetColumnConfig.create()
- .name("COSTCENTER")
- .predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
- .taskType(TargetColumnConfig.TaskTypeEnum.CLASSIFICATION));
-
- return PredictRequestPayload.create()
- .predictionConfig(PredictionConfig.create().targetColumns(targetColumns))
- .indexColumn("ID")
- .dataSchema(dataSchema)
- .parseDataTypes(true);
- }
-
@Test
void testTableCompletionWithRowsFormat() {
final List> rows =
@@ -104,9 +98,16 @@ void testTableCompletionWithRowsFormat() {
"ORDERDATE", RowsInnerValue.create("01-11-2025"),
"ID", RowsInnerValue.create("104"),
"COSTCENTER", RowsInnerValue.create("Data Infrastructure")));
- final var request = createBaseRequest().rows(rows);
+ val request =
+ PredictRequestPayloadOneOf.create()
+ .predictionConfig(PredictionConfig.create().targetColumns(TARGET_COLUMN))
+ .rows(rows)
+ .indexColumn("ID")
+ .dataSchema(DATA_SCHEMA)
+ .parseDataTypes(true);
+
+ final PredictResponsePayload response = client.tableCompletion(request);
- final var response = client.tableCompletion(request);
assertThat(response).isNotNull();
assertThat(response.getId()).isEqualTo("0381c575-9ee5-46f1-9223-4f9caf039e48");
assertThat(response.getMetadata().getNumColumns()).isEqualTo(5);
@@ -159,9 +160,15 @@ void testTableCompletionWithColumnsFormat() {
RowsInnerValue.create("[PREDICT]"),
RowsInnerValue.create("Office Furniture"),
RowsInnerValue.create("Data Infrastructure")));
- final var request = createBaseRequest().columns(columns);
+ val request =
+ PredictRequestPayloadOneOf1.create()
+ .predictionConfig(PredictionConfig.create().targetColumns(TARGET_COLUMN))
+ .columns(columns)
+ .indexColumn("ID")
+ .dataSchema(DATA_SCHEMA)
+ .parseDataTypes(true);
- final var response = client.tableCompletion(request);
+ final PredictResponsePayload response = client.tableCompletion(request);
assertThat(response).isNotNull();
assertThat(response.getId()).isEqualTo("f89fb682-8d6b-4ef5-97f4-bd3c9aab8c49");
@@ -189,8 +196,8 @@ void testTableCompletionWithColumnsFormat() {
@SneakyThrows
@Disabled("Used to generate test-data.parquet file")
@Test
- void generateTestParquetFile() throws IOException {
- final var schemaString =
+ void generateTestParquetFile() {
+ val schemaString =
"""
{
"type": "record",
@@ -206,8 +213,7 @@ void generateTestParquetFile() throws IOException {
""";
final Schema schema = new Schema.Parser().parse(schemaString);
- final Path outputPath =
- Path.of(getClass().getResource("/").toURI()).resolve("test-data.parquet");
+ val outputPath = Path.of("src/test/resources/test-data.parquet");
try (ParquetWriter writer =
AvroParquetWriter.builder(new LocalOutputFile(outputPath))
@@ -244,21 +250,18 @@ private static GenericRecord recordFor(
return record;
}
- @SneakyThrows
@Test
- void testTableCompletionWithParquetFile() throws IOException {
- final var resourceStream =
- Path.of(getClass().getResource("/test-data.parquet").toURI()).toFile();
- assertThat(resourceStream).isNotNull();
+ void testTableCompletionWithParquetFile() {
+ val parquetFile = Path.of("src/test/resources/test-data.parquet").toFile();
- final var targetConfig =
+ val targetConfig =
TargetColumnConfig.create()
.name("COSTCENTER")
.predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
- .taskType(TargetColumnConfig.TaskTypeEnum.CLASSIFICATION);
- final var predictionConfig = PredictionConfig.create().targetColumns(List.of(targetConfig));
+ .taskType(CLASSIFICATION);
+ val predictionConfig = PredictionConfig.create().targetColumns(List.of(targetConfig));
- final var response = client.tableCompletion(resourceStream, predictionConfig);
+ val response = client.tableCompletion(parquetFile, predictionConfig);
assertThat(response).isNotNull();
assertThat(response.getId()).isEqualTo("3a4ed523-b834-4685-8538-92f94b3cfa1d");
@@ -284,16 +287,17 @@ void testTableCompletionWithParquetFile() throws IOException {
@SneakyThrows
@Test
- void testTableCompletionWithParquetThrowsIllegalArgumentException() throws IOException {
- final var predictionConfig = mock(PredictionConfig.class);
- final var objectMapper = mock(JsonMapper.class);
+ void testTableCompletionWithParquetThrowsIllegalArgumentException() {
+ val parquetFile = Path.of("src/test/resources/test-data.parquet").toFile();
+ val predictionConfig = mock(PredictionConfig.class);
+ val objectMapper = mock(JsonMapper.class);
- try (final var mockedStatic = mockStatic(JacksonConfiguration.class)) {
+ try (val mockedStatic = mockStatic(JacksonConfiguration.class)) {
mockedStatic.when(JacksonConfiguration::getDefaultObjectMapper).thenReturn(objectMapper);
when(objectMapper.writeValueAsString(any()))
.thenThrow(new JsonProcessingException("Test") {});
- assertThatThrownBy(() -> client.tableCompletion(mock(File.class), predictionConfig))
+ assertThatThrownBy(() -> client.tableCompletion(parquetFile, predictionConfig))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Failed to serialize PredictionConfig");
}
diff --git a/foundation-models/sap-rpt/src/test/resources/mappings/predictColumnWise.json b/foundation-models/sap-rpt/src/test/resources/mappings/predictColumnWise.json
index 5e6b63aa0..7cc32d4cf 100644
--- a/foundation-models/sap-rpt/src/test/resources/mappings/predictColumnWise.json
+++ b/foundation-models/sap-rpt/src/test/resources/mappings/predictColumnWise.json
@@ -19,7 +19,6 @@
}
]
},
- "rows": [],
"columns": {
"PRICE": [
999.99,
@@ -100,4 +99,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/RptService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/RptService.java
index 61411a438..8800d42be 100644
--- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/RptService.java
+++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/RptService.java
@@ -1,18 +1,19 @@
package com.sap.ai.sdk.app.services;
+import static com.sap.ai.sdk.foundationmodels.rpt.RptModel.SAP_RPT_15;
+import static com.sap.ai.sdk.foundationmodels.rpt.generated.model.TargetColumnConfig.TaskTypeEnum.CLASSIFICATION;
+
import com.sap.ai.sdk.foundationmodels.rpt.RptClient;
-import com.sap.ai.sdk.foundationmodels.rpt.RptModel;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.ColumnType;
-import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictRequestPayload;
+import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictRequestPayloadOneOf;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictResponsePayload;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictionConfig;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictionPlaceholder;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.RowsInnerValue;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.SchemaFieldConfig;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.TargetColumnConfig;
-import java.io.File;
import java.math.BigDecimal;
-import java.net.URISyntaxException;
+import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
@@ -22,7 +23,7 @@
@Service
public class RptService {
- static final RptClient rptClient = RptClient.forModel(RptModel.SAP_RPT_1_SMALL);
+ static final RptClient rptClient = RptClient.forModel(SAP_RPT_15);
/**
* Makes a prediction request to the RPT model. *
@@ -43,7 +44,7 @@ public PredictResponsePayload predict() {
TargetColumnConfig.create()
.name("COSTCENTER")
.predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
- .taskType(TargetColumnConfig.TaskTypeEnum.CLASSIFICATION));
+ .taskType(CLASSIFICATION));
final List> rows =
List.of(
Map.of(
@@ -66,12 +67,12 @@ public PredictResponsePayload predict() {
"COSTCENTER", RowsInnerValue.create("Data Infrastructure")));
final var request =
- PredictRequestPayload.create()
+ PredictRequestPayloadOneOf.create()
.predictionConfig(PredictionConfig.create().targetColumns(targetColumns))
+ .rows(rows)
.indexColumn("ID")
.dataSchema(dataSchema)
- .parseDataTypes(true)
- .rows(rows);
+ .parseDataTypes(true);
return rptClient.tableCompletion(request);
}
@@ -82,19 +83,16 @@ public PredictResponsePayload predict() {
*/
@Nonnull
public PredictResponsePayload predictParquet() {
- try {
- final File parquetData = new File(getClass().getResource("/sample.parquet").toURI());
- final var targetColumns =
- List.of(
- TargetColumnConfig.create()
- .name("COSTCENTER")
- .predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
- .taskType(TargetColumnConfig.TaskTypeEnum.CLASSIFICATION));
+ // resources/sampl.parquet
+ final var parquetFile = Path.of("src/main/resources/sample.parquet").toFile();
+ final var targetColumns =
+ List.of(
+ TargetColumnConfig.create()
+ .name("COSTCENTER")
+ .predictionPlaceholder(PredictionPlaceholder.create("[PREDICT]"))
+ .taskType(CLASSIFICATION));
- return rptClient.tableCompletion(
- parquetData, PredictionConfig.create().targetColumns(targetColumns));
- } catch (final URISyntaxException e) {
- throw new IllegalArgumentException("Failed to load Parquet file for prediction", e);
- }
+ return rptClient.tableCompletion(
+ parquetFile, PredictionConfig.create().targetColumns(targetColumns));
}
}