Skip to content

Commit abb2a17

Browse files
authored
Update Response Masking Format (#191)
1 parent a2cc221 commit abb2a17

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

orchestration/src/test/resources/__files/maskingResponse.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@
1414
"input_masking": {
1515
"message": "Input to LLM is masked successfully.",
1616
"data": {
17-
"masked_template": [
18-
{
19-
"role": "system",
20-
"content": "Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\nPlease make sure to address the user in person and end with \"Best regards, the AI SDK team\".\n"
21-
},
22-
{
23-
"role": "user",
24-
"content": "Username: MASKED_PERSON_2\nuserEmail: MASKED_PERSON_3MASKED_EMAIL_1\nDate: 2022-01-01\n\nI think the SDK is good, but could use some further enhancements.\nMy architect MASKED_PERSON_1 and manager MASKED_PERSON_4 pointed out that we need the grounding capabilities, which aren't supported yet.\n"
25-
}
26-
]
17+
"masked_template": "[{\"role\": \"system\", \"content\": \"Please write an initial response to the below user feedback, stating that we are working on the feedback and will get back to them soon.\\nPlease make sure to address the user in person and end with \\\"Best regards, the AI SDK team\\\".\\n\"}, {\"role\": \"user\", \"content\": \"Username: MASKED_PERSON_2\\nuserEmail: MASKED_PERSON_1MASKED_EMAIL_1\\nDate: 2022-01-01\\n\\nI think the SDK is good, but could use some further enhancements.\\nMy architect MASKED_PERSON_4 and manager MASKED_PERSON_3 pointed out that we need the grounding capabilities, which aren't supported yet.\\n\"}]"
2718
}
2819
},
2920
"llm": {

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ void testMaskingPseudonymization() {
137137
var maskingResult = result.getModuleResults().getInputMasking();
138138
assertThat(maskingResult.getMessage()).isNotEmpty();
139139
var data = (Map<String, Object>) maskingResult.getData();
140-
var maskedMessage = ((List<Map<String, Object>>) data.get("masked_template")).get(1);
141-
assertThat(maskedMessage.get("content"))
142-
.asInstanceOf(InstanceOfAssertFactories.STRING)
140+
var maskedMessage = (String) data.get("masked_template");
141+
assertThat(maskedMessage)
143142
.describedAs("The masked input should not contain any user names but only pseudonyms")
144143
.doesNotContain("Mallory", "Alice", "Bob")
145144
.contains("MASKED_PERSON");

0 commit comments

Comments
 (0)