Class AgentCardHelper
java.lang.Object
com.mulesoft.connectors.a2a.internal.client.helper.AgentCardHelper
Helper class for agent card parsing and validation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.a2a.spec.AgentCardhandleAgentCardResponse(URI requestUri, org.mule.runtime.extension.api.runtime.operation.Result<String, ResponseAttributes> result, A2ASerializer a2ASerializer) Parses and validates the agent card from JSON.static io.a2a.spec.AgentCardparseAgentCard(URI requestUri, String json, A2ASerializer a2ASerializer) Converts a JSON string to an AgentCard using the provided serializer.static URIvalidateServerUrl(String serverUrl) Validates the server URL and returns a URI object.
-
Constructor Details
-
AgentCardHelper
public AgentCardHelper()
-
-
Method Details
-
parseAgentCard
public static io.a2a.spec.AgentCard parseAgentCard(URI requestUri, String json, A2ASerializer a2ASerializer) throws AgentCardDiscoveryException Converts a JSON string to an AgentCard using the provided serializer.- Parameters:
requestUri-json-a2ASerializer-- Returns:
- Throws:
AgentCardDiscoveryException
-
handleAgentCardResponse
public static io.a2a.spec.AgentCard handleAgentCardResponse(URI requestUri, org.mule.runtime.extension.api.runtime.operation.Result<String, ResponseAttributes> result, A2ASerializer a2ASerializer) throws AgentCardDiscoveryExceptionParses and validates the agent card from JSON. Ensures the service URL is present and valid.- Parameters:
requestUri-- Returns:
- Throws:
AgentCardDiscoveryException
-
validateServerUrl
Validates the server URL and returns a URI object.- Parameters:
serverUrl-- Returns:
- Throws:
AgentCardDiscoveryException
-