Documentation
¶
Index ¶
- func AuthFailure(agentURL string, err error) (string, bool)
- func NewClient(agentURL string) client.A2AClient
- func PolicyRefusal(err error) (string, bool)
- func PreferredEndpointURL(card *adk.AgentCard, fallback string) string
- func Rejection(agentURL string, err error) (string, bool)
- func RouteAgent(name, configuredURL, runningAt string)
- func UnrouteAgent(name string)
- func UseGatewayCredential(gatewayURL, apiKey string)
- type AgentCardClient
- type AuthError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthFailure ¶ added in v0.226.0
AuthFailure describes err for the model when it is an authentication failure: credentials that could not be obtained, or a 401 or 403 from the agent. The message names the agent and leaves the response body out.
func NewClient ¶
NewClient returns an ADK client for the agent at agentURL whose requests carry the session's trace context, so remote spans nest under ours, and the credentials agents.yaml gives the agent. They go to the host the agent actually runs on. Every request activates the usage extension.
func PolicyRefusal ¶ added in v0.226.0
PolicyRefusal describes err for the model when the gateway's guardrails refused the request: a 403 whose body is a JSON-RPC error. The message carries the policy's own words.
func PreferredEndpointURL ¶ added in v0.222.2
PreferredEndpointURL returns the card's preferred interface URL, falling back to the URL the card was fetched from when it declares none. v1.0.1 cards replaced the flat url field with SupportedInterfaces.
func Rejection ¶ added in v0.226.0
Rejection describes err for the model when the agent turned the request down for good, so retrying is pointless: a policy refusal, an authentication failure or a method the agent does not implement.
func RouteAgent ¶ added in v0.226.0
func RouteAgent(name, configuredURL, runningAt string)
RouteAgent sends requests for the named agent, configured at configuredURL, to the host of runningAt. Running on the configured origin clears the route.
func UnrouteAgent ¶ added in v0.226.0
func UnrouteAgent(name string)
UnrouteAgent sends requests for the named agent back to its configured URL.
func UseGatewayCredential ¶ added in v0.226.0
func UseGatewayCredential(gatewayURL, apiKey string)
UseGatewayCredential makes apiKey the bearer token of A2A requests to the gateway at gatewayURL, the token the gateway also expects on inference.
Types ¶
type AgentCardClient ¶
type AgentCardClient struct {
// contains filtered or unexported fields
}
func NewAgentCardClient ¶
func NewAgentCardClient(cfg *config.Config) *AgentCardClient
func (*AgentCardClient) GetAgentCard ¶
func (*AgentCardClient) GetAgentCards ¶
func (s *AgentCardClient) GetAgentCards(ctx context.Context) ([]*a2adomain.CachedAgentCard, error)
func (*AgentCardClient) GetConfiguredAgents ¶
func (s *AgentCardClient) GetConfiguredAgents() []string