Skip to content

Commit 3174f07

Browse files
author
I750911
committed
alignment of prompt to work for input and output filtering
1 parent 484d7d3 commit 3174f07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/SpringAiOrchestrationService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public ChatResponse masking() {
102102
* @return the assistant response object
103103
*/
104104
@Nonnull
105-
public ChatResponse inputFiltering() throws OrchestrationClientException{
105+
public ChatResponse inputFiltering() throws OrchestrationClientException {
106106
val filterConfig = new AzureContentFilter()
107107
.hate(AzureFilterThreshold.ALLOW_SAFE)
108108
.selfHarm(AzureFilterThreshold.ALLOW_SAFE)
@@ -111,7 +111,7 @@ public ChatResponse inputFiltering() throws OrchestrationClientException{
111111

112112
val opts = new OrchestrationChatOptions(config.withInputFiltering(filterConfig));
113113

114-
val prompt = new Prompt("'We shall spill blood tonight', said the operator in charge.", opts);
114+
val prompt = new Prompt("Please rephrase the following sentence for me: 'I want to kill you!'", opts);
115115

116116
return client.call(prompt);
117117
}
@@ -134,7 +134,7 @@ public ChatResponse outputFiltering() throws OrchestrationClientException {
134134

135135
val opts = new OrchestrationChatOptions(config.withOutputFiltering(filterConfig));
136136

137-
val prompt = new Prompt("Please rephrase the following sentence for me: 'I want to kill myself!'", opts);
137+
val prompt = new Prompt("Please rephrase the following sentence for me: 'I want to kill you!'", opts);
138138

139139
return client.call(prompt);
140140
}

0 commit comments

Comments
 (0)