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
+41-48Lines changed: 41 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Orchestration Chat Completion
1
+
=# Orchestration Chat Completion
2
2
3
3
## Table of Contents
4
4
@@ -77,7 +77,7 @@ To use the Orchestration service, create a client and a configuration object:
77
77
var client = new OrchestrationClient();
78
78
79
79
var config = new OrchestrationModuleConfig()
80
-
.withLlmConfig(OrchestrationAiModel.GPT_4O);
80
+
.withLlmConfig(OrchestrationAiModel.GPT_4O);
81
81
```
82
82
83
83
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.
@@ -120,9 +120,9 @@ Include a message history to maintain context in the conversation:
120
120
121
121
```java
122
122
var messagesHistory =
123
-
List.of(
124
-
Message.user("What is the capital of France?"),
125
-
Message.assistant("The capital of France is Paris."));
123
+
List.of(
124
+
Message.user("What is the capital of France?"),
125
+
Message.assistant("The capital of France is Paris."));
126
126
var message =
127
127
Message.user("What is the typical food there?");
128
128
@@ -198,27 +198,27 @@ Use the grounding module to provide additional context to the AI model.
198
198
199
199
```java
200
200
var message =
201
-
Message.user(
202
-
"{{?groundingInput}} Use the following information as additional context: {{?groundingOutput}}");
203
-
var prompt =
204
-
newOrchestrationPrompt(Map.of("groundingInput", "What does Joule do?"), message);
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.
@@ -235,20 +235,13 @@ This is a blocking example for streaming and printing directly to the console:
235
235
String msg ="Can you give me the first 100 numbers of the Fibonacci sequence?";
236
236
237
237
// try-with-resources on stream ensures the connection will be closed
0 commit comments