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
  • 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
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.http.client.BufferingClientHttpRequestFactory;
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question)

Can we use the new generator without spring dependencies?

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. I am working on the related cloud sdk item to fix spring optionality first. Then, later make use of the same in the new module client

Copy link
Member Author

@rpanackal rpanackal Jan 27, 2026

Choose a reason for hiding this comment

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

I updated the PR by regenerating with <library>apache-httpclient</library> on the latest cloud sdk release (5.26.0). But this will include spring dependencies.

Screenshot 2026-01-27 at 13 32 30

Once my latest PR on cloud sdk for new openapi-core-apache module is merged, the import statements will change and there will no dependency on spring. We should regenerate again after release of cloud sdk 5.27.0.

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

Choose a reason for hiding this comment

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

I believe the spec is currently missing a tag, so the generated api class gets a default name DefaultApi.

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?

<apiPackage>com.sap.ai.sdk.foundationmodels.rpt.generated.client</apiPackage>
<generateApis>true</generateApis>
<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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dont-merge please-review Request to review a pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants