类 DefaultA2AServer
java.lang.Object
io.github.a2ap.core.server.impl.DefaultA2AServer
- 所有已实现的接口:
A2AServer
Implementation of the A2AServer interface. This class provides the core functionality
for an A2A server.
-
构造器概要
构造器构造器说明DefaultA2AServer(TaskManager taskManager, AgentExecutor agentExecutor, QueueManager queueManager, AgentCard a2aServerSelfCard) Constructs a new A2AServerImpl with the specified components. -
方法概要
修饰符和类型方法说明cancelTask(String taskId) Cancels a task.Retrieves the AgentCard for the server itself.Retrieves a task by its ID.getTaskPushNotification(String taskId) Retrieves the push notification configuration for a task.handleMessage(MessageSendParams params) Handle the task on the server.reactor.core.publisher.Flux<SendStreamingMessageResponse>handleMessageStream(MessageSendParams params) Handle send task streaming.Sets or updates the push notification configuration for a task.reactor.core.publisher.Flux<SendStreamingMessageResponse>subscribeToTaskUpdates(String taskId) Subscribes to streaming updates for a task.
-
构造器详细资料
-
DefaultA2AServer
public DefaultA2AServer(TaskManager taskManager, AgentExecutor agentExecutor, QueueManager queueManager, AgentCard a2aServerSelfCard) Constructs a new A2AServerImpl with the specified components.- 参数:
taskManager- The TaskManager to use for task management.agentExecutor- The AgentExecutor to use for agent execution.queueManager- The QueueManager to use for event queue management.
-
-
方法详细资料
-
handleMessage
Handle the task on the server.- 指定者:
handleMessage在接口中A2AServer- 参数:
params- The Task params object to handle.- 返回:
- The Task object with updated status and ID.
- 抛出:
IllegalArgumentException- if the task is invalid
-
handleMessageStream
public reactor.core.publisher.Flux<SendStreamingMessageResponse> handleMessageStream(MessageSendParams params) 从接口复制的说明:A2AServerHandle send task streaming.- 指定者:
handleMessageStream在接口中A2AServer- 参数:
params- The task params to send- 返回:
- Streaming events
-
getTask
Retrieves a task by its ID. -
cancelTask
Cancels a task.- 指定者:
cancelTask在接口中A2AServer- 参数:
taskId- The ID of the task to cancel.- 返回:
- The cancelled Task object if successful, otherwise null.
-
setTaskPushNotification
Sets or updates the push notification configuration for a task.- 指定者:
setTaskPushNotification在接口中A2AServer- 参数:
config- The TaskPushNotificationConfig to set.- 返回:
- The set TaskPushNotificationConfig if successful, otherwise null.
-
getTaskPushNotification
Retrieves the push notification configuration for a task.- 指定者:
getTaskPushNotification在接口中A2AServer- 参数:
taskId- The ID of the task.- 返回:
- The TaskPushNotificationConfig if found, otherwise null.
-
subscribeToTaskUpdates
public reactor.core.publisher.Flux<SendStreamingMessageResponse> subscribeToTaskUpdates(String taskId) Subscribes to streaming updates for a task.- 指定者:
subscribeToTaskUpdates在接口中A2AServer- 参数:
taskId- The ID of the task to subscribe to.- 返回:
- A Flux of Task objects representing the updates.
-
getSelfAgentCard
Retrieves the AgentCard for the server itself.- 指定者:
getSelfAgentCard在接口中A2AServer- 返回:
- The AgentCard of the server.
-