Class FlowAgent
java.lang.Object
com.alibaba.cloud.ai.graph.agent.Agent
com.alibaba.cloud.ai.graph.agent.flow.agent.FlowAgent
- Direct Known Subclasses:
LlmRoutingAgent,LoopAgent,ParallelAgent,SequentialAgent,SupervisorAgent
-
Field Summary
FieldsFields inherited from class com.alibaba.cloud.ai.graph.agent.Agent
compileConfig, compiledGraph, description, executor, graph, name -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents, StateSerializer stateSerializer) protectedFlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents, StateSerializer stateSerializer, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StateGraphAbstract method for subclasses to specify their graph building strategy.protected StateGraphschedule(ScheduleConfig scheduleConfig) Schedule the agent task with trigger.Methods inherited from class com.alibaba.cloud.ai.graph.agent.Agent
applyExecutorConfig, buildMessageInput, buildNonStreamConfig, buildStreamConfig, description, doInvoke, doInvokeAndGetOutput, doStream, getAndCompileGraph, getCurrentState, getGraph, invoke, invoke, invoke, invoke, invoke, invoke, invokeAndGetOutput, invokeAndGetOutput, invokeAndGetOutput, invokeAndGetOutput, invokeAndGetOutput, invokeAndGetOutput, name, schedule, stream, stream, stream, stream, stream, stream
-
Field Details
-
interruptBefore
-
subAgents
-
stateSerializer
-
-
Constructor Details
-
FlowAgent
protected FlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents) -
FlowAgent
protected FlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents, StateSerializer stateSerializer) -
FlowAgent
protected FlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents, StateSerializer stateSerializer, Executor executor)
-
-
Method Details
-
initGraph
- Specified by:
initGraphin classAgent- Throws:
GraphStateException
-
schedule
Description copied from class:AgentSchedule the agent task with trigger. -
asStateGraph
-
buildSpecificGraph
protected abstract StateGraph buildSpecificGraph(FlowGraphBuilder.FlowGraphConfig config) throws GraphStateException Abstract method for subclasses to specify their graph building strategy. This method should be implemented by concrete FlowAgent subclasses to define how their specific graph structure should be built.- Parameters:
config- the graph configuration- Returns:
- the constructed StateGraph
- Throws:
GraphStateException- if graph construction fails
-
subAgents
-