generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 15
feat: [Orchestration] Filtering details and additional convenience on exception #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
newtork
merged 43 commits into
main
from
feat/orchestration/filter-exception-handling-factory
Aug 5, 2025
Merged
feat: [Orchestration] Filtering details and additional convenience on exception #497
newtork
merged 43 commits into
main
from
feat/orchestration/filter-exception-handling-factory
Aug 5, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…on-handling-factory # Conflicts: # orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java
…on-handling-factory
- remove crafty object mapping in response handler
…on-handling-factory
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientException.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
| null); | ||
| val entity = response.getEntity(); | ||
| @Nonnull | ||
| protected E buildException(@Nonnull final ClassicHttpResponse httpResponse) { |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Comment)
I was thinking, If we moved this whole method and related logic into ClientExceptionFactory then we could get rid of generic argument R extends ClientError in this class :/ But this would risk further duplicate code though. It was just a thought
newtork
reviewed
Jul 17, 2025
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClientException.java
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationFilterException.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationFilterException.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Jul 17, 2025
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationExceptionFactory.java
Show resolved
Hide resolved
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
…https://github.com/SAP/ai-sdk-java into feat/orchestration/filter-exception-handling-factory
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/sap/ai/sdk/core/common/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java
Outdated
Show resolved
Hide resolved
orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java
Outdated
Show resolved
Hide resolved
…ndler.java Co-authored-by: Charles Dubois <[email protected]>
…strationUnitTest.java Co-authored-by: Charles Dubois <[email protected]>
…https://github.com/SAP/ai-sdk-java into feat/orchestration/filter-exception-handling-factory
core/src/test/java/com/sap/ai/sdk/core/common/ClientStreamingHandlerTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/sap/ai/sdk/core/common/ClientStreamingHandlerTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/sap/ai/sdk/core/common/ClientStreamingHandlerTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/sap/ai/sdk/core/common/ClientStreamingHandlerTest.java
Show resolved
Hide resolved
...s/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiClientGeneratedTest.java
Show resolved
Hide resolved
...le-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
Outdated
Show resolved
Hide resolved
...le-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Aug 5, 2025
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java
Outdated
Show resolved
Hide resolved
newtork
reviewed
Aug 5, 2025
core/src/main/java/com/sap/ai/sdk/core/common/ClientExceptionFactory.java
Show resolved
Hide resolved
newtork
previously approved these changes
Aug 5, 2025
…ion-handling-factory' into feat/orchestration/filter-exception-handling-factory
newtork
approved these changes
Aug 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
AI/ai-sdk-java-backlog#253.
Previously, we didn't propagate the deserialized error response along with any thrown exception. This also meant our users have no access to diagnostic details returned by orchestration service (also applicable for openai).
The PR aims to rectify the above problem and especiallyy provide convenience for input and output filtering exceptions.
Here are two user issues created requesting the same convenience. They have both suggested some api. Maybe you can also look at this to have a better picture on what convenience may be added
#491
#468
Feature scope:
ClientExceptionFactorygetClientErrorthat returns module specific error objects wrapping deserialized server response.OrchestrationInputFilteringExceptionandOrchestrationOutputFilteringExceptionto distinguish filtering exception types with catch blocks.Map<String, Object> getFilterDetails()to inspect the filtering details available.getStatusCodetoOrchestrationClientExceptionto get the http status codeClientResponseHandlerClientStreamingHandlergetAzureContentSafetyOutput,getAzureContentSafetyInputandgetLlamaGuard38bin the relevant filter exceptions.Definition of Done
Aligned changes with the JavaScript SDK