|
39 | 39 | @Service |
40 | 40 | @Slf4j |
41 | 41 | 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. */ |
42 | 47 | private final OrchestrationClient client = new OrchestrationClient(); |
43 | 48 |
|
44 | 49 | /** |
45 | 50 | * Demo operation to serve chatbot responses to payment questions. |
46 | 51 | * |
47 | | - * @param msg_user The user message. |
| 52 | + * @param msgUser The user message. |
48 | 53 | * @return A response from our chatbot. |
49 | 54 | */ |
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."; |
52 | 58 |
|
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); |
56 | 63 | return result.getContent(); |
57 | 64 | } |
58 | 65 |
|
59 | | - @Getter |
60 | | - private final OrchestrationModuleConfig config = |
61 | | - new OrchestrationModuleConfig().withLlmConfig(GEMINI_1_5_FLASH.withParam(TEMPERATURE, 0.0)); |
62 | | - |
63 | 66 | /** |
64 | 67 | * Chat request to OpenAI through the Orchestration service with a simple prompt. |
65 | 68 | * |
|
0 commit comments