Class A2AClient
java.lang.Object
com.mulesoft.connectors.a2a.internal.client.connection.A2AClient
-
Constructor Summary
ConstructorsConstructorDescriptionA2AClient(String baseUrl, int responseTimeout, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.extension.http.api.request.authentication.HttpRequestAuthentication authentication, org.mule.runtime.api.util.MultiMap<String, String> defaultHeaders, JsonRpcSerializer serializer) -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> cancelTask(InputStream taskId, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getAgentCard(boolean useExtendedCard, boolean setBaseUrl, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card and returns it as an AgentCard object.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, boolean setBaseUrl, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card from the agent via "agent/card" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getTask(InputStream query, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the task current state from the agent via "tasks/get" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendMessage(InputStream message, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "message/send" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendTask(InputStream task, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "tasks/send" operation.voidsetBaseUrl(String baseUrl)
-
Constructor Details
-
A2AClient
public A2AClient(String baseUrl, int responseTimeout, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.extension.http.api.request.authentication.HttpRequestAuthentication authentication, org.mule.runtime.api.util.MultiMap<String, String> defaultHeaders, JsonRpcSerializer serializer)
-
-
Method Details
-
setBaseUrl
-
sendTask
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendTask(InputStream task, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "tasks/send" operation.- Parameters:
task- MessageSendParams for rpc request- Returns:
- Response
-
sendMessage
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendMessage(InputStream message, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "message/send" operation.- Parameters:
message- messageSendParams for rpc request- Returns:
- Response
-
getTask
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getTask(InputStream query, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the task current state from the agent via "tasks/get" operation.- Parameters:
query- taskIdParams for rpc request- Returns:
- Response
-
getCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card from the agent via "agent/card" operation.- Parameters:
useExtendedCard- whether to use the extended card endpoint- Returns:
- Response
-
getCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, boolean setBaseUrl, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) -
cancelTask
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> cancelTask(InputStream taskId, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) -
getAgentCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getAgentCard(boolean useExtendedCard, boolean setBaseUrl, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card and returns it as an AgentCard object. This method encapsulates the conversion from raw response to AgentCard. It also validates the agent card and sets the service URL as the base URL.- Returns:
- CompletableFuture
-
getServiceUrl
-