Class MessageAggregator
java.lang.Object
org.springframework.ai.chat.model.MessageAggregator
Helper that for streaming chat responses, aggregate the chat response messages into a
single AssistantMessage. Job is performed in parallel to the chat response processing.
- Since:
- 1.0.0
- Author:
- Christian Tzolov
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<ChatResponse>
aggregate
(reactor.core.publisher.Flux<ChatResponse> fluxChatResponse, Consumer<ChatResponse> onAggregationComplete) reactor.core.publisher.Flux<AdvisedResponse>
aggregateAdvisedResponse
(reactor.core.publisher.Flux<AdvisedResponse> advisedResponses, Consumer<AdvisedResponse> aggregationHandler)
-
Constructor Details
-
MessageAggregator
public MessageAggregator()
-
-
Method Details
-
aggregateAdvisedResponse
public reactor.core.publisher.Flux<AdvisedResponse> aggregateAdvisedResponse(reactor.core.publisher.Flux<AdvisedResponse> advisedResponses, Consumer<AdvisedResponse> aggregationHandler) -
aggregate
public reactor.core.publisher.Flux<ChatResponse> aggregate(reactor.core.publisher.Flux<ChatResponse> fluxChatResponse, Consumer<ChatResponse> onAggregationComplete)
-