Interface StreamAdvisorChain
- All Superinterfaces:
AdvisorChain
- All Known Subinterfaces:
BaseAdvisorChain
- All Known Implementing Classes:
DefaultAroundAdvisorChain
A chain of
StreamAdvisor instances orchestrating the execution of a
ChatClientRequest on the next StreamAdvisor in the chain.- Since:
- 1.0.0
- Author:
- Christian Tzolov, Dariusz Jedrzejczyk, Thomas Vitale
-
Method Summary
Modifier and TypeMethodDescriptioncopy(StreamAdvisor after) Creates a new StreamAdvisorChain copy that contains all advisors after the specified advisor.Returns the list of all theStreamAdvisorinstances included in this chain at the time of its creation.reactor.core.publisher.Flux<ChatClientResponse>nextStream(ChatClientRequest chatClientRequest) Invokes the nextStreamAdvisorin theStreamAdvisorChainwith the given request.Methods inherited from interface org.springframework.ai.chat.client.advisor.api.AdvisorChain
getObservationRegistry
-
Method Details
-
nextStream
Invokes the nextStreamAdvisorin theStreamAdvisorChainwith the given request. -
getStreamAdvisors
List<StreamAdvisor> getStreamAdvisors()Returns the list of all theStreamAdvisorinstances included in this chain at the time of its creation. -
copy
Creates a new StreamAdvisorChain copy that contains all advisors after the specified advisor.- Parameters:
after- the StreamAdvisor after which to copy the chain- Returns:
- a new StreamAdvisorChain containing all advisors after the specified advisor
- Throws:
IllegalArgumentException- if the specified advisor is not part of the chain
-