@@ -102,10 +102,7 @@ The LLM response is available as the first choice under the `result.getOrchestra
102102Use a prepared template and execute requests with by passing only the input parameters:
103103
104104``` java
105- var template =
106- ChatMessage . create()
107- .role(" user" )
108- .content(" Reply with 'Orchestration Service is working!' in {{?language}}" );
105+ var template = Message . user(" Reply with 'Orchestration Service is working!' in {{?language}}" );
109106var templatingConfig = TemplatingModuleConfig . create(). template(template);
110107var configWithTemplate = config. withTemplateConfig(templatingConfig);
111108
@@ -124,10 +121,10 @@ Include a message history to maintain context in the conversation:
124121``` java
125122var messagesHistory =
126123 List . of(
127- ChatMessage . create() . role( " user" ) . content (" What is the capital of France?" ),
128- ChatMessage . create() . role( " assistant" ) . content (" The capital of France is Paris." ));
124+ Message . user(" What is the capital of France?" ),
125+ Message . assistant(" The capital of France is Paris." ));
129126var message =
130- ChatMessage . create() . role( " user" ) . content (" What is the typical food there?" );
127+ Message . user(" What is the typical food there?" );
131128
132129var prompt = new OrchestrationPrompt (message). messageHistory(messagesHistory);
133130
@@ -175,12 +172,8 @@ var maskingConfig =
175172 DpiMasking . anonymization(). withEntities(DPIEntities . PHONE , DPIEntities . PERSON );
176173var configWithMasking = config. withMaskingConfig(maskingConfig);
177174
178- var systemMessage = ChatMessage . create()
179- .role(" system" )
180- .content(" Please evaluate the following user feedback and judge if the sentiment is positive or negative." );
181- var userMessage = ChatMessage . create()
182- .role(" user" )
183- .content(" " "
175+ var systemMessage = Message . system(" Please evaluate the following user feedback and judge if the sentiment is positive or negative." );
176+ var userMessage = Message . user(" " "
184177 I think the SDK is good, but could use some further enhancements.
185178 My architect Alice and manager Bob pointed out that we need the grounding capabilities, which aren't supported yet.
186179 " " " );
0 commit comments