Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 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
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
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
153 changes: 153 additions & 0 deletions foundation-models/sap-rpt/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?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>
</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>
<!-- 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>
Copy link
Contributor

Choose a reason for hiding this comment

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

Try with and without pojoBuildMethodName
Add <pojoConstructorVisibility>protected</pojoConstructorVisibility>
Add <aiSdkConstructor>true</aiSdkConstructor>
Try with and without removeOperationIdPrefix
Try with and without fixResponseSchemaTitles

Copy link
Member Author

@rpanackal rpanackal Jan 28, 2026

Choose a reason for hiding this comment

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

I added <pojoConstructorVisibility>protected</pojoConstructorVisibility>

  • <pojoBuildMethodName> is not irrelevant since we have a curried builder.
  • <aiSdkConstructor>true</aiSdkConstructor> is not relevant when you want a deployment's url for some particular model and not an AiCoreService instance pointing at AI_API_URL from AICORE_SERVICE_KEY
  • <removeOperationIdPrefix> is relevant only when a very long "operationId" is specified in spec. Also not relevant for provided spec.
  • <fixResponseSchemaTitles> is used when generator creates pojo classes like InlineObject1, InlineObject2 etc and loses ordering on regeneration. That is not the case here but maybe in future this becomes relevant.

<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<useOneOfInterfaces>true</useOneOfInterfaces>
<useOneOfCreators>true</useOneOfCreators>
<useFloatArrays>true</useFloatArrays>
<excludePaths>/predict_parquet</excludePaths>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.sap.ai.sdk.foundationmodels.rpt;

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

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
*/
@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