Interface AgentRunner
- All Known Implementing Classes:
BaseReActAgentRunner,ReActAgentWithBuilderRunner
public interface AgentRunner
Interface for running agents in A2A Server.
This interface defines the core contract for running agents in the A2A Server. It provides methods for starting, stopping, and get messages from agents.
This interface is designed for extending actual handling logics for Agent,
methods will use Msg as input and use AgentEvent as output.
Developers can do some pre-processing before call Agent or post-processing after
calling Agent.
-
Method Summary
Modifier and TypeMethodDescriptionGet agent description to build AgentCard.Get agent name to build AgentCard.voidStop to handle agent request.reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent>streamEvents(List<io.agentscope.core.message.Msg> requestMessages, AgentRequestOptions options) Start to handle agent request with streaming output.
-
Method Details
-
getAgentName
String getAgentName()Get agent name to build AgentCard.- Returns:
- agent name
-
getAgentDescription
String getAgentDescription()Get agent description to build AgentCard.- Returns:
- agent description
-
streamEvents
reactor.core.publisher.Flux<io.agentscope.core.event.AgentEvent> streamEvents(List<io.agentscope.core.message.Msg> requestMessages, AgentRequestOptions options) Start to handle agent request with streaming output.- Parameters:
requestMessages- the messages from a2a clientoptions- the options for agent request, such as `taskId`, `sessionId` or `userId` of this request- Returns:
- Flux of events emitted during execution
-
stop
Stop to handle agent request.- Parameters:
taskId- the taskId of request needed to stop
-