a2a

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 13 Imported by: 0

README

Agent-to-Agent (A2A) Protocol

This package implements Google's Agent-to-Agent (A2A) protocol integration for the Inference Gateway. The A2A protocol is an open standard designed to facilitate interoperability between AI agents, allowing them to discover each other's capabilities, exchange information securely, and coordinate actions.

Features

  • Agent Discovery: Agents can publish an Agent Card (JSON metadata) describing their capabilities, endpoints, and authentication requirements
  • Task Management: Standardized methods for initiating, updating, and completing tasks between agents
  • Streaming & Notifications: Support for Server-Sent Events (SSE) and push notifications for real-time updates
  • Modality Agnostic: Supports various content types, including text, files, forms, and streams

Schema Management

The A2A types are automatically generated from Google's official A2A schema repository:

# Download the latest A2A schema
task a2a:schema:download

# Generate Go types from the schema
task generate

Usage

The A2A client will be integrated with the Inference Gateway to enable communication with multiple remote A2A-compliant agents, allowing clients to utilize services provided by these remote agents based on their capabilities and "Agent Cards".

Configuration

A2A configuration is managed through environment variables:

  • A2A_ENABLE: Enable A2A protocol support (default: false)
  • A2A_EXPOSE: Expose A2A agents list cards endpoint (default: false)
  • A2A_AGENTS: Comma-separated list of A2A agent URLs
  • A2A_CLIENT_TIMEOUT: A2A client timeout (default: 30s)

Documentation

Overview

Code generated from JSON schema. DO NOT EDIT.

Index

Constants

View Source
const (
	ToolQueryAgentCard    = "a2a_query_agent_card"
	ToolSubmitTaskToAgent = "a2a_submit_task_to_agent"
)

Supported A2A tool function names

View Source
const MaxAgentIterations = 10

MaxAgentIterations limits the number of agent loop iterations

Variables

View Source
var (
	ErrClientNotInitialized = errors.New("a2a client not initialized")
	ErrAgentNotFound        = errors.New("a2a agent not found")
	ErrNoAgentURLs          = errors.New("no a2a agent urls provided")
	ErrNoAgentsInitialized  = errors.New("no a2a agents could be initialized")
)

Functions

This section is empty.

Types

type A2AClient

type A2AClient struct {
	AgentURLs         []string
	Logger            logger.Logger
	Config            config.Config
	AgentClients      map[string]client.A2AClient
	AgentCards        map[string]*adk.AgentCard
	AgentCapabilities map[string]adk.AgentCapabilities
	Initialized       bool
	AgentStatuses     map[string]AgentStatus
	// contains filtered or unexported fields
}

A2AClient provides methods to interact with A2A agents using the external client library

func NewA2AClient

func NewA2AClient(cfg config.Config, log logger.Logger) *A2AClient

NewA2AClient creates a new A2A client instance using the external client library

func (*A2AClient) CancelTask

func (c *A2AClient) CancelTask(ctx context.Context, request *adk.CancelTaskRequest, agentURL string) (*adk.CancelTaskSuccessResponse, error)

CancelTask cancels a running task using the external client

func (*A2AClient) GetAgentCapabilities

func (c *A2AClient) GetAgentCapabilities() map[string]adk.AgentCapabilities

GetAgentCapabilities returns the agent capabilities map

func (*A2AClient) GetAgentCard

func (c *A2AClient) GetAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

GetAgentCard retrieves an agent card from the specified agent URL First checks the cache, then fetches from remote if not found

func (*A2AClient) GetAgentSkills

func (c *A2AClient) GetAgentSkills(agentURL string) ([]adk.AgentSkill, error)

GetAgentSkills returns the skills available for the specified agent

func (*A2AClient) GetAgentStatus added in v0.13.0

func (c *A2AClient) GetAgentStatus(agentURL string) AgentStatus

GetAgentStatus returns the status of a specific agent

func (*A2AClient) GetAgents

func (c *A2AClient) GetAgents() []string

GetAgents returns the list of A2A agent URLs

func (*A2AClient) GetAllAgentStatuses added in v0.13.0

func (c *A2AClient) GetAllAgentStatuses() map[string]AgentStatus

GetAllAgentStatuses returns the status of all agents

func (*A2AClient) GetTask

func (c *A2AClient) GetTask(ctx context.Context, request *adk.GetTaskRequest, agentURL string) (*adk.GetTaskSuccessResponse, error)

GetTask retrieves the status of a task using the external client

func (*A2AClient) InitializeAll

func (c *A2AClient) InitializeAll(ctx context.Context) error

InitializeAll discovers and connects to A2A agents using the external client library

func (*A2AClient) IsInitialized

func (c *A2AClient) IsInitialized() bool

IsInitialized returns whether the client has been successfully initialized

func (*A2AClient) RefreshAgentCard

func (c *A2AClient) RefreshAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

RefreshAgentCard forces a refresh of an agent card from the remote source using the external client

func (*A2AClient) SendMessage

func (c *A2AClient) SendMessage(ctx context.Context, request *adk.SendMessageRequest, agentURL string) (*adk.SendMessageSuccessResponse, error)

SendMessage sends a message to the specified agent using the external client library

func (*A2AClient) SendStreamingMessage added in v0.11.0

func (c *A2AClient) SendStreamingMessage(ctx context.Context, request *adk.SendStreamingMessageRequest, agentURL string) (<-chan []byte, error)

SendStreamingMessage sends a streaming message to the specified agent using the external client

func (*A2AClient) StartStatusPolling added in v0.13.0

func (c *A2AClient) StartStatusPolling(ctx context.Context)

StartStatusPolling starts the background status polling goroutine

func (*A2AClient) StopStatusPolling added in v0.13.0

func (c *A2AClient) StopStatusPolling()

StopStatusPolling stops the background status polling goroutine

type A2AClientInterface

type A2AClientInterface interface {
	// InitializeAll discovers and connects to A2A agents
	InitializeAll(ctx context.Context) error

	// IsInitialized returns whether the client has been successfully initialized
	IsInitialized() bool

	// GetAgentCard retrieves an agent card from the specified agent URL
	GetAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

	// RefreshAgentCard forces a refresh of an agent card from the remote source
	RefreshAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

	// SendMessage sends a message to the specified agent (A2A's main task submission method)
	SendMessage(ctx context.Context, request *adk.SendMessageRequest, agentURL string) (*adk.SendMessageSuccessResponse, error)

	// SendStreamingMessage sends a streaming message to the specified agent
	SendStreamingMessage(ctx context.Context, request *adk.SendStreamingMessageRequest, agentURL string) (<-chan []byte, error)

	// GetTask retrieves the status of a task
	GetTask(ctx context.Context, request *adk.GetTaskRequest, agentURL string) (*adk.GetTaskSuccessResponse, error)

	// CancelTask cancels a running task
	CancelTask(ctx context.Context, request *adk.CancelTaskRequest, agentURL string) (*adk.CancelTaskSuccessResponse, error)

	// GetAgents returns the list of A2A agent URLs
	GetAgents() []string

	// GetAgentCapabilities returns the agent capabilities map
	GetAgentCapabilities() map[string]adk.AgentCapabilities

	// GetAgentSkills returns the skills available for the specified agent
	GetAgentSkills(agentURL string) ([]adk.AgentSkill, error)

	// GetAgentStatus returns the status of a specific agent
	GetAgentStatus(agentURL string) AgentStatus

	// GetAllAgentStatuses returns the status of all agents
	GetAllAgentStatuses() map[string]AgentStatus

	// StartStatusPolling starts the background status polling goroutine
	StartStatusPolling(ctx context.Context)

	// StopStatusPolling stops the background status polling goroutine
	StopStatusPolling()
}

A2AClientInterface defines the interface for A2A client implementations

type A2AError

type A2AError interface{}

A discriminated union of all standard JSON-RPC and A2A-specific error types.

type A2ARequest

type A2ARequest interface{}

A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.

type APIKeySecurityScheme

type APIKeySecurityScheme struct {
	Description *string `json:"description,omitempty"`
	In          string  `json:"in"`
	Name        string  `json:"name"`
	Type        string  `json:"type"`
}

Defines a security scheme using an API key.

type Agent

type Agent interface {
	Run(ctx context.Context, request *providers.CreateChatCompletionRequest, response *providers.CreateChatCompletionResponse) error
	RunWithStream(ctx context.Context, middlewareStreamCh chan []byte, c *gin.Context, body *providers.CreateChatCompletionRequest) error
	SetProvider(provider providers.IProvider)
	SetModel(model *string)
}

Agent defines the interface for running agent operations

func NewAgent

func NewAgent(logger logger.Logger, a2aClient A2AClientInterface, a2aConfig *config.A2AConfig) Agent

NewAgent creates a new Agent instance

type AgentCapabilities

type AgentCapabilities struct {
	Extensions             []AgentExtension `json:"extensions,omitempty"`
	PushNotifications      *bool            `json:"pushNotifications,omitempty"`
	StateTransitionHistory *bool            `json:"stateTransitionHistory,omitempty"`
	Streaming              *bool            `json:"streaming,omitempty"`
}

Defines optional capabilities supported by an agent.

type AgentCard

type AgentCard struct {
	AdditionalInterfaces              []AgentInterface          `json:"additionalInterfaces,omitempty"`
	Capabilities                      AgentCapabilities         `json:"capabilities"`
	DefaultInputModes                 []string                  `json:"defaultInputModes"`
	DefaultOutputModes                []string                  `json:"defaultOutputModes"`
	Description                       string                    `json:"description"`
	DocumentationURL                  *string                   `json:"documentationUrl,omitempty"`
	IconURL                           *string                   `json:"iconUrl,omitempty"`
	Name                              string                    `json:"name"`
	PreferredTransport                string                    `json:"preferredTransport,omitempty"`
	ProtocolVersion                   string                    `json:"protocolVersion"`
	Provider                          *AgentProvider            `json:"provider,omitempty"`
	Security                          []map[string][]string     `json:"security,omitempty"`
	SecuritySchemes                   map[string]SecurityScheme `json:"securitySchemes,omitempty"`
	Signatures                        []AgentCardSignature      `json:"signatures,omitempty"`
	Skills                            []AgentSkill              `json:"skills"`
	SupportsAuthenticatedExtendedCard *bool                     `json:"supportsAuthenticatedExtendedCard,omitempty"`
	URL                               string                    `json:"url"`
	Version                           string                    `json:"version"`
}

The AgentCard is a self-describing manifest for an agent. It provides essential metadata including the agent's identity, capabilities, skills, supported communication methods, and security requirements.

type AgentCardSignature added in v0.15.1

type AgentCardSignature struct {
	Header    map[string]interface{} `json:"header,omitempty"`
	Protected string                 `json:"protected"`
	Signature string                 `json:"signature"`
}

AgentCardSignature represents a JWS signature of an AgentCard. This follows the JSON format of an RFC 7515 JSON Web Signature (JWS).

type AgentExtension

type AgentExtension struct {
	Description *string                `json:"description,omitempty"`
	Params      map[string]interface{} `json:"params,omitempty"`
	Required    *bool                  `json:"required,omitempty"`
	URI         string                 `json:"uri"`
}

A declaration of a protocol extension supported by an Agent.

type AgentInterface added in v0.15.1

type AgentInterface struct {
	Transport string `json:"transport"`
	URL       string `json:"url"`
}

Declares a combination of a target URL and a transport protocol for interacting with the agent. This allows agents to expose the same functionality over multiple transport mechanisms.

type AgentProvider

type AgentProvider struct {
	Organization string `json:"organization"`
	URL          string `json:"url"`
}

Represents the service provider of an agent.

type AgentSkill

type AgentSkill struct {
	Description string   `json:"description"`
	Examples    []string `json:"examples,omitempty"`
	ID          string   `json:"id"`
	InputModes  []string `json:"inputModes,omitempty"`
	Name        string   `json:"name"`
	OutputModes []string `json:"outputModes,omitempty"`
	Tags        []string `json:"tags"`
}

Represents a distinct capability or function that an agent can perform.

type AgentStatus added in v0.13.0

type AgentStatus string

AgentStatus represents the status of an A2A agent

const (
	AgentStatusUnknown     AgentStatus = "unknown"
	AgentStatusAvailable   AgentStatus = "available"
	AgentStatusUnavailable AgentStatus = "unavailable"
)

type Artifact

type Artifact struct {
	ArtifactID  string                 `json:"artifactId"`
	Description *string                `json:"description,omitempty"`
	Extensions  []string               `json:"extensions,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Parts       []Part                 `json:"parts"`
}

Represents a file, data structure, or other resource generated by an agent during a task.

type AuthorizationCodeOAuthFlow

type AuthorizationCodeOAuthFlow struct {
	AuthorizationURL string            `json:"authorizationUrl"`
	RefreshURL       *string           `json:"refreshUrl,omitempty"`
	Scopes           map[string]string `json:"scopes"`
	TokenURL         string            `json:"tokenUrl"`
}

Defines configuration details for the OAuth 2.0 Authorization Code flow.

type CancelTaskRequest

type CancelTaskRequest struct {
	ID      interface{}  `json:"id"`
	JSONRPC string       `json:"jsonrpc"`
	Method  string       `json:"method"`
	Params  TaskIdParams `json:"params"`
}

Represents a JSON-RPC request for the `tasks/cancel` method.

type CancelTaskResponse

type CancelTaskResponse interface{}

Represents a JSON-RPC response for the `tasks/cancel` method.

type CancelTaskSuccessResponse

type CancelTaskSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  Task        `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/cancel` method.

type ClientCredentialsOAuthFlow

type ClientCredentialsOAuthFlow struct {
	RefreshURL *string           `json:"refreshUrl,omitempty"`
	Scopes     map[string]string `json:"scopes"`
	TokenURL   string            `json:"tokenUrl"`
}

Defines configuration details for the OAuth 2.0 Client Credentials flow.

type ContentTypeNotSupportedError

type ContentTypeNotSupportedError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating an incompatibility between the requested content types and the agent's capabilities.

type DataPart

type DataPart struct {
	Data     map[string]interface{} `json:"data"`
	Kind     string                 `json:"kind"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Represents a structured data segment (e.g., JSON) within a message or artifact.

type DeleteTaskPushNotificationConfigParams added in v0.15.1

type DeleteTaskPushNotificationConfigParams struct {
	ID                       string                 `json:"id"`
	Metadata                 map[string]interface{} `json:"metadata,omitempty"`
	PushNotificationConfigID string                 `json:"pushNotificationConfigId"`
}

Defines parameters for deleting a specific push notification configuration for a task.

type DeleteTaskPushNotificationConfigRequest added in v0.15.1

type DeleteTaskPushNotificationConfigRequest struct {
	ID      interface{}                            `json:"id"`
	JSONRPC string                                 `json:"jsonrpc"`
	Method  string                                 `json:"method"`
	Params  DeleteTaskPushNotificationConfigParams `json:"params"`
}

Represents a JSON-RPC request for the `tasks/pushNotificationConfig/delete` method.

type DeleteTaskPushNotificationConfigResponse added in v0.15.1

type DeleteTaskPushNotificationConfigResponse interface{}

Represents a JSON-RPC response for the `tasks/pushNotificationConfig/delete` method.

type DeleteTaskPushNotificationConfigSuccessResponse added in v0.15.1

type DeleteTaskPushNotificationConfigSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/delete` method.

type FileBase

type FileBase struct {
	MIMEType *string `json:"mimeType,omitempty"`
	Name     *string `json:"name,omitempty"`
}

Defines base properties for a file.

type FilePart

type FilePart struct {
	File     interface{}            `json:"file"`
	Kind     string                 `json:"kind"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Represents a file segment within a message or artifact. The file content can be provided either directly as bytes or as a URI.

type FileWithBytes

type FileWithBytes struct {
	Bytes    string  `json:"bytes"`
	MIMEType *string `json:"mimeType,omitempty"`
	Name     *string `json:"name,omitempty"`
}

Represents a file with its content provided directly as a base64-encoded string.

type FileWithUri

type FileWithUri struct {
	MIMEType *string `json:"mimeType,omitempty"`
	Name     *string `json:"name,omitempty"`
	URI      string  `json:"uri"`
}

Represents a file with its content located at a specific URI.

type GetTaskPushNotificationConfigParams added in v0.15.1

type GetTaskPushNotificationConfigParams struct {
	ID                       string                 `json:"id"`
	Metadata                 map[string]interface{} `json:"metadata,omitempty"`
	PushNotificationConfigID *string                `json:"pushNotificationConfigId,omitempty"`
}

Defines parameters for fetching a specific push notification configuration for a task.

type GetTaskPushNotificationConfigRequest

type GetTaskPushNotificationConfigRequest struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

Represents a JSON-RPC request for the `tasks/pushNotificationConfig/get` method.

type GetTaskPushNotificationConfigResponse

type GetTaskPushNotificationConfigResponse interface{}

Represents a JSON-RPC response for the `tasks/pushNotificationConfig/get` method.

type GetTaskPushNotificationConfigSuccessResponse

type GetTaskPushNotificationConfigSuccessResponse struct {
	ID      interface{}                `json:"id"`
	JSONRPC string                     `json:"jsonrpc"`
	Result  TaskPushNotificationConfig `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/get` method.

type GetTaskRequest

type GetTaskRequest struct {
	ID      interface{}     `json:"id"`
	JSONRPC string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  TaskQueryParams `json:"params"`
}

Represents a JSON-RPC request for the `tasks/get` method.

type GetTaskResponse

type GetTaskResponse interface{}

Represents a JSON-RPC response for the `tasks/get` method.

type GetTaskSuccessResponse

type GetTaskSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  Task        `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/get` method.

type HTTPAuthSecurityScheme

type HTTPAuthSecurityScheme struct {
	BearerFormat *string `json:"bearerFormat,omitempty"`
	Description  *string `json:"description,omitempty"`
	Scheme       string  `json:"scheme"`
	Type         string  `json:"type"`
}

Defines a security scheme using HTTP authentication.

type ImplicitOAuthFlow

type ImplicitOAuthFlow struct {
	AuthorizationURL string            `json:"authorizationUrl"`
	RefreshURL       *string           `json:"refreshUrl,omitempty"`
	Scopes           map[string]string `json:"scopes"`
}

Defines configuration details for the OAuth 2.0 Implicit flow.

type InternalError

type InternalError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An error indicating an internal error on the server.

type InvalidAgentResponseError

type InvalidAgentResponseError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating that the agent returned a response that does not conform to the specification for the current method.

type InvalidParamsError

type InvalidParamsError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An error indicating that the method parameters are invalid.

type InvalidRequestError

type InvalidRequestError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An error indicating that the JSON sent is not a valid Request object.

type JSONParseError

type JSONParseError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An error indicating that the server received invalid JSON.

type JSONRPCError

type JSONRPCError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

Represents a JSON-RPC 2.0 Error object, included in an error response.

type JSONRPCErrorResponse

type JSONRPCErrorResponse struct {
	Error   interface{} `json:"error"`
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
}

Represents a JSON-RPC 2.0 Error Response object.

type JSONRPCMessage

type JSONRPCMessage struct {
	ID      *interface{} `json:"id,omitempty"`
	JSONRPC string       `json:"jsonrpc"`
}

Defines the base structure for any JSON-RPC 2.0 request, response, or notification.

type JSONRPCRequest

type JSONRPCRequest struct {
	ID      *interface{}           `json:"id,omitempty"`
	JSONRPC string                 `json:"jsonrpc"`
	Method  string                 `json:"method"`
	Params  map[string]interface{} `json:"params,omitempty"`
}

Represents a JSON-RPC 2.0 Request object.

type JSONRPCResponse

type JSONRPCResponse interface{}

A discriminated union representing all possible JSON-RPC 2.0 responses for the A2A specification methods.

type JSONRPCSuccessResponse

type JSONRPCSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

Represents a successful JSON-RPC 2.0 Response object.

type ListTaskPushNotificationConfigParams added in v0.15.1

type ListTaskPushNotificationConfigParams struct {
	ID       string                 `json:"id"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Defines parameters for listing all push notification configurations associated with a task.

type ListTaskPushNotificationConfigRequest added in v0.15.1

type ListTaskPushNotificationConfigRequest struct {
	ID      interface{}                          `json:"id"`
	JSONRPC string                               `json:"jsonrpc"`
	Method  string                               `json:"method"`
	Params  ListTaskPushNotificationConfigParams `json:"params"`
}

Represents a JSON-RPC request for the `tasks/pushNotificationConfig/list` method.

type ListTaskPushNotificationConfigResponse added in v0.15.1

type ListTaskPushNotificationConfigResponse interface{}

Represents a JSON-RPC response for the `tasks/pushNotificationConfig/list` method.

type ListTaskPushNotificationConfigSuccessResponse added in v0.15.1

type ListTaskPushNotificationConfigSuccessResponse struct {
	ID      interface{}                  `json:"id"`
	JSONRPC string                       `json:"jsonrpc"`
	Result  []TaskPushNotificationConfig `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/list` method.

type Message

type Message struct {
	ContextID        *string                `json:"contextId,omitempty"`
	Extensions       []string               `json:"extensions,omitempty"`
	Kind             string                 `json:"kind"`
	MessageID        string                 `json:"messageId"`
	Metadata         map[string]interface{} `json:"metadata,omitempty"`
	Parts            []Part                 `json:"parts"`
	ReferenceTaskIds []string               `json:"referenceTaskIds,omitempty"`
	Role             string                 `json:"role"`
	TaskID           *string                `json:"taskId,omitempty"`
}

Represents a single message in the conversation between a user and an agent.

type MessageSendConfiguration

type MessageSendConfiguration struct {
	AcceptedOutputModes    []string                `json:"acceptedOutputModes,omitempty"`
	Blocking               *bool                   `json:"blocking,omitempty"`
	HistoryLength          *int                    `json:"historyLength,omitempty"`
	PushNotificationConfig *PushNotificationConfig `json:"pushNotificationConfig,omitempty"`
}

Defines configuration options for a `message/send` or `message/stream` request.

type MessageSendParams

type MessageSendParams struct {
	Configuration *MessageSendConfiguration `json:"configuration,omitempty"`
	Message       Message                   `json:"message"`
	Metadata      map[string]interface{}    `json:"metadata,omitempty"`
}

Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task.

type MethodNotFoundError

type MethodNotFoundError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An error indicating that the requested method does not exist or is not available.

type OAuth2SecurityScheme

type OAuth2SecurityScheme struct {
	Description *string    `json:"description,omitempty"`
	Flows       OAuthFlows `json:"flows"`
	Type        string     `json:"type"`
}

Defines a security scheme using OAuth 2.0.

type OAuthFlows

type OAuthFlows struct {
	AuthorizationCode *AuthorizationCodeOAuthFlow `json:"authorizationCode,omitempty"`
	ClientCredentials *ClientCredentialsOAuthFlow `json:"clientCredentials,omitempty"`
	Implicit          *ImplicitOAuthFlow          `json:"implicit,omitempty"`
	Password          *PasswordOAuthFlow          `json:"password,omitempty"`
}

Defines the configuration for the supported OAuth 2.0 flows.

type OpenIdConnectSecurityScheme

type OpenIdConnectSecurityScheme struct {
	Description      *string `json:"description,omitempty"`
	OpenIDConnectURL string  `json:"openIdConnectUrl"`
	Type             string  `json:"type"`
}

Defines a security scheme using OpenID Connect.

type Part

type Part interface{}

A discriminated union representing a part of a message or artifact, which can be text, a file, or structured data.

type PartBase

type PartBase struct {
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Defines base properties common to all message or artifact parts.

type PasswordOAuthFlow

type PasswordOAuthFlow struct {
	RefreshURL *string           `json:"refreshUrl,omitempty"`
	Scopes     map[string]string `json:"scopes"`
	TokenURL   string            `json:"tokenUrl"`
}

Defines configuration details for the OAuth 2.0 Resource Owner Password flow.

type PushNotificationAuthenticationInfo

type PushNotificationAuthenticationInfo struct {
	Credentials *string  `json:"credentials,omitempty"`
	Schemes     []string `json:"schemes"`
}

Defines authentication details for a push notification endpoint.

type PushNotificationConfig

type PushNotificationConfig struct {
	Authentication *PushNotificationAuthenticationInfo `json:"authentication,omitempty"`
	ID             *string                             `json:"id,omitempty"`
	Token          *string                             `json:"token,omitempty"`
	URL            string                              `json:"url"`
}

Defines the configuration for setting up push notifications for task updates.

type PushNotificationNotSupportedError

type PushNotificationNotSupportedError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating that the agent does not support push notifications.

type SecurityScheme

type SecurityScheme interface{}

Defines a security scheme that can be used to secure an agent's endpoints. This is a discriminated union type based on the OpenAPI 3.0 Security Scheme Object.

type SecuritySchemeBase

type SecuritySchemeBase struct {
	Description *string `json:"description,omitempty"`
}

Defines base properties shared by all security scheme objects.

type SendMessageRequest

type SendMessageRequest struct {
	ID      interface{}       `json:"id"`
	JSONRPC string            `json:"jsonrpc"`
	Method  string            `json:"method"`
	Params  MessageSendParams `json:"params"`
}

Represents a JSON-RPC request for the `message/send` method.

type SendMessageResponse

type SendMessageResponse interface{}

Represents a JSON-RPC response for the `message/send` method.

type SendMessageSuccessResponse

type SendMessageSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

Represents a successful JSON-RPC response for the `message/send` method.

type SendStreamingMessageRequest

type SendStreamingMessageRequest struct {
	ID      interface{}       `json:"id"`
	JSONRPC string            `json:"jsonrpc"`
	Method  string            `json:"method"`
	Params  MessageSendParams `json:"params"`
}

Represents a JSON-RPC request for the `message/stream` method.

type SendStreamingMessageResponse

type SendStreamingMessageResponse interface{}

Represents a JSON-RPC response for the `message/stream` method.

type SendStreamingMessageSuccessResponse

type SendStreamingMessageSuccessResponse struct {
	ID      interface{} `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

Represents a successful JSON-RPC response for the `message/stream` method. The server may send multiple response objects for a single request.

type SetTaskPushNotificationConfigRequest

type SetTaskPushNotificationConfigRequest struct {
	ID      interface{}                `json:"id"`
	JSONRPC string                     `json:"jsonrpc"`
	Method  string                     `json:"method"`
	Params  TaskPushNotificationConfig `json:"params"`
}

Represents a JSON-RPC request for the `tasks/pushNotificationConfig/set` method.

type SetTaskPushNotificationConfigResponse

type SetTaskPushNotificationConfigResponse interface{}

Represents a JSON-RPC response for the `tasks/pushNotificationConfig/set` method.

type SetTaskPushNotificationConfigSuccessResponse

type SetTaskPushNotificationConfigSuccessResponse struct {
	ID      interface{}                `json:"id"`
	JSONRPC string                     `json:"jsonrpc"`
	Result  TaskPushNotificationConfig `json:"result"`
}

Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/set` method.

type Task

type Task struct {
	Artifacts []Artifact             `json:"artifacts,omitempty"`
	ContextID string                 `json:"contextId"`
	History   []Message              `json:"history,omitempty"`
	ID        string                 `json:"id"`
	Kind      string                 `json:"kind"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	Status    TaskStatus             `json:"status"`
}

Represents a single, stateful operation or conversation between a client and an agent.

type TaskArtifactUpdateEvent

type TaskArtifactUpdateEvent struct {
	Append    *bool                  `json:"append,omitempty"`
	Artifact  Artifact               `json:"artifact"`
	ContextID string                 `json:"contextId"`
	Kind      string                 `json:"kind"`
	LastChunk *bool                  `json:"lastChunk,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	TaskID    string                 `json:"taskId"`
}

An event sent by the agent to notify the client that an artifact has been generated or updated. This is typically used in streaming models.

type TaskIdParams

type TaskIdParams struct {
	ID       string                 `json:"id"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Defines parameters containing a task ID, used for simple task operations.

type TaskNotCancelableError

type TaskNotCancelableError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating that the task is in a state where it cannot be canceled.

type TaskNotFoundError

type TaskNotFoundError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating that the requested task ID was not found.

type TaskPushNotificationConfig

type TaskPushNotificationConfig struct {
	PushNotificationConfig PushNotificationConfig `json:"pushNotificationConfig"`
	TaskID                 string                 `json:"taskId"`
}

A container associating a push notification configuration with a specific task.

type TaskQueryParams

type TaskQueryParams struct {
	HistoryLength *int                   `json:"historyLength,omitempty"`
	ID            string                 `json:"id"`
	Metadata      map[string]interface{} `json:"metadata,omitempty"`
}

Defines parameters for querying a task, with an option to limit history length.

type TaskResubscriptionRequest

type TaskResubscriptionRequest struct {
	ID      interface{}  `json:"id"`
	JSONRPC string       `json:"jsonrpc"`
	Method  string       `json:"method"`
	Params  TaskIdParams `json:"params"`
}

Represents a JSON-RPC request for the `tasks/resubscribe` method, used to resume a streaming connection.

type TaskState

type TaskState string

Defines the lifecycle states of a Task.

const (
	TaskStateAuthRequired  TaskState = "auth-required"
	TaskStateCanceled      TaskState = "canceled"
	TaskStateCompleted     TaskState = "completed"
	TaskStateFailed        TaskState = "failed"
	TaskStateInputRequired TaskState = "input-required"
	TaskStateRejected      TaskState = "rejected"
	TaskStateSubmitted     TaskState = "submitted"
	TaskStateUnknown       TaskState = "unknown"
	TaskStateWorking       TaskState = "working"
)

TaskState enum values

type TaskStatus

type TaskStatus struct {
	Message   *Message  `json:"message,omitempty"`
	State     TaskState `json:"state"`
	Timestamp *string   `json:"timestamp,omitempty"`
}

Represents the status of a task at a specific point in time.

type TaskStatusUpdateEvent

type TaskStatusUpdateEvent struct {
	ContextID string                 `json:"contextId"`
	Final     bool                   `json:"final"`
	Kind      string                 `json:"kind"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	Status    TaskStatus             `json:"status"`
	TaskID    string                 `json:"taskId"`
}

An event sent by the agent to notify the client of a change in a task's status. This is typically used in streaming or subscription models.

type TextPart

type TextPart struct {
	Kind     string                 `json:"kind"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Text     string                 `json:"text"`
}

Represents a text segment within a message or artifact.

type TransportProtocol added in v0.15.1

type TransportProtocol string

Supported A2A transport protocols.

const (
	TransportProtocolGrpc     TransportProtocol = "GRPC"
	TransportProtocolHttpjson TransportProtocol = "HTTP+JSON"
	TransportProtocolJSONRPC  TransportProtocol = "JSONRPC"
)

TransportProtocol enum values

type UnsupportedOperationError

type UnsupportedOperationError struct {
	Code    int          `json:"code"`
	Data    *interface{} `json:"data,omitempty"`
	Message string       `json:"message"`
}

An A2A-specific error indicating that the requested operation is not supported by the agent.

Jump to

Keyboard shortcuts

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