File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
sample-code/spring-app/src
main/java/com/sap/ai/sdk/app/services
test/java/com/sap/ai/sdk/app/controllers Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ public OrchestrationChatResponse messagesHistory(@Nonnull final String prevMessa
163163 public OrchestrationChatResponse inputFiltering (@ Nonnull final AzureFilterThreshold policy )
164164 throws OrchestrationClientException {
165165 val prompt =
166- new OrchestrationPrompt ("'We shall spill blood tonight', said the operation in-charge." );
166+ new OrchestrationPrompt (
167+ "Please rephrase the following sentence for me: 'We shall spill blood tonight', said the operator in-charge." );
167168 val filterConfig =
168169 new AzureContentFilter ().hate (policy ).selfHarm (policy ).sexual (policy ).violence (policy );
169170
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ void testInputFilteringLenient() {
241241 assertThat (response .getContent ()).isNotEmpty ();
242242
243243 var filterResult = response .getOriginalResponse ().getModuleResults ().getInputFiltering ();
244- assertThat (filterResult .getMessage ()).contains ("passed " );
244+ assertThat (filterResult .getMessage ()).contains ("skipped " );
245245 }
246246
247247 @ Test
@@ -284,7 +284,7 @@ void testLlamaGuardDisabled() {
284284 assertThat (response .getContent ()).isNotEmpty ();
285285
286286 var filterResult = response .getOriginalResponse ().getModuleResults ().getInputFiltering ();
287- assertThat (filterResult .getMessage ()).contains ("passed " );
287+ assertThat (filterResult .getMessage ()).contains ("skipped " );
288288 }
289289
290290 @ Test
@@ -415,7 +415,7 @@ void testStreamingErrorHandlingMasking() {
415415 assertThatThrownBy (() -> client .streamChatCompletion (prompt , configWithMasking ))
416416 .isInstanceOf (OrchestrationClientException .class )
417417 .hasMessageContaining ("status 400 Bad Request" )
418- .hasMessageContaining ("'type': 'sap_data_privacy_integration', 'method': 'anonymization' " );
418+ .hasMessageContaining ("'unknown_default_open_api' is not one of " );
419419 }
420420
421421 @ Test
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ void testInputFilteringLenient() {
8686 .getOriginalResponse ()
8787 .getModuleResults ()
8888 .getInputFiltering ();
89- assertThat (filterResult .getMessage ()).contains ("passed " );
89+ assertThat (filterResult .getMessage ()).contains ("skipped " );
9090 }
9191
9292 @ Test
You can’t perform that action at this time.
0 commit comments