Skip to content

Conversation

@rpanackal
Copy link
Member

@rpanackal rpanackal commented Jan 23, 2026

Context

AI/ai-sdk-java-backlog#350.

PoC for supporting the latest SAP RPT (Tabular AI) service

Feature scope:

  • New foundationmodels module sap-rpt introduced
  • Using spec obtained from sap-rpt-1-public-content
  • Unit tests and e2e test in place
  • Introduce new RptClient and RptModel class
  • Updated spec update action

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated [Java 1.16.0] RPT Beta ai-sdk#376
  • Release notes updated

@rpanackal
Copy link
Member Author

rpanackal commented Jan 23, 2026

PoC RPT

Important Mentions:

  • The PoC do not support operation on path /predict_parquet for now. I have explicitly disabled this in pom.xml

    1. There is no documentation about endpoint.

    2. The related spec is poorly defined for generation strategy. The prediction_config field in request payload is defined as type string but it should be a JSON of schema PredictionConfig. So, currently, we can't offer any type safety without adding convenience layer on top.

      Note: The exclusion of path /predict_parquet does not exclude generation of model classes used by the path eg: BodyPredictParquet.

  • The provided spec file defines components with dynamic properties which vary based on input column names. Example below.

    Column in Request Payload
    {
      "columns": {
        "anyOf": [
          {
            "additionalProperties": {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "object"
          },
          {
            "type": "null"
          }
        ],
        "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"
      }
    }
  • Some confusing bits in the latest spec (its still beta anyway)

    • Incorrect use of anyOf, for example "columns" field in request, "prediction" field in response. Should have been a oneOf
    • Description states that either rows or columns must be provided on request which sounds like another oneOf usecase, but current schema allow both to be null.
    • Fields that can be omitted are given a default value of null to indicate optionality.

@rpanackal rpanackal added please-review Request to review a pull-request dont-merge labels Jan 23, 2026
@rpanackal rpanackal self-assigned this Jan 23, 2026
pom.xml Outdated
<module>core-services/document-grounding</module>
<module>core-services/prompt-registry</module>
<module>foundation-models/openai</module>
<module>foundation-models/sap-rpt</module>
Copy link
Contributor

@newtork newtork Jan 26, 2026

Choose a reason for hiding this comment

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

(Major)

The PR title says "PoC", therefore the module shouldn't be released at this level of confidence.

E.g.

    <profile>
      <id>non-release</id>
      <activation>
        <property>
          <name>!release</name>
        </property>
      </activation>
      <modules>
        <module>sample-code/spring-app</module>
+       <module>foundation-models/sap-rpt</module>
      </modules>
    </profile>

Copy link
Member

@Jonas-Isr Jonas-Isr left a comment

Choose a reason for hiding this comment

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

Mostly minor issues. Looks pretty good :)

*
* <p>A REST API for in-context learning with the SAP-RPT-1 model.
*/
public class DefaultApi extends AbstractOpenApiService {
Copy link
Member

Choose a reason for hiding this comment

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

(Minor/Question)

This is a very non-descriptive class name (which does not come from the spec itself as far as I can see). Does it make sense to rename that when generating?

Copy link
Member Author

@rpanackal rpanackal Jan 30, 2026

Choose a reason for hiding this comment

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

I tried some attempts. Unfortunately, there is no real option to fully rename the generated api classes without modifying the spec file.

Short story: Keep name DefaultApi for now, and wait out for spec to be updated with "tags"/ "x-sap-cloud-sdk-api-name" property (as JS expects).

I found two maven generator plugin options <apiNamePrefix> and <apiNameSuffix>. They can be used to add a prefix or replace the suffix "Api" on all generated api classes.

They may be useful in the future. Currently this leads to names like RptDefaultApi or DefaultRptApi, and never get rid of string "Default". If we accept that, when a "tag" is finally added to the spec, this would be a breaking change for our users.

@rpanackal rpanackal changed the title feat: [DevOps] Poc RPT feat: [RPT] RPT Beta Jan 29, 2026
@rpanackal rpanackal changed the title feat: [RPT] RPT Beta feat: [DevOps] RPT Beta Jan 29, 2026
@rpanackal rpanackal changed the title feat: [DevOps] RPT Beta feat: [DevOps] PoC RPT Jan 30, 2026
<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.

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2025-04-03T13:23:00Z</project.build.outputTimestamp>
<cloud-sdk.version>5.25.0</cloud-sdk.version>
<cloud-sdk.version>5.26.0</cloud-sdk.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question)

Shouldn't this come via dependabot update?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this happens when we release AI SDK before Cloud SDK.

Copy link
Contributor

@newtork newtork left a comment

Choose a reason for hiding this comment

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

LGTM!

@rpanackal rpanackal merged commit 4de7a40 into main Jan 30, 2026
7 checks passed
@rpanackal rpanackal deleted the poc-rpt branch January 30, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please-review Request to review a pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants