Skip to content

Commit 14972f9

Browse files
committed
docs: minor adivsor docs update
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent 36c5977 commit 14972f9

File tree

1 file changed

+8
-6
lines changed
  • spring-ai-docs/src/main/antora/modules/ROOT/pages/api

1 file changed

+8
-6
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/advisors.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ You can configure existing advisors using the xref:api/chatclient.adoc#_advisor_
1313
----
1414
var chatClient = ChatClient.builder(chatModel)
1515
.defaultAdvisors(
16-
new MessageChatMemoryAdvisor(chatMemory), // chat-memory advisor
17-
new QuestionAnswerAdvisor(vectorStore) // RAG advisor
16+
MessageChatMemoryAdvisor.builder(chatMemory).build(), // chat-memory advisor
17+
QuestionAnswerAdvisor.builder((vectorStore).builder() // RAG advisor
1818
)
1919
.build();
2020
21+
var conversationId = "678";
22+
2123
String response = this.chatClient.prompt()
22-
// Set advisor parameters at runtime
23-
.advisors(advisor -> advisor.param("chat_memory_conversation_id", "678")
24-
.param("chat_memory_response_size", 100))
24+
// Set advisor parameters at runtime
25+
.advisors(advisor -> advisor.param(ChatMemory.CONVERSATION_ID, conversationId))
2526
.user(userText)
2627
.call()
2728
.content();
@@ -31,7 +32,8 @@ It is recommend to register the advisors at build time using builder's `defaultA
3132

3233
Advisors also participate in the Observability stack, so you can view metrics and traces related to their execution.
3334

34-
xref:ROOT:api/retrieval-augmented-generation.adoc#_questionansweradvisor[Learn about Question Answer Advisor]
35+
- xref:ROOT:api/retrieval-augmented-generation.adoc#_questionansweradvisor[Learn about Question Answer Advisor]
36+
- xref:ROOT:api/chat-memory.adoc#_memory_in_chat_client[Learn about Chat Memory Advisor]
3537

3638
== Core Components
3739

0 commit comments

Comments
 (0)