infrastructure

package
v0.228.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFailure added in v0.226.0

func AuthFailure(agentURL string, err error) (string, bool)

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

func NewClient(agentURL string) client.A2AClient

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

func PolicyRefusal(err error) (string, bool)

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

func PreferredEndpointURL(card *adk.AgentCard, fallback string) string

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

func Rejection(agentURL string, err error) (string, bool)

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 (s *AgentCardClient) GetAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

func (*AgentCardClient) GetAgentCards

func (s *AgentCardClient) GetAgentCards(ctx context.Context) ([]*a2adomain.CachedAgentCard, error)

func (*AgentCardClient) GetConfiguredAgents

func (s *AgentCardClient) GetConfiguredAgents() []string

type AuthError added in v0.226.0

type AuthError struct {
	Agent  string
	Reason string
}

AuthError reports that a request to an agent could not be given credentials. Its reason names variables, URLs and status codes, never a secret.

func (*AuthError) Error added in v0.226.0

func (e *AuthError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL