Interface ClientTransport
public interface ClientTransport
Interface for a client transport.
-
Method Summary
Modifier and TypeMethodDescriptionorg.a2aproject.sdk.spec.TaskcancelTask(org.a2aproject.sdk.spec.CancelTaskParams request, @Nullable ClientCallContext context) Request the agent to cancel a specific task.voidclose()Close the transport and release any associated resources.org.a2aproject.sdk.spec.TaskPushNotificationConfigcreateTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.TaskPushNotificationConfig request, @Nullable ClientCallContext context) Create or update the push notification configuration for a specific task.voiddeleteTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.DeleteTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) Delete the list of push notification configurations for a specific task.org.a2aproject.sdk.spec.AgentCardgetExtendedAgentCard(org.a2aproject.sdk.spec.GetExtendedAgentCardParams params, @Nullable ClientCallContext context) Retrieve the extended AgentCard.org.a2aproject.sdk.spec.TaskgetTask(org.a2aproject.sdk.spec.TaskQueryParams request, @Nullable ClientCallContext context) Retrieve the current state and history of a specific task.org.a2aproject.sdk.spec.TaskPushNotificationConfiggetTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.GetTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) Retrieve the push notification configuration for a specific task.org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResultlistTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) Retrieve the list of push notification configurations for a specific task with pagination support.org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResultlistTasks(org.a2aproject.sdk.spec.ListTasksParams request, @Nullable ClientCallContext context) List tasks with optional filtering and pagination.org.a2aproject.sdk.spec.EventKindsendMessage(org.a2aproject.sdk.spec.MessageSendParams request, @Nullable ClientCallContext context) Send a non-streaming message request to the agent.voidsendMessageStreaming(org.a2aproject.sdk.spec.MessageSendParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) Send a streaming message request to the agent and receive responses as they arrive.voidsubscribeToTask(org.a2aproject.sdk.spec.TaskIdParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) Reconnect to get task updates for an existing task.
-
Method Details
-
sendMessage
org.a2aproject.sdk.spec.EventKind sendMessage(org.a2aproject.sdk.spec.MessageSendParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Send a non-streaming message request to the agent.- Parameters:
request- the message send parameterscontext- optional client call context for the request (may benull)- Returns:
- the response, either a Task or Message
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if sending the message fails for any reason
-
sendMessageStreaming
void sendMessageStreaming(org.a2aproject.sdk.spec.MessageSendParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Send a streaming message request to the agent and receive responses as they arrive.- Parameters:
request- the message send parameterseventConsumer- consumer that will receive streaming events as they arriveerrorConsumer- consumer that will be called if an error occurs during streamingcontext- optional client call context for the request (may benull)- Throws:
org.a2aproject.sdk.spec.A2AClientException- if setting up the streaming connection fails
-
getTask
org.a2aproject.sdk.spec.Task getTask(org.a2aproject.sdk.spec.TaskQueryParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Retrieve the current state and history of a specific task.- Parameters:
request- the task query parameters specifying which task to retrievecontext- optional client call context for the request (may benull)- Returns:
- the task
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if retrieving the task fails for any reason
-
cancelTask
org.a2aproject.sdk.spec.Task cancelTask(org.a2aproject.sdk.spec.CancelTaskParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Request the agent to cancel a specific task.- Parameters:
request- the task ID parameters specifying which task to cancelcontext- optional client call context for the request (may benull)- Returns:
- the cancelled task
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if cancelling the task fails for any reason
-
listTasks
org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResult listTasks(org.a2aproject.sdk.spec.ListTasksParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException List tasks with optional filtering and pagination.- Parameters:
request- the list tasks parameters including filters and paginationcontext- optional client call context for the request (may benull)- Returns:
- the list tasks result containing tasks and pagination information
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if listing tasks fails for any reason
-
createTaskPushNotificationConfiguration
org.a2aproject.sdk.spec.TaskPushNotificationConfig createTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.TaskPushNotificationConfig request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Create or update the push notification configuration for a specific task.- Parameters:
request- the push notification configuration to set for the taskcontext- optional client call context for the request (may benull)- Returns:
- the configured TaskPushNotificationConfig
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if creating or updating the task push notification configuration fails for any reason
-
getTaskPushNotificationConfiguration
org.a2aproject.sdk.spec.TaskPushNotificationConfig getTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.GetTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Retrieve the push notification configuration for a specific task.- Parameters:
request- the parameters specifying which task's notification config to retrievecontext- optional client call context for the request (may benull)- Returns:
- the task push notification config
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if getting the task push notification config fails for any reason
-
listTaskPushNotificationConfigurations
org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Retrieve the list of push notification configurations for a specific task with pagination support.- Parameters:
request- the parameters specifying which task's notification configs to retrievecontext- optional client call context for the request (may benull)- Returns:
- the result containing the list of task push notification configs and pagination information
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if getting the task push notification configs fails for any reason
-
deleteTaskPushNotificationConfigurations
void deleteTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.DeleteTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Delete the list of push notification configurations for a specific task.- Parameters:
request- the parameters specifying which task's notification configs to deletecontext- optional client call context for the request (may benull)- Throws:
org.a2aproject.sdk.spec.A2AClientException- if deleting the task push notification configs fails for any reason
-
subscribeToTask
void subscribeToTask(org.a2aproject.sdk.spec.TaskIdParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Reconnect to get task updates for an existing task.- Parameters:
request- the task ID parameters specifying which task to subscribe toeventConsumer- consumer that will receive streaming events as they arriveerrorConsumer- consumer that will be called if an error occurs during streamingcontext- optional client call context for the request (may benull)- Throws:
org.a2aproject.sdk.spec.A2AClientException- if subscribing to the task fails for any reason
-
getExtendedAgentCard
org.a2aproject.sdk.spec.AgentCard getExtendedAgentCard(org.a2aproject.sdk.spec.GetExtendedAgentCardParams params, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.A2AClientException Retrieve the extended AgentCard.- Parameters:
params- the parameters to get the extended agent card.context- optional client call context for the request (may benull)- Returns:
- the extended agent card
- Throws:
org.a2aproject.sdk.spec.A2AClientException- if retrieving the agent card fails for any reason
-
close
void close()Close the transport and release any associated resources.
-