@@ -479,7 +479,7 @@ The sample in this quickstart works with the Java Runtime. Install a Java Develo
479
479
private static void runAgenticRetrieval(TokenCredential credential, OpenAIAsyncClient openAIClient) {
480
480
System.out.println("[SEARCH] Running agentic retrieval...");
481
481
482
- // Initialize messages with system instructions (like C#)
482
+ // Initialize messages with system instructions
483
483
List<Map<String, String>> messages = new ArrayList<>();
484
484
485
485
Map<String, String> systemMessage = new HashMap<>();
@@ -495,22 +495,22 @@ The sample in this quickstart works with the Java Runtime. Install a Java Develo
495
495
messages.add(userMessage);
496
496
497
497
try {
498
- // Call agentic retrieval API (excluding system message like C# )
498
+ // Call agentic retrieval API (excluding system message)
499
499
List<Map<String, String>> userMessages = messages.stream()
500
500
.filter(m -> !" system" .equals(m.get(" role" )))
501
501
.collect(java.util.stream.Collectors.toList());
502
502
503
503
String retrievalResponse = callAgenticRetrieval(credential, userMessages);
504
504
505
- // Add assistant response to conversation history (like C#)
505
+ // Add assistant response to conversation history
506
506
Map<String, String> assistantMessage = new HashMap<>();
507
507
assistantMessage.put(" role" , " assistant" );
508
508
assistantMessage.put(" content" , retrievalResponse);
509
509
messages.add(assistantMessage);
510
510
511
511
System.out.println(retrievalResponse);
512
512
513
- // Now do chat completion with full conversation history (like C#)
513
+ // Now do chat completion with full conversation history
514
514
generateFinalAnswer(openAIClient, messages);
515
515
516
516
// Continue conversation with second question
0 commit comments