a2a

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AgentCardRoute is the well-known HTTP path for the A2A Agent Card.
	AgentCardRoute = "/.well-known/agent.json"

	// ContentTypeJSON is the MIME type for JSON responses.
	ContentTypeJSON = "application/json"

	// SkillTagOrchestration tags the root agent skill.
	SkillTagOrchestration = "orchestration"

	// SkillTagSubAgentPrefix prefixes sub-agent skill tags.
	SkillTagSubAgentPrefix = "sub_agent:"
)

Variables

This section is empty.

Functions

func LoadRemoteAgents

func LoadRemoteAgents(remotes []config.RemoteAgentConfig, logger *zap.SugaredLogger) ([]agent.Agent, error)

LoadRemoteAgents creates ADK agents from the configured remote A2A agent list. Each remote agent can be used as a sub-agent in the orchestrator.

Types

type AgentCard

type AgentCard struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	URL         string       `json:"url"`
	Skills      []AgentSkill `json:"skills"`

	// P2P extensions
	DID           string         `json:"did,omitempty"`
	Multiaddrs    []string       `json:"multiaddrs,omitempty"`
	Capabilities  []string       `json:"capabilities,omitempty"`
	Pricing       *PricingInfo   `json:"pricing,omitempty"`
	ZKCredentials []ZKCredential `json:"zkCredentials,omitempty"`
}

AgentCard is a simplified representation of the A2A Agent Card served at /.well-known/agent.json.

type AgentSkill

type AgentSkill struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags,omitempty"`
}

AgentSkill describes a capability of the agent.

type PricingInfo

type PricingInfo struct {
	Currency   string            `json:"currency"`
	PerQuery   string            `json:"perQuery,omitempty"`
	PerMinute  string            `json:"perMinute,omitempty"`
	ToolPrices map[string]string `json:"toolPrices,omitempty"`
}

PricingInfo describes the pricing for an agent's services.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server exposes a Lango agent as an A2A-compatible server.

func NewServer

func NewServer(cfg config.A2AConfig, adkAgent agent.Agent, logger *zap.SugaredLogger) *Server

NewServer creates a new A2A server for the given agent.

func (*Server) Card

func (s *Server) Card() *AgentCard

Card returns the agent card (used by P2P gossip and protocol).

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes(mux interface {
	Get(string, http.HandlerFunc)
})

RegisterRoutes mounts the A2A routes on the given HTTP mux. - GET /.well-known/agent.json — serves the Agent Card

func (*Server) SetP2PInfo

func (s *Server) SetP2PInfo(did string, multiaddrs, capabilities []string)

SetP2PInfo adds P2P networking information to the agent card.

func (*Server) SetPricing

func (s *Server) SetPricing(pricing *PricingInfo)

SetPricing sets the pricing information on the agent card.

type ZKCredential

type ZKCredential struct {
	CapabilityID string    `json:"capabilityId"`
	Proof        []byte    `json:"proof"`
	IssuedAt     time.Time `json:"issuedAt"`
	ExpiresAt    time.Time `json:"expiresAt"`
}

ZKCredential is a zero-knowledge proof of agent capability.

Jump to

Keyboard shortcuts

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