Skip to content

Commit 76bb18f

Browse files
committed
Format
1 parent a05b598 commit 76bb18f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,30 @@
3939
@Service
4040
@Slf4j
4141
public class OrchestrationService {
42+
@Getter
43+
private final OrchestrationModuleConfig config =
44+
new OrchestrationModuleConfig().withLlmConfig(GEMINI_1_5_FLASH.withParam(TEMPERATURE, 0.0));
45+
46+
/** The shared Orchestration Client. */
4247
private final OrchestrationClient client = new OrchestrationClient();
4348

4449
/**
4550
* Demo operation to serve chatbot responses to payment questions.
4651
*
47-
* @param msg_user The user message.
52+
* @param msgUser The user message.
4853
* @return A response from our chatbot.
4954
*/
50-
public String queryPayments(String msg_user) {
51-
var msg_system = "You are a helpful chat bot to answer questions on company payments.";
55+
@Nonnull
56+
public String queryPayments(final @Nonnull String msgUser) {
57+
final var msgSystem = "You are a helpful chat bot to answer questions on company payments.";
5258

53-
var config = new OrchestrationModuleConfig().withLlmConfig(GPT_4O.withParam(TEMPERATURE, 0.5));
54-
var prompt = new OrchestrationPrompt(Message.system(msg_system), Message.user(msg_user));
55-
var result = client.chatCompletion(prompt, config);
59+
final var config =
60+
new OrchestrationModuleConfig().withLlmConfig(GPT_4O.withParam(TEMPERATURE, 0.5));
61+
final var prompt = new OrchestrationPrompt(Message.system(msgSystem), Message.user(msgUser));
62+
final var result = client.chatCompletion(prompt, config);
5663
return result.getContent();
5764
}
5865

59-
@Getter
60-
private final OrchestrationModuleConfig config =
61-
new OrchestrationModuleConfig().withLlmConfig(GEMINI_1_5_FLASH.withParam(TEMPERATURE, 0.0));
62-
6366
/**
6467
* Chat request to OpenAI through the Orchestration service with a simple prompt.
6568
*

0 commit comments

Comments
 (0)