Package com.aispect.agents.graph
Class DynamicWorkflowGraphAgent
java.lang.Object
com.aispect.agent.core.AbstractGraphAgent<Object,Object,Object>
com.aispect.agents.graph.DynamicWorkflowGraphAgent
- All Implemented Interfaces:
AiAgentFilter,AiGraphAgentHandler<Object,,Object, Object> AiGraphBehaviorOrchestrator<Object>,AiGraphCompleteHook,AiGraphStartHook,AiGraphTimeoutHook,AiNodeExceptionHook,AiNodeStatusHook
Universal Graph Agent Orchestration engine.
It uses reflection to load the
AiNode Metadata, call the large model to generate execution task sequence,
Then schedule these task sequences in an internal loop, while connecting various life cycles and exceptions. Hook。-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a single execution step planned by the large model, corresponding to JSON A task object in the array. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorchestrateGraph(Map<String, Object> nodeResources, AiInvocationContext<?> ctx) Execute the orchestration logic of the graph agent. This method is responsible for parsing the available node resources, calling the large model to generate an execution plan, and scheduling each node in the execution graph in sequence according to the plan. At the same time, corresponding life cycle hooks are triggered at different stages (Hook)and exception handling strategies.Methods inherited from class com.aispect.agent.core.AbstractGraphAgent
doFilter, getAiOperations, onGraphComplete, onGraphStart, onGraphTimeout, onNodeException, onNodeStatusChange, shouldProcess
-
Constructor Details
-
DynamicWorkflowGraphAgent
public DynamicWorkflowGraphAgent()
-
-
Method Details
-
orchestrateGraph
public Object orchestrateGraph(Map<String, Object> nodeResources, AiInvocationContext<?> ctx) throws AiSpectExceptionExecute the orchestration logic of the graph agent. This method is responsible for parsing the available node resources, calling the large model to generate an execution plan, and scheduling each node in the execution graph in sequence according to the plan. At the same time, corresponding life cycle hooks are triggered at different stages (Hook)and exception handling strategies.- Specified by:
orchestrateGraphin interfaceAiGraphBehaviorOrchestrator<Object>- Specified by:
orchestrateGraphin classAbstractGraphAgent<Object,Object, Object> - Parameters:
nodeResources- A collection of resources containing nodes available in the graph, with keys Bean The name of Bean Examplectx- current AI Context information of the call, including model configuration, parameters, etc.- Returns:
- The final result after the entire graph is executed
- Throws:
AiSpectException- Thrown when graph execution fails or model call exception occurs
-