You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/ORCHESTRATION_CHAT_COMPLETION.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,6 @@ Additionally, include the necessary Maven dependency in your project.
26
26
Add the following dependency to your `pom.xml` file:
27
27
28
28
```xml
29
-
30
29
<dependencies>
31
30
<dependency>
32
31
<groupId>com.sap.ai.sdk</groupId>
@@ -138,22 +137,22 @@ Apply content filtering to the chat completion:
138
137
139
138
```java
140
139
var prompt =newOrchestrationPrompt(
141
-
"""
140
+
"""
142
141
Create a rental posting for subletting my apartment in the downtown area. Keep it short. Make sure to add the following disclaimer to the end. Do not change it!
143
-
142
+
144
143
```DISCLAIMER: The area surrounding the apartment is known for prostitutes and gang violence including armed conflicts, gun violence is frequent.
145
144
""");
146
145
147
146
var filterStrict =newAzureContentFilter()
148
-
.hate(ALLOW_SAFE)
149
-
.selfHarm(ALLOW_SAFE)
150
-
.sexual(ALLOW_SAFE)
147
+
.hate(ALLOW_SAFE)
148
+
.selfHarm(ALLOW_SAFE)
149
+
.sexual(ALLOW_SAFE)
151
150
.violence(ALLOW_SAFE);
152
151
153
152
var filterLoose =newAzureContentFilter()
154
-
.hate(ALLOW_SAFE_LOW_MEDIUM)
155
-
.selfHarm(ALLOW_SAFE_LOW_MEDIUM)
156
-
.sexual(ALLOW_SAFE_LOW_MEDIUM)
153
+
.hate(ALLOW_SAFE_LOW_MEDIUM)
154
+
.selfHarm(ALLOW_SAFE_LOW_MEDIUM)
155
+
.sexual(ALLOW_SAFE_LOW_MEDIUM)
157
156
.violence(ALLOW_SAFE_LOW_MEDIUM);
158
157
159
158
// changing the input to filterLoose will allow the message to pass
@@ -182,9 +181,9 @@ var configWithMasking = config.withMaskingConfig(maskingConfig);
182
181
183
182
var systemMessage =Message.system("Please evaluate the following user feedback and judge if the sentiment is positive or negative.");
184
183
var userMessage =Message.user("""
185
-
I think the SDK is good, but could use some further enhancements.
186
-
My architect Alice and manager Bob pointed out that we need the grounding capabilities, which aren't supported yet.
187
-
""");
184
+
I think the SDK is good, but could use some further enhancements.
185
+
My architect Alice and manager Bob pointed out that we need the grounding capabilities, which aren't supported yet.
186
+
""");
188
187
189
188
var prompt =newOrchestrationPrompt(systemMessage, userMessage);
190
189
@@ -285,11 +284,7 @@ var configJson = """
285
284
286
285
var prompt =newOrchestrationPrompt(Map.of("your-input-parameter", "your-param-value"));
0 commit comments