From 041af5385cfc4351f6b86a75c5f72374b6db9039 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Fri, 23 Jan 2026 14:08:31 +0100 Subject: [PATCH 1/4] change sentence to trigger filter --- .../com/sap/ai/sdk/app/services/OrchestrationService.java | 2 +- .../sap/ai/sdk/app/services/SpringAiOrchestrationService.java | 2 +- .../com/sap/ai/sdk/app/controllers/OrchestrationTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java index ec64a418d..c41a3e55a 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java @@ -177,7 +177,7 @@ public OrchestrationChatResponse inputFiltering(@Nonnull final AzureFilterThresh throws OrchestrationClientException { val prompt = new OrchestrationPrompt( - "Please rephrase the following sentence for me: 'We shall spill blood tonight', said the operator in-charge."); + "Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."); val filterConfig = new AzureContentFilter() .hate(policy) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/SpringAiOrchestrationService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/SpringAiOrchestrationService.java index 99c899c31..06b12f476 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/SpringAiOrchestrationService.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/SpringAiOrchestrationService.java @@ -137,7 +137,7 @@ public ChatResponse inputFiltering(@Nonnull final AzureFilterThreshold policy) val prompt = new Prompt( - "Please rephrase the following sentence for me: 'We shall spill blood tonight', said the operator in-charge.", + "Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge.", opts); return client.call(prompt); diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java index 8fd348930..0e17b5d00 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java @@ -442,8 +442,8 @@ void testStreamingErrorHandlingTemplate() { @Test void testStreamingErrorHandlingInputFilter() { - val prompt = new OrchestrationPrompt("Create 5 paraphrases of 'I hate you'."); - val filterConfig = new AzureContentFilter().hate(AzureFilterThreshold.ALLOW_SAFE); + val prompt = new OrchestrationPrompt("Create 5 paraphrases of 'I want to destroy them all'."); + val filterConfig = new AzureContentFilter().violence(AzureFilterThreshold.ALLOW_SAFE); val configWithFilter = config.withInputFiltering(filterConfig); assertThatThrownBy(() -> client.streamChatCompletion(prompt, configWithFilter)) From 63658dd3f7ffe34eb304d68165146fc47977d729 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Mon, 26 Jan 2026 09:57:04 +0100 Subject: [PATCH 2/4] change sentence to trigger filter --- .../java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java index 0e17b5d00..1e0dcc9e2 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java @@ -442,7 +442,7 @@ void testStreamingErrorHandlingTemplate() { @Test void testStreamingErrorHandlingInputFilter() { - val prompt = new OrchestrationPrompt("Create 5 paraphrases of 'I want to destroy them all'."); + val prompt = new OrchestrationPrompt("Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."); val filterConfig = new AzureContentFilter().violence(AzureFilterThreshold.ALLOW_SAFE); val configWithFilter = config.withInputFiltering(filterConfig); From 8b3abc9cce0753bc9f94ac5bb87fee0f29353536 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Mon, 26 Jan 2026 08:59:31 +0000 Subject: [PATCH 3/4] Formatting --- .../com/sap/ai/sdk/app/controllers/OrchestrationTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java index 1e0dcc9e2..c44c89d2c 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java @@ -442,7 +442,9 @@ void testStreamingErrorHandlingTemplate() { @Test void testStreamingErrorHandlingInputFilter() { - val prompt = new OrchestrationPrompt("Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."); + val prompt = + new OrchestrationPrompt( + "Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."); val filterConfig = new AzureContentFilter().violence(AzureFilterThreshold.ALLOW_SAFE); val configWithFilter = config.withInputFiltering(filterConfig); From e3ed7be3fd5a5b0243e8794fb3dd30bec12b0349 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Mon, 26 Jan 2026 10:51:51 +0100 Subject: [PATCH 4/4] retrigger --- .../com/sap/ai/sdk/app/controllers/OrchestrationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java index c44c89d2c..f94dd0e25 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java @@ -442,9 +442,9 @@ void testStreamingErrorHandlingTemplate() { @Test void testStreamingErrorHandlingInputFilter() { - val prompt = - new OrchestrationPrompt( - "Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."); + val msg = + "Please rephrase the following sentence for me: 'We shall destroy them all tonight', said the operator in-charge."; + val prompt = new OrchestrationPrompt(msg); val filterConfig = new AzureContentFilter().violence(AzureFilterThreshold.ALLOW_SAFE); val configWithFilter = config.withInputFiltering(filterConfig);