Class A2ACardResolver_v0_3
java.lang.Object
org.a2aproject.sdk.compat03.client.http.A2ACardResolver_v0_3
-
Constructor Summary
ConstructorsConstructorDescriptionA2ACardResolver_v0_3(String baseUrl) Get the agent card for an A2A agent.A2ACardResolver_v0_3(A2AHttpClient httpClient, String baseUrl) Constructs an A2ACardResolver with a specific HTTP client and base URL.A2ACardResolver_v0_3(A2AHttpClient httpClient, String baseUrl, @Nullable String agentCardPath, @Nullable Map<String, String> authHeaders) A2ACardResolver_v0_3(A2AHttpClient httpClient, String baseUrl, String agentCardPath) -
Method Summary
Modifier and TypeMethodDescriptionGet the agent card for the configured A2A agent.
-
Constructor Details
-
A2ACardResolver_v0_3
Get the agent card for an A2A agent. The HTTP client will be auto-selected viaA2AHttpClientFactory.- Parameters:
baseUrl- the base URL for the agent whose agent card we want to retrieve- Throws:
A2AClientError_v0_3- if the URL for the agent is invalid
-
A2ACardResolver_v0_3
Constructs an A2ACardResolver with a specific HTTP client and base URL.- Parameters:
httpClient- the http client to usebaseUrl- the base URL for the agent whose agent card we want to retrieve- Throws:
A2AClientError_v0_3- if the URL for the agent is invalid
-
A2ACardResolver_v0_3
public A2ACardResolver_v0_3(A2AHttpClient httpClient, String baseUrl, String agentCardPath) throws A2AClientError_v0_3 - 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-card.json"- Throws:
A2AClientError_v0_3- if the URL for the agent is invalid
-
A2ACardResolver_v0_3
public A2ACardResolver_v0_3(A2AHttpClient httpClient, String baseUrl, @Nullable String agentCardPath, @Nullable Map<String, String> authHeaders) throws A2AClientError_v0_3- 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-card.json"authHeaders- the HTTP authentication headers to use. May benull- Throws:
A2AClientError_v0_3- 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_v0_3- If an HTTP error occurs fetching the cardA2AClientJSONError_v0_3- If the response body cannot be decoded as JSON or validated against the AgentCard schema
-