接口 A2AServer
- 所有已知实现类:
DefaultA2AServer
public interface A2AServer
Interface defining the core functionality of an A2A server.
The A2A server is responsible for managing tasks and agent interactions.
-
方法概要
修饰符和类型方法说明cancelTask(String taskId) Cancels a task.Retrieves the AgentCard for this server.Gets a task by its ID.getTaskPushNotification(String taskId) Retrieves the push notification configuration for a task.handleMessage(MessageSendParams params) Handle send message task.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 updates for a specific task.
-
方法详细资料
-
handleMessage
Handle send message task.- 参数:
params- The task params to send- 返回:
- SendMessageResponse The task or Message
-
handleMessageStream
reactor.core.publisher.Flux<SendStreamingMessageResponse> handleMessageStream(MessageSendParams params) Handle send task streaming.- 参数:
params- The task params to send- 返回:
- Streaming events
-
getTask
Gets a task by its ID.- 参数:
taskId- The ID of the task- 返回:
- The Task object or null if not found
-
cancelTask
Cancels a task.- 参数:
taskId- The ID of the task to cancel- 返回:
- The updated Task object (usually in a cancelled state) or null if not found or cancellation failed
-
setTaskPushNotification
Sets or updates the push notification configuration for a task.- 参数:
config- The push notification configuration- 返回:
- The confirmed TaskPushNotificationConfig or null if setting failed
-
getTaskPushNotification
Retrieves the push notification configuration for a task.- 参数:
taskId- The ID of the task- 返回:
- The TaskPushNotificationConfig or null if not found
-
getSelfAgentCard
AgentCard getSelfAgentCard()Retrieves the AgentCard for this server.- 返回:
- The server's AgentCard
-
subscribeToTaskUpdates
Subscribes to updates for a specific task.- 参数:
taskId- The ID of the task to subscribe to- 返回:
- A Flux of Task objects representing updates
-