Class DefaultAroundAdvisorChain
java.lang.Object
org.springframework.ai.chat.client.advisor.DefaultAroundAdvisorChain
- All Implemented Interfaces:
AdvisorChain,BaseAdvisorChain,CallAdvisorChain,StreamAdvisorChain
Default implementation for the
BaseAdvisorChain. Used by the ChatClient
to delegate the call to the next CallAdvisor or StreamAdvisor in the
chain.- Since:
- 1.0.0
- Author:
- Christian Tzolov, Dariusz Jedrzejczyk, Thomas Vitale
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder(io.micrometer.observation.ObservationRegistry observationRegistry) copy(CallAdvisor after) Creates a new CallAdvisorChain copy that contains all advisors after the specified advisor.Returns the list of all theCallAdvisorinstances included in this chain at the time of its creation.io.micrometer.observation.ObservationRegistryReturns the list of all theStreamAdvisorinstances included in this chain at the time of its creation.nextCall(ChatClientRequest chatClientRequest) Invokes the nextCallAdvisorin theCallAdvisorChainwith the given request.reactor.core.publisher.Flux<ChatClientResponse>nextStream(ChatClientRequest chatClientRequest) Invokes the nextStreamAdvisorin theStreamAdvisorChainwith the given request.
-
Field Details
-
DEFAULT_OBSERVATION_CONVENTION
-
-
Method Details
-
builder
public static DefaultAroundAdvisorChain.Builder builder(io.micrometer.observation.ObservationRegistry observationRegistry) -
nextCall
Description copied from interface:CallAdvisorChainInvokes the nextCallAdvisorin theCallAdvisorChainwith the given request.- Specified by:
nextCallin interfaceCallAdvisorChain
-
nextStream
public reactor.core.publisher.Flux<ChatClientResponse> nextStream(ChatClientRequest chatClientRequest) Description copied from interface:StreamAdvisorChainInvokes the nextStreamAdvisorin theStreamAdvisorChainwith the given request.- Specified by:
nextStreamin interfaceStreamAdvisorChain
-
copy
Description copied from interface:CallAdvisorChainCreates a new CallAdvisorChain copy that contains all advisors after the specified advisor.- Specified by:
copyin interfaceCallAdvisorChain- Parameters:
after- the CallAdvisor after which to copy the chain- Returns:
- a new CallAdvisorChain containing all advisors after the specified advisor
-
getCallAdvisors
Description copied from interface:CallAdvisorChainReturns the list of all theCallAdvisorinstances included in this chain at the time of its creation.- Specified by:
getCallAdvisorsin interfaceCallAdvisorChain
-
getStreamAdvisors
Description copied from interface:StreamAdvisorChainReturns the list of all theStreamAdvisorinstances included in this chain at the time of its creation.- Specified by:
getStreamAdvisorsin interfaceStreamAdvisorChain
-
getObservationRegistry
public io.micrometer.observation.ObservationRegistry getObservationRegistry()- Specified by:
getObservationRegistryin interfaceAdvisorChain
-