File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
spring-ai-docs/src/main/antora/modules/ROOT/pages/api Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,16 @@ You can configure existing advisors using the xref:api/chatclient.adoc#_advisor_
1313----
1414var 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+
2123String 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
3233Advisors 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
You can’t perform that action at this time.
0 commit comments