Class ChainStepAgent<Request,Response>
java.lang.Object
com.javaaidev.agenticpatterns.core.Agent
com.javaaidev.agenticpatterns.taskexecution.TaskExecutionAgent<Request,Response>
com.javaaidev.agenticpatterns.chainworkflow.ChainStepAgent<Request,Response>
- Type Parameters:
Request
- Task input typeResponse
- Task output type
- All Implemented Interfaces:
Function<Request,
,Response> org.springframework.core.Ordered
public abstract class ChainStepAgent<Request,Response>
extends TaskExecutionAgent<Request,Response>
implements org.springframework.core.Ordered
A step in the chain
-
Field Summary
Fields inherited from class com.javaaidev.agenticpatterns.taskexecution.TaskExecutionAgent
responseType
Fields inherited from class com.javaaidev.agenticpatterns.core.Agent
chatClient, observationRegistry
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ChainStepAgent
(org.springframework.ai.chat.client.ChatClient chatClient, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry) protected
ChainStepAgent
(org.springframework.ai.chat.client.ChatClient chatClient, @Nullable Type responseType, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Methods inherited from class com.javaaidev.agenticpatterns.taskexecution.TaskExecutionAgent
apply, call, getPromptContext, getPromptTemplate, instrumentedCall, updateChatClientRequest
Methods inherited from class com.javaaidev.agenticpatterns.core.Agent
getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Constructor Details
-
ChainStepAgent
protected ChainStepAgent(org.springframework.ai.chat.client.ChatClient chatClient, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry) -
ChainStepAgent
protected ChainStepAgent(org.springframework.ai.chat.client.ChatClient chatClient, @Nullable Type responseType, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
call
protected abstract Response call(Request request, Map<String, Object> context, WorkflowChain<Request, Response> chain) Call the current step- Parameters:
request
- Task inputcontext
- Shared context between different stepschain
- The chain, see WorkflowChain- Returns:
- Task output
-