Class BaseReActAgentRunner

java.lang.Object
io.agentscope.core.a2a.server.executor.runner.BaseReActAgentRunner
All Implemented Interfaces:
AgentRunner
Direct Known Subclasses:
ReActAgentWithBuilderRunner

public abstract class BaseReActAgentRunner extends Object implements AgentRunner
Abstract Implementation for AgentRunner by ReActAgent.

Use ReActAgent directly to handler request from A2A client. In this implementation, ReActAgent should be created for each request and be cached to intercept when the request is stopped.

  • Constructor Details

    • BaseReActAgentRunner

      protected BaseReActAgentRunner()
  • Method Details

    • getAgentName

      public String getAgentName()
      Description copied from interface: AgentRunner
      Get agent name to build AgentCard.
      Specified by:
      getAgentName in interface AgentRunner
      Returns:
      agent name
    • getAgentDescription

      public String getAgentDescription()
      Description copied from interface: AgentRunner
      Get agent description to build AgentCard.
      Specified by:
      getAgentDescription in interface AgentRunner
      Returns:
      agent description
    • streamEvents

      public reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(List<io.agentscope.core.message.Msg> requestMessages, AgentRequestOptions options)
      Description copied from interface: AgentRunner
      Start to handle agent request with streaming output.
      Specified by:
      streamEvents in interface AgentRunner
      Parameters:
      requestMessages - the messages from a2a client
      options - the options for agent request, such as `taskId`, `sessionId` or `userId` of this request
      Returns:
      Flux of events emitted during execution
    • stop

      public void stop(String taskId)
      Description copied from interface: AgentRunner
      Stop to handle agent request.
      Specified by:
      stop in interface AgentRunner
      Parameters:
      taskId - the taskId of request needed to stop
    • buildReActAgent

      protected abstract io.agentscope.core.ReActAgent buildReActAgent()
      Build ReActAgent to run new request.
      Returns:
      ReActAgent instance