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

public class DynamicWorkflowGraphAgent extends AbstractGraphAgent<Object,Object,Object>
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。
  • Constructor Details

    • DynamicWorkflowGraphAgent

      public DynamicWorkflowGraphAgent()
  • Method Details

    • orchestrateGraph

      public Object orchestrateGraph(Map<String,Object> nodeResources, AiInvocationContext<?> ctx) throws AiSpectException
      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.
      Specified by:
      orchestrateGraph in interface AiGraphBehaviorOrchestrator<Object>
      Specified by:
      orchestrateGraph in class AbstractGraphAgent<Object,Object,Object>
      Parameters:
      nodeResources - A collection of resources containing nodes available in the graph, with keys Bean The name of Bean Example
      ctx - 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