JSONRPCHandler
public class JSONRPCHandler
io/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:55–273JSON RPC 处理器,支持智能体之间的发现、委派与协作。位于 io.agentscope.runtime.protocol.a2a 包。核心成员包括 onMessageSend、onMessageSendStream、onCancelTask、onResubscribeToTask、getPushNotificationConfig、setPushNotificationConfig。
A class in io.agentscope.runtime.protocol.a2a that supports discovery, delegation and collaboration between agents. Declared in io.agentscope.runtime.protocol.a2a.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected JSONRPCHandler() | 初始化 `JSONRPCHandler` 实例。 Creates a new instance. |
public JSONRPCHandler(AgentCard agentCard, RequestHandler requestHandler) | 初始化 `JSONRPCHandler` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
JSONRPCHandler
protected JSONRPCHandler()
初始化 JSONRPCHandler 实例。
Creates a new instance.
io/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:61–62JSONRPCHandler
public JSONRPCHandler(AgentCard agentCard, RequestHandler requestHandler)
初始化 JSONRPCHandler 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentCard | AgentCard | 智能体卡片(类型 `AgentCard`)。The agent card. |
requestHandler | RequestHandler | 请求处理器(类型 `RequestHandler`)。The request handler. |
io/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:64–67方法详情Method Detail
onMessageSend
public SendMessageResponse onMessageSend(SendMessageRequest request, ServerCallContext serverCallContext)
处理消息发送事件。
Performs the on message send operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | SendMessageRequest | 请求(类型 `SendMessageRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
SendMessageResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:69–80onMessageSendStream
public Flow.Publisher<SendStreamingMessageResponse> onMessageSendStream(SendStreamingMessageRequest request, ServerCallContext serverCallContext)
处理消息发送流事件。
Performs the on message send stream operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | SendStreamingMessageRequest | 请求(类型 `SendStreamingMessageRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
Flow.Publisher<SendStreamingMessageResponse>io/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:82–103onCancelTask
public CancelTaskResponse onCancelTask(CancelTaskRequest request, ServerCallContext serverCallContext)
处理取消任务事件。
Performs the on cancel task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | CancelTaskRequest | 请求(类型 `CancelTaskRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
CancelTaskResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:105–119onResubscribeToTask
public Flow.Publisher<SendStreamingMessageResponse> onResubscribeToTask(TaskResubscriptionRequest request, ServerCallContext serverCallContext)
处理 onResubscribeToTask 事件。
Performs the on resubscribe to task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | TaskResubscriptionRequest | 请求(类型 `TaskResubscriptionRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
Flow.Publisher<SendStreamingMessageResponse>io/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:121–142getPushNotificationConfig
public GetTaskPushNotificationConfigResponse getPushNotificationConfig(GetTaskPushNotificationConfigRequest request, ServerCallContext serverCallContext)
获取推送通知配置。
Returns the push notification config.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | GetTaskPushNotificationConfigRequest | 请求(类型 `GetTaskPushNotificationConfigRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
GetTaskPushNotificationConfigResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:144–159setPushNotificationConfig
public SetTaskPushNotificationConfigResponse setPushNotificationConfig(SetTaskPushNotificationConfigRequest request, ServerCallContext serverCallContext)
设置推送通知配置。
Sets the push notification config.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | SetTaskPushNotificationConfigRequest | 请求(类型 `SetTaskPushNotificationConfigRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
SetTaskPushNotificationConfigResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:161–176onGetTask
public GetTaskResponse onGetTask(GetTaskRequest request, ServerCallContext serverCallContext)
处理读取任务事件。
Performs the on get task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | GetTaskRequest | 请求(类型 `GetTaskRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
GetTaskResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:178–189listPushNotificationConfig
public ListTaskPushNotificationConfigResponse listPushNotificationConfig(ListTaskPushNotificationConfigRequest request, ServerCallContext serverCallContext)
列出推送通知配置。
Lists the push notification config.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | ListTaskPushNotificationConfigRequest | 请求(类型 `ListTaskPushNotificationConfigRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
ListTaskPushNotificationConfigResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:191–207deletePushNotificationConfig
public DeleteTaskPushNotificationConfigResponse deletePushNotificationConfig(DeleteTaskPushNotificationConfigRequest request, ServerCallContext serverCallContext)
删除推送通知配置。
Deletes the push notification config.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
request | DeleteTaskPushNotificationConfigRequest | 请求(类型 `DeleteTaskPushNotificationConfigRequest`)。The request. |
serverCallContext | ServerCallContext | 服务端调用上下文(类型 `ServerCallContext`)。The server call context. |
DeleteTaskPushNotificationConfigResponseio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:209–225getAgentCard
public AgentCard getAgentCard()
获取智能体卡片。
Returns the agent card.
AgentCardio/agentscope/runtime/protocol/a2a/JSONRPCHandler.java:227–229