Class ConditionalAgentServiceImpl<T>
java.lang.Object
dev.langchain4j.agentic.internal.AbstractServiceBuilder<T, ConditionalAgentService<T>>
dev.langchain4j.agentic.workflow.impl.ConditionalAgentServiceImpl<T>
- All Implemented Interfaces:
AgenticService<ConditionalAgentService<T>, T>, ConditionalAgentService<T>
public class ConditionalAgentServiceImpl<T>
extends AbstractServiceBuilder<T, ConditionalAgentService<T>>
implements ConditionalAgentService<T>
-
Field Summary
FieldsFields inherited from class AbstractServiceBuilder
agenticMethod, agentInstanceFactory, agentListener, agentServiceClass, beforeCall, compensateOnError, description, errorHandler, executor, name, output, outputKey, subagents -
Constructor Summary
ConstructorsConstructorDescriptionConditionalAgentServiceImpl(Class<T> agentServiceClass, Method agenticMethod) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the agentic service, returning a proxy that can be invoked to execute the configured workflow.builder()static <T> ConditionalAgentServiceImpl<T> subAgent(String conditionDescription, Predicate<AgenticScope> condition, AgentExecutor agentExecutor) subAgent(Predicate<AgenticScope> condition, AgentExecutor agentExecutor) Sets the sub-agents that participate in this agentic workflow.subAgents(String conditionDescription, Predicate<AgenticScope> condition, Object... agents) subAgents(String conditionDescription, Predicate<AgenticScope> condition, List<AgentExecutor> agentExecutors) subAgents(Collection<?> agents) Sets the sub-agents that participate in this agentic workflow.subAgents(Predicate<AgenticScope> condition, Object... agents) subAgents(Predicate<AgenticScope> condition, List<AgentExecutor> agentExecutors) Methods inherited from class AbstractServiceBuilder
agentInstanceFactory, beforeCall, build, build, compensateOnError, description, errorHandler, executor, listener, name, output, outputKey, outputKeyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AgenticService
beforeCall, compensateOnError, description, errorHandler, listener, name, output, outputKey, outputKey
-
Field Details
-
conditionalAgents
-
-
Constructor Details
-
ConditionalAgentServiceImpl
-
-
Method Details
-
build
Description copied from interface:AgenticServiceBuilds the agentic service, returning a proxy that can be invoked to execute the configured workflow.- Specified by:
buildin interfaceAgenticService<ConditionalAgentService<T>, T>- Returns:
- the built agent proxy
-
builder
-
builder
-
subAgents
Description copied from interface:AgenticServiceSets the sub-agents that participate in this agentic workflow.- Specified by:
subAgentsin interfaceAgenticService<ConditionalAgentService<T>, T>- Overrides:
subAgentsin classAbstractServiceBuilder<T, ConditionalAgentService<T>>- Parameters:
agents- the sub-agents to orchestrate- Returns:
- this builder for fluent chaining
-
subAgents
public ConditionalAgentServiceImpl<T> subAgents(Predicate<AgenticScope> condition, Object... agents) - Specified by:
subAgentsin interfaceConditionalAgentService<T>
-
subAgents
public ConditionalAgentServiceImpl<T> subAgents(String conditionDescription, Predicate<AgenticScope> condition, Object... agents) - Specified by:
subAgentsin interfaceConditionalAgentService<T>
-
subAgents
Description copied from interface:AgenticServiceSets the sub-agents that participate in this agentic workflow.- Specified by:
subAgentsin interfaceAgenticService<ConditionalAgentService<T>, T>- Overrides:
subAgentsin classAbstractServiceBuilder<T, ConditionalAgentService<T>>- Parameters:
agents- a collection of sub-agents to orchestrate- Returns:
- this builder for fluent chaining
-
subAgents
public ConditionalAgentServiceImpl<T> subAgents(Predicate<AgenticScope> condition, List<AgentExecutor> agentExecutors) - Specified by:
subAgentsin interfaceConditionalAgentService<T>
-
subAgents
public ConditionalAgentServiceImpl<T> subAgents(String conditionDescription, Predicate<AgenticScope> condition, List<AgentExecutor> agentExecutors) - Specified by:
subAgentsin interfaceConditionalAgentService<T>
-
subAgent
public ConditionalAgentServiceImpl<T> subAgent(Predicate<AgenticScope> condition, AgentExecutor agentExecutor) - Specified by:
subAgentin interfaceConditionalAgentService<T>
-
subAgent
public ConditionalAgentServiceImpl<T> subAgent(String conditionDescription, Predicate<AgenticScope> condition, AgentExecutor agentExecutor) - Specified by:
subAgentin interfaceConditionalAgentService<T>
-
serviceType
- Specified by:
serviceTypein classAbstractServiceBuilder<T, ConditionalAgentService<T>>
-