Package io.a2a.client
Class A2ACardResolver
java.lang.Object
io.a2a.client.A2ACardResolver
-
Constructor Summary
ConstructorsConstructorDescriptionA2ACardResolver(A2AHttpClient httpClient, String baseUrl) A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCardPath) A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCardPath, Map<String, String> authHeaders) -
Method Summary
Modifier and TypeMethodDescriptionGet the agent card for the configured A2A agent.
-
Constructor Details
-
A2ACardResolver
- Parameters:
httpClient- the http client to usebaseUrl- the base URL for the agent whose agent card we want to retrieve- Throws:
A2AClientError- if the URL for the agent is invalid
-
A2ACardResolver
public A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCardPath) throws A2AClientError - Parameters:
httpClient- the http client to usebaseUrl- the base URL for the agent whose agent card we want to retrieveagentCardPath- optional path to the agent card endpoint relative to the base agent URL, defaults to ".well-known/agent.json"- Throws:
A2AClientError- if the URL for the agent is invalid
-
A2ACardResolver
public A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCardPath, Map<String, String> authHeaders) throws A2AClientError- Parameters:
httpClient- the http client to usebaseUrl- the base URL for the agent whose agent card we want to retrieveagentCardPath- optional path to the agent card endpoint relative to the base agent URL, defaults to ".well-known/agent.json"authHeaders- the HTTP authentication headers to use. May benull- Throws:
A2AClientError- if the URL for the agent is invalid
-
-
Method Details
-
getAgentCard
Get the agent card for the configured A2A agent.- Returns:
- the agent card
- Throws:
A2AClientError- If an HTTP error occurs fetching the cardA2AClientJSONError- f the response body cannot be decoded as JSON or validated against the AgentCard schema
-