Class AgentScopeA2aServer

java.lang.Object
io.agentscope.core.a2a.server.AgentScopeA2aServer

public class AgentScopeA2aServer extends Object
Agentscope A2a Server.

The core enter class for developer to export agent as A2A Server by agentscope, Developers should build server with:

  • Required: Custom Agent such as ReActAgent.
  • Optional: Custom AgentCard.
  • Optional: Choose supported to export transport, such as `JSONRPC`.
  • Optional: A2A Registry(s) when server ready to access request.
  • Optional: A2A Server Feature implementations, TaskStore, QueueManager, PushNotificationConfigStore, PushNotificationSender.

The Server is not listen ports and export endpoints. The main logic for this Server class is build and assemble all component for handle a2a request.

For example, Developers want to export JSON-RPC transport for A2A server, they should do follow the simplest steps:

  1. Build Custom Agent, such as ReActAgent with ReActAgent.Builder.
  2. Create Builder of AgentScopeA2aServer with required ReActAgent.Builder.
  3. Build AgentScopeA2aServer instance and hold it.
  4. Export web server with custom port and custom Controller to access web JSON-RPC request.
  5. call postEndpointReady() when web server ready.
  6. Get TransportWrapper implementation for JSON-RPC from this AgentScopeA2aServer to actual handle request when client request received.