Skip to content

Commit 4bd457c

Browse files
committed
Get started with agentic retrieval using Java
1 parent 2ee8e4f commit 4bd457c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/search/includes/quickstarts/agentic-retrieval-java.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ The sample in this quickstart works with the Java Runtime. Install a Java Develo
479479
private static void runAgenticRetrieval(TokenCredential credential, OpenAIAsyncClient openAIClient) {
480480
System.out.println("[SEARCH] Running agentic retrieval...");
481481
482-
// Initialize messages with system instructions (like C#)
482+
// Initialize messages with system instructions
483483
List<Map<String, String>> messages = new ArrayList<>();
484484
485485
Map<String, String> systemMessage = new HashMap<>();
@@ -495,22 +495,22 @@ The sample in this quickstart works with the Java Runtime. Install a Java Develo
495495
messages.add(userMessage);
496496
497497
try {
498-
// Call agentic retrieval API (excluding system message like C#)
498+
// Call agentic retrieval API (excluding system message)
499499
List<Map<String, String>> userMessages = messages.stream()
500500
.filter(m -> !"system".equals(m.get("role")))
501501
.collect(java.util.stream.Collectors.toList());
502502
503503
String retrievalResponse = callAgenticRetrieval(credential, userMessages);
504504
505-
// Add assistant response to conversation history (like C#)
505+
// Add assistant response to conversation history
506506
Map<String, String> assistantMessage = new HashMap<>();
507507
assistantMessage.put("role", "assistant");
508508
assistantMessage.put("content", retrievalResponse);
509509
messages.add(assistantMessage);
510510
511511
System.out.println(retrievalResponse);
512512
513-
// Now do chat completion with full conversation history (like C#)
513+
// Now do chat completion with full conversation history
514514
generateFinalAnswer(openAIClient, messages);
515515
516516
// Continue conversation with second question

0 commit comments

Comments
 (0)