Class MessageChatMemoryAdvisor
java.lang.Object
org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor
- All Implemented Interfaces:
Advisor
,BaseAdvisor
,BaseChatMemoryAdvisor
,CallAdvisor
,StreamAdvisor
,org.springframework.core.Ordered
Memory is retrieved added as a collection of messages to the prompt
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Mark Pollack, Thomas Vitale
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.springframework.ai.chat.client.advisor.api.Advisor
DEFAULT_CHAT_MEMORY_PRECEDENCE_ORDER
Fields inherited from interface org.springframework.ai.chat.client.advisor.api.BaseAdvisor
DEFAULT_SCHEDULER
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<ChatClientResponse>
adviseStream
(ChatClientRequest chatClientRequest, StreamAdvisorChain streamAdvisorChain) after
(ChatClientResponse chatClientResponse, AdvisorChain advisorChain) Logic to be executed after the rest of the advisor chain is called.before
(ChatClientRequest chatClientRequest, AdvisorChain advisorChain) Logic to be executed before the rest of the advisor chain is called.builder
(ChatMemory chatMemory) int
getOrder()
reactor.core.scheduler.Scheduler
Scheduler used for processing the advisor logic when streaming.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.client.advisor.api.BaseAdvisor
adviseCall, getName
Methods inherited from interface org.springframework.ai.chat.client.advisor.api.BaseChatMemoryAdvisor
getConversationId
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
getScheduler
public reactor.core.scheduler.Scheduler getScheduler()Description copied from interface:BaseAdvisor
Scheduler used for processing the advisor logic when streaming.- Specified by:
getScheduler
in interfaceBaseAdvisor
-
before
Description copied from interface:BaseAdvisor
Logic to be executed before the rest of the advisor chain is called.- Specified by:
before
in interfaceBaseAdvisor
-
after
Description copied from interface:BaseAdvisor
Logic to be executed after the rest of the advisor chain is called.- Specified by:
after
in interfaceBaseAdvisor
-
adviseStream
public reactor.core.publisher.Flux<ChatClientResponse> adviseStream(ChatClientRequest chatClientRequest, StreamAdvisorChain streamAdvisorChain) - Specified by:
adviseStream
in interfaceBaseAdvisor
- Specified by:
adviseStream
in interfaceStreamAdvisor
-
builder
-