Skip to content

Conversation

@Jonas-Isr
Copy link
Member

Context

AI/ai-sdk-java-backlog#132

Before, in the sample app we simply returned our Java classes in the controller and let them be deserialised to be displayed. This stopped working properly at some point for the Orchestration endpoints (see linked issue above). In order to circumvent this, we decided to not rely on the deserialisation and also split up the business logic of the app into a dedicated service class.

This PR does this for the OpenAiController.

There is a related PR (that is already merged) for OrchestrationController.

Feature scope:

  • Split out business logic from OpenAiController to newly added OpenAiService.
  • Endpoints now return either the response message as a String or the whole JSON response (this is toggled via the header of the requests)

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

@Jonas-Isr Jonas-Isr changed the title Split ai controller into service Refactor OpenAiController in sample app Dec 19, 2024
@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Dec 19, 2024
@Jonas-Isr Jonas-Isr removed the please-review Request to review a pull-request label Dec 20, 2024
Jonas-Isr and others added 2 commits December 20, 2024 11:04
# Conflicts:
#	sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
#	sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Dec 20, 2024
newtork
newtork previously approved these changes Dec 20, 2024
@Jonas-Isr Jonas-Isr removed the please-review Request to review a pull-request label Dec 20, 2024
@jjtang1985 jjtang1985 changed the title Refactor OpenAiController in sample app Refactor OpenAiController in sample app Dec 20, 2024
@Jonas-Isr Jonas-Isr merged commit d1bce8c into main Dec 20, 2024
5 checks passed
@Jonas-Isr Jonas-Isr deleted the Split-AiController-into-Service branch December 20, 2024 13:50
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.

4 participants