a2a

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 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{}

type A2ARequest

type A2ARequest interface{}

A2A supported request types

type APIKeySecurityScheme

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

API Key security scheme.

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 {
	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"`
	Provider                          *AgentProvider            `json:"provider,omitempty"`
	Security                          []map[string][]string     `json:"security,omitempty"`
	SecuritySchemes                   map[string]SecurityScheme `json:"securitySchemes,omitempty"`
	Skills                            []AgentSkill              `json:"skills"`
	SupportsAuthenticatedExtendedCard *bool                     `json:"supportsAuthenticatedExtendedCard,omitempty"`
	URL                               string                    `json:"url"`
	Version                           string                    `json:"version"`
}

An AgentCard conveys key information: - Overall details (version, name, description, uses) - Skills: A set of capabilities the agent can perform - Default modalities/content types supported by the agent. - Authentication requirements

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 an extension supported by an Agent.

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 unit of capability 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 an artifact generated for 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"`
}

Configuration details for a supported OAuth Flow

type CancelTaskRequest

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

JSON-RPC request model for the 'tasks/cancel' method.

type CancelTaskResponse

type CancelTaskResponse interface{}

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"`
}

JSON-RPC success response model 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"`
}

Configuration details for a supported OAuth Flow

type ContentTypeNotSupportedError

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

A2A specific error indicating incompatible content types between request and agent 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 within a message part.

type FileBase

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

Represents the base entity for FileParts

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 parts.

type FileWithBytes

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

Define the variant where 'bytes' is present and 'uri' is absent

type FileWithUri

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

Define the variant where 'uri' is present and 'bytes' is absent

type GetTaskPushNotificationConfigRequest

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

JSON-RPC request model for the 'tasks/pushNotificationConfig/get' method.

type GetTaskPushNotificationConfigResponse

type GetTaskPushNotificationConfigResponse interface{}

JSON-RPC response for the 'tasks/pushNotificationConfig/set' method.

type GetTaskPushNotificationConfigSuccessResponse

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

JSON-RPC success response model 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"`
}

JSON-RPC request model for the 'tasks/get' method.

type GetTaskResponse

type GetTaskResponse interface{}

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"`
}

JSON-RPC success 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"`
}

HTTP Authentication security scheme.

type ImplicitOAuthFlow

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

Configuration details for a supported OAuth Flow

type InternalError

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

JSON-RPC error indicating an internal JSON-RPC error on the server.

type InvalidAgentResponseError

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

A2A specific error indicating agent returned invalid response for the current method

type InvalidParamsError

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

JSON-RPC error indicating invalid method parameter(s).

type InvalidRequestError

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

JSON-RPC error indicating 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"`
}

JSON-RPC error indicating invalid JSON was received by the server.

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. This is typically included in a JSONRPCErrorResponse when an error occurs.

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"`
}

Base interface for any JSON-RPC 2.0 request or response.

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{}

Represents a JSON-RPC 2.0 Response object.

type JSONRPCSuccessResponse

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

Represents a JSON-RPC 2.0 Success Response object.

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 exchanged between user and agent.

type MessageSendConfiguration

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

Configuration for the send message request.

type MessageSendParams

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

Sent by the client to the agent as a request. May create, continue or restart a task.

type MethodNotFoundError

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

JSON-RPC error indicating the 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"`
}

OAuth2.0 security scheme configuration.

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"`
}

Allows configuration of the supported OAuth Flows

type OpenIdConnectSecurityScheme

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

OpenID Connect security scheme configuration.

type Part

type Part interface{}

Represents a part of a message, which can be text, a file, or structured data.

type PartBase

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

Base properties common to all message parts.

type PasswordOAuthFlow

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

Configuration details for a supported OAuth Flow

type PushNotificationAuthenticationInfo

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

Defines authentication details for push notifications.

type PushNotificationConfig

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

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"`
}

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

type SecurityScheme

type SecurityScheme interface{}

Mirrors the OpenAPI Security Scheme Object (https://swagger.io/specification/#security-scheme-object)

type SecuritySchemeBase

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

Base properties shared by all security schemes.

type SendMessageRequest

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

JSON-RPC request model for the 'message/send' method.

type SendMessageResponse

type SendMessageResponse interface{}

JSON-RPC response model for the 'message/send' method.

type SendMessageSuccessResponse

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

JSON-RPC success response model 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"`
}

JSON-RPC request model for the 'message/stream' method.

type SendStreamingMessageResponse

type SendStreamingMessageResponse interface{}

JSON-RPC response model for the 'message/stream' method.

type SendStreamingMessageSuccessResponse

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

JSON-RPC success response model for the 'message/stream' method.

type SetTaskPushNotificationConfigRequest

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

JSON-RPC request model for the 'tasks/pushNotificationConfig/set' method.

type SetTaskPushNotificationConfigResponse

type SetTaskPushNotificationConfigResponse interface{}

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"`
}

JSON-RPC success response model 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"`
}

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"`
}

Sent by server during sendStream or subscribe requests

type TaskIdParams

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

Parameters containing only 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"`
}

A2A specific error indicating 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"`
}

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

type TaskPushNotificationConfig

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

Parameters for setting or getting push notification configuration for a task

type TaskQueryParams

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

Parameters for querying a task, including optional history length.

type TaskResubscriptionRequest

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

JSON-RPC request model for the 'tasks/resubscribe' method.

type TaskState

type TaskState string

Represents the possible 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"`
}

TaskState and accompanying message.

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"`
}

Sent by server during sendStream or subscribe requests

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 parts.

type UnsupportedOperationError

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

A2A specific error indicating 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