Class LoopGraphBuildingStrategy
java.lang.Object
com.alibaba.cloud.ai.graph.agent.flow.strategy.LoopGraphBuildingStrategy
- All Implemented Interfaces:
FlowGraphBuildingStrategy
Converts a LoopAgent into its corresponding StateGraph.
Structure of the loop graph: START -> LoopInitLoop -> LoopDispatchNode (condition met -> SubAgentNode -> LoopDispatchNode; condition not met -> END)
- Since:
- 2025/8/25
- Author:
- vlsmb
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a StateGraph based on the provided configuration.Generates a KeyStrategyFactory based on the root agent and sub-agents.Returns the type identifier for this strategy.voidValidates that the configuration contains all required parameters for this strategy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.cloud.ai.graph.agent.flow.strategy.FlowGraphBuildingStrategy
processAgentKeyStrategies, processOutputKey
-
Constructor Details
-
LoopGraphBuildingStrategy
public LoopGraphBuildingStrategy()
-
-
Method Details
-
buildGraph
Description copied from interface:FlowGraphBuildingStrategyBuilds a StateGraph based on the provided configuration.- Specified by:
buildGraphin interfaceFlowGraphBuildingStrategy- Parameters:
config- the graph configuration containing all necessary parameters- Returns:
- the constructed StateGraph
- Throws:
GraphStateException- if graph construction fails
-
getStrategyType
Description copied from interface:FlowGraphBuildingStrategyReturns the type identifier for this strategy. This is used for registration and lookup purposes.- Specified by:
getStrategyTypein interfaceFlowGraphBuildingStrategy- Returns:
- the strategy type identifier
-
generateKeyStrategyFactory
Description copied from interface:FlowGraphBuildingStrategyGenerates a KeyStrategyFactory based on the root agent and sub-agents.- Specified by:
generateKeyStrategyFactoryin interfaceFlowGraphBuildingStrategy- Parameters:
config- the configuration containing agents- Returns:
- the generated KeyStrategyFactory
-
validateConfig
Description copied from interface:FlowGraphBuildingStrategyValidates that the configuration contains all required parameters for this strategy.- Specified by:
validateConfigin interfaceFlowGraphBuildingStrategy- Parameters:
config- the configuration to validate
-