File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
orchestration/src/main/java/com/sap/ai/sdk/orchestration Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ public String getContent() throws OrchestrationOutputFilterException {
4343 final var choice = getChoice ();
4444
4545 if ("content_filter" .equals (choice .getFinishReason ())) {
46- @ SuppressWarnings ("unchecked" ) final var filterDetails =
46+ @ SuppressWarnings ("unchecked" )
47+ final var filterDetails =
4748 Optional .of (getOriginalResponse ().getModuleResults ().getOutputFiltering ())
4849 .map (outputFiltering -> (Map <String , Object >) outputFiltering .getData ())
4950 .map (data -> (List <Map <String , Object >>) data .get ("choices" ))
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ private static void throwOnContentFilter(@Nonnull final OrchestrationChatComplet
118118 throws OrchestrationOutputFilterException {
119119 final String finishReason = delta .getFinishReason ();
120120 if (finishReason != null && finishReason .equals ("content_filter" )) {
121- @ SuppressWarnings ("unchecked" ) final var filterDetails =
121+ @ SuppressWarnings ("unchecked" )
122+ final var filterDetails =
122123 Optional .ofNullable (delta .getModuleResults ().getOutputFiltering ())
123124 .map (outputFiltering -> (Map <String , Object >) outputFiltering .getData ())
124125 .map (data -> (List <Map <String , Object >>) data .get ("choices" ))
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ public OrchestrationClientException buildFromClientError(
3535 @ SuppressWarnings ("unchecked" )
3636 @ Nonnull
3737 private Map <String , Object > extractInputFilterDetails (@ Nonnull final OrchestrationError error ) {
38-
39- return Optional .of (error .getOriginalResponse ())
38+
39+ return Optional .of (error .getOriginalResponse ())
4040 .flatMap (response -> Optional .ofNullable (response .getModuleResults ()))
4141 .flatMap (moduleResults -> Optional .ofNullable (moduleResults .getInputFiltering ()))
4242 .flatMap (inputFiltering -> Optional .ofNullable (inputFiltering .getData ()))
You can’t perform that action at this time.
0 commit comments