Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
### 📈 Improvements

- [Orchestration] Added new API `TranslationConfig#applyToPlaceholders` and `TranslationConfig#applyToTemplateRoles` to support partial translation for a message.
- [RPT] `RptClient.tableCompletion()` GZIP compresses the request payload.

### 🐛 Fixed Issues

Expand Down
12 changes: 1 addition & 11 deletions foundation-models/sap-rpt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,7 @@
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
<artifactId>openapi-core-apache</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictResponsePayload;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictionConfig;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
import java.io.File;
import javax.annotation.Nonnull;
import lombok.AccessLevel;
Expand Down Expand Up @@ -74,7 +74,7 @@ static RptClient forDestination(@Nonnull final Destination destination) {
@Beta
@Nonnull
public PredictResponsePayload tableCompletion(@Nonnull final PredictRequestPayload requestBody) {
return api.predict(requestBody);
return api.predict(requestBody, "gzip");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictRequestPayload;
import com.sap.ai.sdk.foundationmodels.rpt.generated.model.PredictResponsePayload;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.services.openapi.apache.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.Pair;
import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.ApiClient;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi;
import com.sap.cloud.sdk.services.openapi.apache.apiclient.Pair;
import com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -65,12 +65,16 @@ public DefaultApi(@Nonnull final ApiClient apiClient) {
*
* <p><b>500</b> - Internal Server Error
*
* @param predictRequestPayload The value for the parameter predictRequestPayload
* @param predictRequestPayload (required) The value for the parameter predictRequestPayload
* @param contentEncoding (optional) Content encoding of the request body. Use &#39;gzip&#39; for
* gzip-compressed payloads.
* @return PredictResponsePayload
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
*/
@Nonnull
public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predictRequestPayload)
public PredictResponsePayload predict(
@Nonnull final PredictRequestPayload predictRequestPayload,
@Nullable final String contentEncoding)
throws OpenApiRequestException {

// verify the required parameter 'predictRequestPayload' is set
Expand All @@ -89,6 +93,9 @@ public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predi
final Map<String, String> localVarHeaderParams = new HashMap<String, String>();
final Map<String, Object> localVarFormParams = new HashMap<String, Object>();

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"};
Expand All @@ -111,6 +118,35 @@ public PredictResponsePayload predict(@Nonnull final PredictRequestPayload predi
localVarReturnType);
}

/**
* Make in-context predictions for specified target columns based on provided table data JSON
* (optionally gzip-compressed).
*
* <p>Make in-context predictions for specified target columns. Either \&quot;rows\&quot; or
* \&quot;columns\&quot; must be provided and must contain both context and query rows. You can
* optionally send gzip-compressed JSON payloads and set a \&quot;Content-Encoding: gzip\&quot;
* header.
*
* <p><b>200</b> - Successful Prediction
*
* <p><b>400</b> - Bad Request - Invalid input data
*
* <p><b>413</b> - Payload Too Large
*
* <p><b>422</b> - Validation Error
*
* <p><b>500</b> - Internal Server Error
*
* @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 in-context predictions for specified target columns based on provided table data Parquet
* file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
"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.",
"operationId": "predict",
"parameters": [
{
"name": "Content-Encoding",
"in": "header",
"description": "Content encoding of the request body. Use 'gzip' for gzip-compressed payloads.",
"required": false,
"schema": {
"type": "string",
"enum": ["gzip"]
}
}
],
Copy link
Contributor Author

@CharlesDuboisSAP CharlesDuboisSAP Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clemens Biehl from SAP RPT will add this header in the spec

"requestBody": {
"content": {
"application/json": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<maven.compiler.proc>full</maven.compiler.proc>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2025-04-03T13:23:00Z</project.build.outputTimestamp>
<cloud-sdk.version>5.26.0</cloud-sdk.version>
<cloud-sdk.version>5.27.0-SNAPSHOT</cloud-sdk.version>
<junit-jupiter.version>6.0.3</junit-jupiter.version>
<wiremock.version>3.13.2</wiremock.version>
<assertj-core.version>3.27.7</assertj-core.version>
Expand Down
Loading