Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4a88b37
Drafting yaml response part
rpanackal Jan 20, 2026
8363a6f
Reorganize and add more spec components
rpanackal Jan 20, 2026
920963f
Draft full request and response components in spec
rpanackal Jan 20, 2026
53d8fa8
Setting up new sap-rpt sub-module
rpanackal Jan 20, 2026
3d4c979
Minor component renaming
rpanackal Jan 20, 2026
faa656a
Complete working draft with e2e test
rpanackal Jan 20, 2026
1931444
Unit test coverage
rpanackal Jan 21, 2026
65ce38c
Use office beta spec file
rpanackal Jan 22, 2026
47b981c
disable wire logs
rpanackal Jan 22, 2026
70d0234
Prevent serialization of null
rpanackal Jan 22, 2026
ff33f98
Merge remote-tracking branch 'origin/main' into poc-rpt
rpanackal Jan 23, 2026
80c6167
Merge remote-tracking branch 'origin/main' into poc-rpt
rpanackal Jan 23, 2026
b580486
Disable /predict_parquet
rpanackal Jan 23, 2026
640a57a
pmd and checkstyle
rpanackal Jan 23, 2026
1d1e851
Update version
rpanackal Jan 23, 2026
d8d56f6
Update dependency management
rpanackal Jan 23, 2026
5fd47b6
Merge branch 'main' into poc-rpt
rpanackal Jan 26, 2026
ee539a0
Mark the new module non-release
rpanackal Jan 26, 2026
58a8bfb
Fix coverage nums and javadoc
rpanackal Jan 26, 2026
50fdd4e
Merge branch 'refs/heads/main' into poc-rpt
rpanackal Jan 27, 2026
b2f5255
Regenerate with Apache HttpClient
rpanackal Jan 27, 2026
5e94444
Update generated config
rpanackal Jan 28, 2026
7a7fee7
tabCompletion -> tableCompletion
rpanackal Jan 28, 2026
114bf89
spec update workflow
CharlesDuboisSAP Jan 28, 2026
fd935ec
fix filename
CharlesDuboisSAP Jan 28, 2026
fb67a0c
Update pr-lint and release notes
rpanackal Jan 29, 2026
e6994a6
Merge remote-tracking branch 'origin/poc-rpt' into poc-rpt
rpanackal Jan 29, 2026
eea14ac
Update controller and index file
rpanackal Jan 29, 2026
aad7c61
Exclude spring dependencies
rpanackal Jan 30, 2026
3a3f769
Exclude `top_k` in pom.xml and make sap-rpt non-release
rpanackal Jan 30, 2026
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 .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
DevOps
PromptRegistry
Grounding
RPT
headerPattern: '^(\w.+): (?:\[(\w.+)\] )?(.+)$'
headerPatternCorrespondence: type, scope, subject
# for available types, check:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/spec-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- document-grounding
- orchestration
- prompt-registry
- sap-rpt
default: orchestration
file-ref:
description: "Branch or tag to checkout the spec file from"
Expand Down Expand Up @@ -129,6 +130,10 @@ jobs:
API_URL="$API_BASE_URL/AI/prompt-registry/contents/src/spec/generated/prompt-registry-combined.yaml?ref=$REF"
FILE_PATH='core-services/prompt-registry/src/main/resources/spec/prompt-registry.yaml'
;;
sap-rpt) # https://github.tools.sap/DL-COE/sap-rpt-1-public-content
API_URL="$API_BASE_URL/DL-COE/sap-rpt-1-public-content/contents/sap-rpt-1_openapi.json?ref=$REF"
FILE_PATH='foundation-models/sap-rpt/src/main/resources/spec/sap-rpt-1_openapi.json'
;;
esac

echo "Downloading $CHOICE specification file from $API_URL ..."
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/weekly-spec-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- document-grounding
- prompt-registry
- orchestration
- sap-rpt

steps:
- name: "Checkout repository"
Expand Down
1 change: 1 addition & 0 deletions .pipeline/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<suppress files="[/\\]core[/\\]client[/\\]" checks=".*"/>
<suppress files="[/\\]core[/\\]model[/\\]" checks=".*"/>
<suppress files="[/\\]openai[/\\]generated[/\\]model[/\\]" checks=".*"/>
<suppress files="[/\\]rpt[/\\]generated[/\\]" checks=".*"/>
<suppress files="[/\\]orchestration[/\\]model[/\\]" checks=".*"/>
<suppress files="[/\\]grounding[/\\]client[/\\]" checks=".*"/>
<suppress files="[/\\]grounding[/\\]model[/\\]" checks=".*"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### ✨ New Functionality

-
- [RPT] Introducing `RptClient` for Tabular AI backed by SAP RPT models `SAP_RPT_1_SMALL` and `SAP_RPT_1_LARGE`.

### 📈 Improvements

Expand Down
168 changes: 168 additions & 0 deletions foundation-models/sap-rpt/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>1.16.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>com.sap.ai.sdk.foundationmodels</groupId>
<artifactId>sap-rpt</artifactId>
<name>SAP RPT Model Client</name>
<description>SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for consuming SAP RPT model for in-context learning predictions on tabular data.</description>
<url>https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation</url>
<organization>
<name>SAP SE</name>
<url>https://www.sap.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>SAP</name>
<email>cloudsdk@sap.com</email>
<organization>SAP SE</organization>
<organizationUrl>https://www.sap.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/SAP/ai-sdk-java.git</connection>
<developerConnection>scm:git:ssh://github.com:SAP/ai-sdk-java.git</developerConnection>
<url>https://github.com/SAP/ai-sdk-java/tree/main</url>
</scm>
<properties>
<project.rootdir>${project.basedir}/../../</project.rootdir>
<coverage.complexity>83%</coverage.complexity>
<coverage.line>77%</coverage.line>
<coverage.instruction>82%</coverage.instruction>
<coverage.branch>100%</coverage.branch>
<coverage.method>83%</coverage.method>
</properties>

<dependencies>
<dependency>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-connectivity</artifactId>
</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>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- scope "provided" -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- scope "test" -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>connectivity-apache-httpclient5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>generate</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>generate</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<deleteOutputDirectory>true</deleteOutputDirectory>
</configuration>
<executions>
<execution>
<id>sap-rpt</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/sap-rpt-1_openapi.json</inputSpec>
<modelPackage>com.sap.ai.sdk.foundationmodels.rpt.generated.model</modelPackage>
<apiPackage>com.sap.ai.sdk.foundationmodels.rpt.generated.client</apiPackage>
<additionalProperties>
<library>apache-httpclient</library>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<useOneOfInterfaces>true</useOneOfInterfaces>
<useOneOfCreators>true</useOneOfCreators>
<useFloatArrays>true</useFloatArrays>
<excludePaths>/predict_parquet</excludePaths>
<excludeProperties>TargetColumnConfig.top_k</excludeProperties>
Copy link
Member Author

Choose a reason for hiding this comment

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

This excludes a property from being generated in the model class. Currently, top_k is not actually released in SAP RPT service.

</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.sap.ai.sdk.foundationmodels.rpt;

import static com.sap.ai.sdk.core.JacksonConfiguration.getDefaultObjectMapper;

import com.google.common.annotations.Beta;
import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.core.DeploymentResolutionException;
import com.sap.ai.sdk.foundationmodels.rpt.generated.client.DefaultApi;
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 javax.annotation.Nonnull;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;

/**
* Client for interacting with SAP RPT foundation models.
*
* @since 1.16.0
*/
@Beta
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class RptClient {
@Nonnull private final DefaultApi api;

/**
* Creates a new RptClient for the specified foundation model.
*
* @param foundationModel The foundation model to use.
* @return A new instance of RptClient.
* @throws DeploymentResolutionException If there is an error resolving the deployment.
*/
@Nonnull
public static RptClient forModel(@Nonnull final RptModel foundationModel)
throws DeploymentResolutionException {
final var destination = new AiCoreService().getInferenceDestination().forModel(foundationModel);
return forDestination(destination);
}

/**
* Creates a new RptClient for the specified destination.
*
* @param destination The destination to use.
* @return A new instance of RptClient.
*/
static RptClient forDestination(@Nonnull final Destination destination) {
final var apiClient = ApiClient.create(destination).withObjectMapper(getDefaultObjectMapper());
return new RptClient(new DefaultApi(apiClient));
}

/**
* Predict targets using SAP RPT model with structured data. *
*
* <p><b>200</b> - Successful response with predictive insights.
*
* <p><b>400</b> - Bad Request - Invalid input.
*
* <p><b>422</b> - Unprocessable Content - Invalid input.
*
* <p><b>500</b> - Internal Server Error.
*
* @param requestBody The prediction request
* @return prediction response from the RPT model
*/
@Nonnull
public PredictResponsePayload tableCompletion(@Nonnull final PredictRequestPayload requestBody) {
return api.predict(requestBody);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.sap.ai.sdk.foundationmodels.rpt;

import com.sap.ai.sdk.core.AiModel;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
* Represents an SAP RPT foundation model.
*
* @param name The name of the model.
* @param version The version of the model (optional).
* @since 1.16.0
*/
public record RptModel(@Nonnull String name, @Nullable String version) implements AiModel {

/** SAP RPT 1 Small model. */
public static final RptModel SAP_RPT_1_SMALL = new RptModel("sap-rpt-1-small", null);

/** SAP RPT 1 Large model. */
public static final RptModel SAP_RPT_1_LARGE = new RptModel("sap-rpt-1-large", null);

/**
* Create a new instance of RptModel with the provided version.
*
* @param version The version of the model.
* @return The new instance of RptModel.
*/
@Nonnull
public RptModel withVersion(@Nonnull final String version) {
return new RptModel(name, version);
}
}
Loading