Package org.a2aproject.sdk.client.http
Class A2ACardResolver.Builder
java.lang.Object
org.a2aproject.sdk.client.http.A2ACardResolver.Builder
- Enclosing class:
- A2ACardResolver
Builder for creating A2ACardResolver instances with a fluent API.
-
Method Summary
Modifier and TypeMethodDescriptionagentCardPath(@Nullable String agentCardPath) Sets a custom agent card path relative to the base URL.authHeader(String name, String value) Adds a single authentication header.authHeaders(@Nullable Map<String, String> authHeaders) Sets the authentication headers to use when fetching the agent card.Sets the base URL for the agent.build()Builds the A2ACardResolver instance.httpClient(A2AHttpClient httpClient) Sets the HTTP client to use for fetching agent cards.Sets the tenant path to use when fetching the agent card.
-
Method Details
-
httpClient
Sets the HTTP client to use for fetching agent cards. If not called, a default client is created viaA2AHttpClientFactory.create().- Parameters:
httpClient- the HTTP client to use- Returns:
- this builder
-
baseUrl
Sets the base URL for the agent.- Parameters:
baseUrl- the base URL, must not be null- Returns:
- this builder
-
tenant
Sets the tenant path to use when fetching the agent card.- Parameters:
tenant- the tenant path, may be null for no tenant- Returns:
- this builder
-
agentCardPath
Sets a custom agent card path relative to the base URL.- Parameters:
agentCardPath- the custom agent card path; if null or empty, defaults to/.well-known/agent-card.json- Returns:
- this builder
-
authHeaders
Sets the authentication headers to use when fetching the agent card.- Parameters:
authHeaders- the authentication headers, may be null- Returns:
- this builder
-
authHeader
Adds a single authentication header.- Parameters:
name- the header namevalue- the header value- Returns:
- this builder
-
build
Builds the A2ACardResolver instance.- Returns:
- a new A2ACardResolver
- Throws:
A2AClientError- if the configuration is invalidIllegalArgumentException- if baseUrl is null
-