Skip to content

Commit 43b69cf

Browse files
committed
Update project docs
1 parent fe71a07 commit 43b69cf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/guides/ORCHESTRATION_CHAT_COMPLETION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ var configWithFilter = config.withInputFiltering(filterStrict).withOutputFilteri
162162
var result =
163163
new OrchestrationClient().chatCompletion(prompt, configWithFilter);
164164
```
165+
#### Behavior of Input and Output Filters
166+
167+
- **Input Filter**: Triggers a `400 Bad Request` in response during the `chatCompletion` call if the input message violates the filter policy.
168+
- **Output Filter**: Allows the request to complete but throws an exception when accessing filtered content via `result.getContent()`.
169+
170+
You will find [some examples](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java) in our Spring Boot application demonstrating response handling with filters.
165171

166172
### Data masking
167173

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ void testInputFilteringLenient() {
209209
@Test
210210
void testOutputFilteringStrict() {
211211
var policy = AzureFilterThreshold.ALLOW_SAFE;
212+
var response = service.outputFiltering(policy);
212213

213-
assertThatThrownBy(() -> service.outputFiltering(policy).getContent())
214+
assertThatThrownBy(response::getContent)
214215
.isInstanceOf(OrchestrationClientException.class)
215216
.hasMessageContaining("Content filter filtered the output.");
216217
}

0 commit comments

Comments
 (0)