java.lang.Object
com.mulesoft.connectors.a2a.internal.client.connection.A2AClient

public class A2AClient extends Object
  • 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

      public void setBaseUrl(String baseUrl)
    • 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

      public String getServiceUrl()