a2a

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCard

type AgentCard struct {
	Name                string           `json:"name"`
	URL                 string           `json:"url"`
	SupportedInterfaces []AgentInterface `json:"supportedInterfaces,omitempty"`
}

AgentCard contains the fields needed for discovery.

type AgentInterface

type AgentInterface struct {
	URL             string `json:"url"`
	ProtocolBinding string `json:"protocolBinding"`
	ProtocolVersion string `json:"protocolVersion"`
}

AgentInterface declares a concrete A2A endpoint.

type Client

type Client struct {
	BaseURL      string
	HTTPClient   *http.Client
	PollInterval time.Duration
}

Client is a minimal JSON-RPC A2A client.

func NewClient

func NewClient(baseURL string, httpClient *http.Client) *Client

NewClient creates a client with sane defaults.

func (*Client) Discover

func (c *Client) Discover(ctx context.Context) (*AgentCard, error)

Discover fetches the public agent card.

func (*Client) RunTextTask

func (c *Client) RunTextTask(ctx context.Context, requestID, prompt string) (*TaskResult, error)

RunTextTask sends a text task prompt and waits for a terminal response.

type TaskResult

type TaskResult struct {
	AgentName string
	RPCURL    string
	TaskID    string
	ContextID string
	State     string
	Output    string
	Completed bool
}

TaskResult is the normalized outcome of a remote A2A task.

Jump to

Keyboard shortcuts

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