Skip to content

feat: [OpenAI] An AiCore wrapper for Responses API only#819

Merged
rpanackal merged 35 commits into
feat/poc-openai-responses-apachefrom
feat/poc-aicore-responses-only
Apr 15, 2026
Merged

feat: [OpenAI] An AiCore wrapper for Responses API only#819
rpanackal merged 35 commits into
feat/poc-openai-responses-apachefrom
feat/poc-aicore-responses-only

Conversation

@rpanackal

@rpanackal rpanackal commented Apr 8, 2026

Copy link
Copy Markdown
Member

Context

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

An alternative to #806

The above mentioned PR introduced wrapper for all openai endpoints and failed to scale. So, we have stripped down the scope of the wrapper to be limited to Responses API alone.

The motivation for this decision is because, the OpenAI SDK integration is not decidedly "the way to go" but an approach that enables Responses API until we can support code generation for OAS3.2, the original blocker for OpenAI Responses API.

Feature scope:

  • AiCoreOpenAiClient.response(OpenAiModel.GPT_5) returns a wrapper AiCoreResponseService

    • AiCoreResponseService provides model injection if left out in params and throws there is a model mismatch against deployment model
    ResponseService responseClient = AiCoreOpenAiClient.responses(OpenAiModel.GPT_5); 
    val params = ResponseCreateParams.builder()
         .input(input)
         .model(ChatModel.GPT_5)
         .store(false)
         .build();
    var response = responseClient.create(params);

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

…openai-wrapper

# Conflicts:
#	foundation-models/openai/pom.xml
#	foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java
#	foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java
#	pom.xml
#	sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java
@rpanackal rpanackal changed the base branch from main to feat/poc-openai-responses-apache April 8, 2026 13:22
@rpanackal rpanackal self-assigned this Apr 14, 2026
@rpanackal rpanackal merged commit e4febc5 into feat/poc-openai-responses-apache Apr 15, 2026
1 check passed
@rpanackal rpanackal deleted the feat/poc-aicore-responses-only branch April 15, 2026 15:18
n-o-u-r-h-a-n added a commit that referenced this pull request Jul 3, 2026
* Minimal new module setup including spec

* Generation partial-success

* Remove examples

* Successfully filter by path

* Attach spec filter command

* Initial setup

* Successful PoC with OpenAI Models

* Version 1

* Stable api

* Change class name

* Rebase with main

* fix dependency analyse issues

* Initial draft untested

* Second draft
- Streaming no fully enabled

* Successful E2E

* Streaming initial draft

* Streaming E2E with chat completion

* isStreaming check simplified

* Cleanup PoC and rename module

* Reduce Javadoc verbosity

* Restrict to `/responses` api

* Cleanup comments

* Charles review suggestions

* Charles review - round 2 suggestions

* Add dependency

* Mark openai dependency optional and new client `@Beta`

* Javadoc on sample code for store

* Update allowed endpoints with method check

* feat: [OpenAI]  An AiCore wrapper for Responses API only (#819)

* Minimal new module setup including spec

* Generation partial-success

* Remove examples

* Successfully filter by path

* Attach spec filter command

* Initial setup

* Successful PoC with OpenAI Models

* Version 1

* Stable api

* Change class name

* Add tests

* fix dependency analyse issues

* Initial draft untested

* Second draft
- Streaming no fully enabled

* Successful E2E

* Streaming initial draft

* Streaming E2E with chat completion

* isStreaming check simplified

* Cleanup PoC and rename module

* Reduce Javadoc verbosity

* Restrict to `/responses` api

* Cleanup comments

* Charles review suggestions

* Charles review - round 2 suggestions

* Add dependency

* Mark openai dependency optional and new client `@Beta`

* Cleanup and no throw on missing model

* pmd

* Responses API complete

* ChatCompletionCreateParams throws without model. Needs rethink client API creation forModel

* Cleanup and close with test documenting limitation

* First draft responses only

* jacoco limits

* Remove ResponseService wrapper since remote API behaviour changed

* Sync and Async nested class option

* Only Async kept with minimal code

* Exhaustive assertion and test streaming

* Strip down assertions

* Cleanup streaming case test

* Transition to v1 api and add full unit testing

* Improve e2e and coverage numbers

* Remove unnecessary indentation

* Add release notes and remove endpoint unsupported in v1

* formatting release notes

* fix release note

* fix CI coverage discrepancy

* Update spring controller and index.html

* Remove /cancel endpoint out of stability concerns

* json files for newely supported endpoints

* code change

* controller and tests

* coverage up

* Potential fix for pull request finding 'CodeQL / Cross-site scripting'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java

Co-authored-by: Jonas-Isr <jonas.israel@sap.com>

* fixes

* isValid() fix

* Update sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java

Co-authored-by: Jonas-Isr <jonas.israel@sap.com>

* .md features

* Update sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>

* Update docs/release_notes.md

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>

* Update docs/release_notes.md

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>

* Update docs/release_notes.md

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>

* update release notes with cancel endpoint

* supporting all endpoints in index page

* Formatting

* Update docs/release_notes.md

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>

* fixing duplication in release_notes.md

* format handling for json

* OpenAI divided to 2 subsections

* retruning message in else case

* separting to 2 controllers

* all fixes done

---------

Co-authored-by: Roshin Rajan Panackal <roshin.rajan.panackal@sap.com>
Co-authored-by: Roshin Rajan Panackal <36329474+rpanackal@users.noreply.github.com>
Co-authored-by: I538344 <charles.dubois@sap.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Jonas-Isr <jonas.israel@sap.com>
Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
Co-authored-by: SAP Cloud SDK Bot <cloudsdk@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant