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/AI_CORE_DEPLOYMENT.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ In addition to the prerequisites above, we assume you have already set up the fo
66
66
```
67
67
</details>
68
68
69
-
### Create a Deployment
69
+
## Create a Deployment
70
70
71
71
Use the following code snippet to create a deployment in SAP AI Core:
72
72
@@ -84,7 +84,7 @@ AiExecutionStatus status = deployment.getStatus();
84
84
85
85
Refer to the [DeploymentController.java](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/DeploymentController.java) in our Spring Boot application for a complete example.
Please find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java). It shows the usage of Spring
211
209
Boot's `ResponseBodyEmitter` to stream the chat completion delta messages to the frontend in real-time.
212
210
213
-
###Embedding
211
+
## Embedding
214
212
215
213
Get the embeddings of a text input in list of float values:
Copy file name to clipboardExpand all lines: docs/guides/ORCHESTRATION_CHAT_COMPLETION.md
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ var config = new OrchestrationModuleConfig()
85
85
86
86
Please also refer to [our sample code](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java) for this and all following code examples.
87
87
88
-
###Chat Completion
88
+
## Chat Completion
89
89
90
90
Use the Orchestration service to generate a response to a user message:
If the input message violates the filter policy, a `400 (Bad Request)` response will be received during the `chatCompletion` call.
@@ -178,7 +178,7 @@ var result =
178
178
179
179
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.
180
180
181
-
###Data masking
181
+
## Data masking
182
182
183
183
Use the data masking module to anonymize personal information in the input:
184
184
@@ -201,7 +201,7 @@ var result =
201
201
202
202
In this example, the input will be masked before the call to the LLM and will remain masked in the output.
203
203
204
-
###Grounding
204
+
## Grounding
205
205
206
206
Use the grounding module to provide additional context to the AI model.
207
207
@@ -232,11 +232,11 @@ Use the grounding module to provide additional context to the AI model.
232
232
233
233
In this example, the AI model is provided with additional context in the form of grounding information. Note, that it is necessary to provide the grounding input via one or more input variables.
234
234
235
-
###Stream chat completion
235
+
## Stream chat completion
236
236
237
237
It's possible to pass a stream of chat completion delta elements, e.g. from the application backend to the frontend in real-time.
238
238
239
-
####Asynchronous Streaming
239
+
### Asynchronous Streaming
240
240
241
241
This is a blocking example for streaming and printing directly to the console:
Please find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java).
259
257
It shows the usage of Spring Boot's `ResponseBodyEmitter` to stream the chat completion delta messages to the frontend in real-time.
260
258
261
-
###Set model parameters
259
+
## Set model parameters
262
260
263
261
Change your LLM configuration to add model parameters:
Prompt prompt =newPrompt("What is the capital of France?", opts);
24
+
ChatResponse response = client.call(prompt);
25
+
```
26
+
27
+
Please
28
+
find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/SpringAiOrchestrationController.java).
29
+
30
+
## Orchestration Masking
31
+
32
+
Configure Orchestration modules withing Spring AI:
val opts =newOrchestrationChatOptions(config.withMaskingConfig(masking));
43
+
val prompt =
44
+
newPrompt(
45
+
"Please write 'Hello World!' to me via email. My email address is [email protected]",
46
+
opts);
47
+
48
+
ChatResponse response = client.call(prompt);
49
+
```
50
+
51
+
Please
52
+
find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/SpringAiOrchestrationController.java).
0 commit comments