a2a

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(agent Agent, text string) (string, error)

func Close

func Close(agent Agent) error

Types

type Agent

type Agent struct {
	Card   *a2a.AgentCard
	Client *a2aclient.Client
}

func Discover

func Discover(url string) (Agent, error)

func DiscoverGuarded

func DiscoverGuarded(url string, httpClient *http.Client) (Agent, error)

type Artifact

type Artifact struct {
	Name string
	Text string
}

type Request

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

func Context

func Context(req Request, id string) Request

func New

func New(agent Agent) Request

func OnStatus

func OnStatus(req Request, handler StatusHandler) Request

func OnText

func OnText(req Request, handler TextHandler) Request

func Retry added in v0.0.6

func Retry(req Request, maxAttempts int, delayMs int) Request

func Text

func Text(req Request, text string) Request

type Skill

type Skill struct {
	Name        string
	Description string
	Examples    []string
}

func Skills

func Skills(agent Agent) []Skill

type StatusHandler

type StatusHandler func(StatusUpdate)

type StatusUpdate

type StatusUpdate struct {
	TaskID  string
	State   string
	Message string
	Final   bool
}

type Task

type Task struct {
	ID        string
	ContextID string
	State     string
	Text      string
	Artifacts []Artifact
}

func Cancel

func Cancel(agent Agent, taskID string) (Task, error)

func GetTask

func GetTask(agent Agent, taskID string) (Task, error)

func Send

func Send(req Request) (Task, error)

func Stream

func Stream(req Request) (Task, error)

type TextHandler

type TextHandler func(string)

Jump to

Keyboard shortcuts

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