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
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.alibaba.cloud.ai.graph.agent.Agent
compileConfig, compiledGraph, description, graph, name -
Constructor Summary
Constructors -
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
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
-
-
Constructor Details
-
FlowAgent
protected FlowAgent(String name, String description, CompileConfig compileConfig, List<Agent> subAgents) throws GraphStateException - Throws:
GraphStateException
-
-
Method Details
-
initGraph
- Specified by:
initGraphin classAgent- Throws:
GraphStateException
-
schedule
Description copied from class:AgentSchedule the agent task with trigger.- Overrides:
schedulein classAgent- Parameters:
scheduleConfig- the schedule configuration- Returns:
- a ScheduledAgentTask instance for managing the scheduled task
- Throws:
GraphStateException
-
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
-
compileConfig
-
subAgents
-