types

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 17 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package types provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

View Source
const (
	HealthStatusHealthy   = "healthy"
	HealthStatusDegraded  = "degraded"
	HealthStatusUnhealthy = "unhealthy"
)

Health status constants

View Source
const (
	EventDelta              = "adk.agent.delta"
	EventIterationCompleted = "adk.agent.iteration.completed"
	EventToolStarted        = "adk.agent.tool.started"
	EventToolCompleted      = "adk.agent.tool.completed"
	EventToolFailed         = "adk.agent.tool.failed"
	EventToolResult         = "adk.agent.tool.result"
	EventInputRequired      = "adk.agent.input.required"
	EventTaskInterrupted    = "adk.agent.task.interrupted"
	EventTaskStatusChanged  = "adk.agent.task.status.changed"
	EventStreamFailed       = "adk.agent.stream.failed"
)

CloudEvent type constants for agent streaming operations

View Source
const (
	ToolInputRequired = "input_required"
)

Tool name constants

Variables

This section is empty.

Functions

func MarshalParts added in v0.14.0

func MarshalParts(parts []Part) ([]byte, error)

MarshalParts is a utility function to marshal a slice of Parts

func NewAgentEvent added in v0.9.4

func NewAgentEvent(eventType, eventID string, data map[string]any) cloudevents.Event

NewAgentEvent creates a CloudEvent for agent lifecycle events

func NewDeltaEvent added in v0.9.4

func NewDeltaEvent(message *Message) cloudevents.Event

NewDeltaEvent creates a CloudEvent for streaming deltas, with the message in the data field

func NewIterationCompletedEvent added in v0.9.4

func NewIterationCompletedEvent(iteration int, taskID string, finalMessage *Message) cloudevents.Event

NewIterationCompletedEvent creates a CloudEvent for iteration completed with the final message

func NewMessageEvent added in v0.9.4

func NewMessageEvent(eventType, eventID string, message *Message) cloudevents.Event

NewMessageEvent creates a CloudEvent with a message payload and custom event type

Types

type APIKeySecurityScheme

type APIKeySecurityScheme struct {
	// Description An optional description for the security scheme.
	Description *string `json:"description,omitempty"`

	// Location The location of the API key. Valid values are "query", "header", or "cookie".
	Location string `json:"location"`

	// Name The name of the header, query, or cookie parameter to be used.
	Name string `json:"name"`
}

APIKeySecurityScheme Defines a security scheme using an API key.

type AgentCapabilities

type AgentCapabilities struct {
	// Extensions A list of protocol extensions supported by the agent.
	Extensions []AgentExtension `json:"extensions,omitempty"`

	// PushNotifications Indicates if the agent supports sending push notifications for asynchronous task updates.
	PushNotifications *bool `json:"pushNotifications,omitempty"`

	// StateTransitionHistory Indicates if the agent provides a history of state transitions for a task.
	StateTransitionHistory *bool `json:"stateTransitionHistory,omitempty"`

	// Streaming Indicates if the agent supports streaming responses.
	Streaming *bool `json:"streaming,omitempty"`
}

AgentCapabilities Defines optional capabilities supported by an agent.

type AgentCard

type AgentCard struct {
	// AdditionalInterfaces DEPRECATED: Use 'supported_interfaces' instead.
	AdditionalInterfaces []AgentInterface `json:"additionalInterfaces,omitempty"`

	// Capabilities A2A Capability set supported by the agent.
	Capabilities AgentCapabilities `json:"capabilities"`

	// DefaultInputModes protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
	//  The set of interaction modes that the agent supports across all skills.
	//  This can be overridden per skill. Defined as media types.
	DefaultInputModes []string `json:"defaultInputModes"`

	// DefaultOutputModes The media types supported as outputs from this agent.
	DefaultOutputModes []string `json:"defaultOutputModes"`

	// Description A human-readable description of the agent, assisting users and other agents
	//  in understanding its purpose.
	//  Example: "Agent that helps users with recipes and cooking."
	Description string `json:"description"`

	// DocumentationURL A url to provide additional documentation about the agent.
	DocumentationURL *string `json:"documentationUrl,omitempty"`

	// IconURL An optional URL to an icon for the agent.
	IconURL *string `json:"iconUrl,omitempty"`

	// Name A human readable name for the agent.
	//  Example: "Recipe Agent"
	Name string `json:"name"`

	// PreferredTransport DEPRECATED: Use 'supported_interfaces' instead.
	PreferredTransport *string `json:"preferredTransport,omitempty"`

	// ProtocolVersion The version of the A2A protocol this agent supports.
	//  Default: "1.0"
	ProtocolVersion string `json:"protocolVersion"`

	// Provider The service provider of the agent.
	Provider *AgentProvider `json:"provider,omitempty"`

	// Security protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
	//  Security requirements for contacting the agent.
	Security []Security `json:"security,omitempty"`

	// SecuritySchemes The security scheme details used for authenticating with this agent.
	SecuritySchemes map[string]SecurityScheme `json:"securitySchemes,omitempty"`

	// Signatures JSON Web Signatures computed for this AgentCard.
	Signatures []AgentCardSignature `json:"signatures,omitempty"`

	// Skills Skills represent an ability of an agent. It is largely
	//  a descriptive concept but represents a more focused set of behaviors that the
	//  agent is likely to succeed at.
	Skills []AgentSkill `json:"skills"`

	// SupportedInterfaces Ordered list of supported interfaces. First entry is preferred.
	SupportedInterfaces []AgentInterface `json:"supportedInterfaces,omitempty"`

	// SupportsExtendedAgentCard Whether the agent supports providing an extended agent card when authenticated.
	SupportsExtendedAgentCard *bool `json:"supportsExtendedAgentCard,omitempty"`

	// URL DEPRECATED: Use 'supported_interfaces' instead.
	URL *string `json:"url,omitempty"`

	// Version The version of the agent.
	//  Example: "1.0.0"
	Version string `json:"version"`
}

AgentCard 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.
Next ID: 20

type AgentCardSignature added in v0.8.0

type AgentCardSignature struct {
	// Header The unprotected JWS header values.
	Header *Struct `json:"header,omitempty"`

	// Protected The protected JWS header for the signature. This is always a
	//  base64url-encoded JSON object. Required.
	Protected string `json:"protected"`

	// Signature The computed signature, base64url-encoded. Required.
	Signature string `json:"signature"`
}

AgentCardSignature 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 A human-readable description of how this agent uses the extension.
	Description string `json:"description"`

	// Params Optional, extension-specific configuration parameters.
	Params *Struct `json:"params,omitempty"`

	// Required If true, the client must understand and comply with the extension's requirements.
	Required bool `json:"required"`

	// URI The unique URI identifying the extension.
	URI string `json:"uri"`
}

AgentExtension A declaration of a protocol extension supported by an Agent.

type AgentInterface

type AgentInterface struct {
	// ProtocolBinding The protocol binding supported at this URL. This is an open form string, to be
	//  easily extended for other protocol bindings. The core ones officially
	//  supported are `JSONRPC`, `GRPC` and `HTTP+JSON`.
	ProtocolBinding string `json:"protocolBinding"`

	// Tenant Tenant to be set in the request when calling the agent.
	Tenant *string `json:"tenant,omitempty"`

	// URL The URL where this interface is available. Must be a valid absolute HTTPS URL in production.
	//  Example: "https://api.example.com/a2a/v1", "https://grpc.example.com/a2a"
	URL string `json:"url"`
}

AgentInterface 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 protocol binding mechanisms.

type AgentProvider

type AgentProvider struct {
	// Organization The name of the agent provider's organization.
	//  Example: "Google"
	Organization string `json:"organization"`

	// URL A URL for the agent provider's website or relevant documentation.
	//  Example: "https://ai.google.dev"
	URL string `json:"url"`
}

AgentProvider Represents the service provider of an agent.

type AgentSkill

type AgentSkill struct {
	// Description A detailed description of the skill.
	Description string `json:"description"`

	// Examples Example prompts or scenarios that this skill can handle.
	Examples []string `json:"examples,omitempty"`

	// ID A unique identifier for the agent's skill.
	ID string `json:"id"`

	// InputModes The set of supported input media types for this skill, overriding the agent's defaults.
	InputModes []string `json:"inputModes,omitempty"`

	// Name A human-readable name for the skill.
	Name string `json:"name"`

	// OutputModes The set of supported output media types for this skill, overriding the agent's defaults.
	OutputModes []string `json:"outputModes,omitempty"`

	// Security protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
	//  Security schemes necessary for this skill.
	Security []Security `json:"security,omitempty"`

	// Tags A set of keywords describing the skill's capabilities.
	Tags []string `json:"tags"`
}

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

type Artifact

type Artifact struct {
	// ArtifactID Unique identifier (e.g. UUID) for the artifact. It must be at least unique
	//  within a task.
	ArtifactID string `json:"artifactId"`

	// Description A human readable description of the artifact, optional.
	Description *string `json:"description,omitempty"`

	// Extensions The URIs of extensions that are present or contributed to this Artifact.
	Extensions []string `json:"extensions,omitempty"`

	// Metadata Optional metadata included with the artifact.
	Metadata *Struct `json:"metadata,omitempty"`

	// Name A human readable name for the artifact.
	Name *string `json:"name,omitempty"`

	// Parts The content of the artifact. Must contain at least one part.
	Parts []Part `json:"parts"`
}

Artifact Artifacts represent task outputs.

type AuthenticationInfo added in v0.17.0

type AuthenticationInfo struct {
	// Credentials Optional credentials
	Credentials *string `json:"credentials,omitempty"`

	// Schemes A list of supported authentication schemes (e.g., 'Basic', 'Bearer').
	Schemes []string `json:"schemes"`
}

AuthenticationInfo Defines authentication details, used for push notifications.

type AuthorizationCodeOAuthFlow

type AuthorizationCodeOAuthFlow struct {
	// AuthorizationURL The authorization URL to be used for this flow.
	AuthorizationURL string `json:"authorizationUrl"`

	// RefreshURL The URL to be used for obtaining refresh tokens.
	RefreshURL *string `json:"refreshUrl,omitempty"`

	// Scopes The available scopes for the OAuth2 security scheme.
	Scopes map[string]string `json:"scopes"`

	// TokenURL The token URL to be used for this flow.
	TokenURL string `json:"tokenUrl"`
}

AuthorizationCodeOAuthFlow Defines configuration details for the OAuth 2.0 Authorization Code flow.

type CancelTaskRequest

type CancelTaskRequest struct {
	// Name The resource name of the task to cancel.
	//  Format: tasks/{task_id}
	Name string `json:"name"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

CancelTaskRequest Represents a request for the `tasks/cancel` method.

type ClientCredentialsOAuthFlow

type ClientCredentialsOAuthFlow struct {
	// RefreshURL The URL to be used for obtaining refresh tokens.
	RefreshURL *string `json:"refreshUrl,omitempty"`

	// Scopes The available scopes for the OAuth2 security scheme.
	Scopes map[string]string `json:"scopes"`

	// TokenURL The token URL to be used for this flow.
	TokenURL string `json:"tokenUrl"`
}

ClientCredentialsOAuthFlow Defines configuration details for the OAuth 2.0 Client Credentials flow.

type DataPart

type DataPart struct {
	// Data A JSON object containing arbitrary data.
	Data Struct `json:"data"`
}

DataPart DataPart represents a structured blob.

type DeleteTaskPushNotificationConfigParams

type DeleteTaskPushNotificationConfigParams = DeleteTaskPushNotificationConfigRequest

DeleteTaskPushNotificationConfigParams is an alias for DeleteTaskPushNotificationConfigRequest

type DeleteTaskPushNotificationConfigRequest

type DeleteTaskPushNotificationConfigRequest struct {
	// Name The resource name of the config to delete.
	//  Format: tasks/{task_id}/pushNotificationConfigs/{config_id}
	Name string `json:"name"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

DeleteTaskPushNotificationConfigRequest Represents a request for the `tasks/pushNotificationConfig/delete` method.

type FilePart

type FilePart struct {
	// FileWithBytes The base64-encoded content of the file.
	FileWithBytes *string `json:"fileWithBytes,omitempty"`

	// FileWithURI A URL pointing to the file's content.
	FileWithURI *string `json:"fileWithUri,omitempty"`

	// MediaType The media type of the file (e.g., "application/pdf").
	MediaType string `json:"mediaType"`

	// Name An optional name for the file (e.g., "document.pdf").
	Name string `json:"name"`
}

FilePart FilePart represents the different ways files can be provided. If files are

small, directly feeding the bytes is supported via file_with_bytes. If the
file is large, the agent should read the content as appropriate directly
from the file_with_uri source.

type GetAuthenticatedExtendedCardParams added in v0.18.0

type GetAuthenticatedExtendedCardParams = GetExtendedAgentCardRequest

GetAuthenticatedExtendedCardParams is an alias for GetExtendedAgentCardRequest

type GetExtendedAgentCardRequest added in v0.17.0

type GetExtendedAgentCardRequest struct {
	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

GetExtendedAgentCardRequest defines model for GetExtendedAgentCardRequest.

type GetTaskPushNotificationConfigParams

type GetTaskPushNotificationConfigParams = GetTaskPushNotificationConfigRequest

GetTaskPushNotificationConfigParams is an alias for GetTaskPushNotificationConfigRequest

type GetTaskPushNotificationConfigRequest

type GetTaskPushNotificationConfigRequest struct {
	// Name The resource name of the config to retrieve.
	//  Format: tasks/{task_id}/pushNotificationConfigs/{config_id}
	Name string `json:"name"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

GetTaskPushNotificationConfigRequest defines model for GetTaskPushNotificationConfigRequest.

type GetTaskRequest

type GetTaskRequest struct {
	// HistoryLength The maximum number of messages to include in the history.
	HistoryLength *int `json:"historyLength,omitempty"`

	// Name The resource name of the task.
	//  Format: tasks/{task_id}
	Name string `json:"name"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant *string `json:"tenant,omitempty"`
}

GetTaskRequest Represents a request for the `tasks/get` method.

type HTTPAuthSecurityScheme

type HTTPAuthSecurityScheme struct {
	// BearerFormat A hint to the client to identify how the bearer token is formatted (e.g., "JWT").
	//  This is primarily for documentation purposes.
	BearerFormat *string `json:"bearerFormat,omitempty"`

	// Description An optional description for the security scheme.
	Description *string `json:"description,omitempty"`

	// Scheme The name of the HTTP Authentication scheme to be used in the Authorization header,
	//  as defined in RFC7235 (e.g., "Bearer").
	//  This value should be registered in the IANA Authentication Scheme registry.
	Scheme string `json:"scheme"`
}

HTTPAuthSecurityScheme Defines a security scheme using HTTP authentication.

type ImplicitOAuthFlow

type ImplicitOAuthFlow struct {
	// AuthorizationURL The authorization URL to be used for this flow.
	AuthorizationURL string `json:"authorizationUrl"`

	// RefreshURL The URL to be used for obtaining refresh tokens.
	RefreshURL *string `json:"refreshUrl,omitempty"`

	// Scopes The available scopes for the OAuth2 security scheme.
	Scopes map[string]string `json:"scopes"`
}

ImplicitOAuthFlow Defines configuration details for the OAuth 2.0 Implicit flow.

type JSONParseError

type JSONParseError struct {
	Code    int    `json:"code"`
	Data    *any   `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    *any   `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   any    `json:"error"`
	ID      any    `json:"id"`
	JSONRPC string `json:"jsonrpc"`
}

Represents a JSON-RPC 2.0 Error Response object.

type JSONRPCMessage

type JSONRPCMessage struct {
	ID      *any   `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      *any           `json:"id,omitempty"`
	JSONRPC string         `json:"jsonrpc"`
	Method  string         `json:"method"`
	Params  map[string]any `json:"params,omitempty"`
}

Represents a JSON-RPC 2.0 Request object.

type JSONRPCResponse

type JSONRPCResponse any

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

type JSONRPCSuccessResponse

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

Represents a successful JSON-RPC 2.0 Response object.

type ListTaskPushNotificationConfigParams

type ListTaskPushNotificationConfigParams = ListTaskPushNotificationConfigRequest

ListTaskPushNotificationConfigParams is an alias for ListTaskPushNotificationConfigRequest

type ListTaskPushNotificationConfigRequest

type ListTaskPushNotificationConfigRequest struct {
	// PageSize The maximum number of configurations to return.
	PageSize int `json:"pageSize"`

	// PageToken A page token received from a previous ListTaskPushNotificationConfigRequest call.
	PageToken string `json:"pageToken"`

	// Parent The parent task resource.
	//  Format: tasks/{task_id}
	Parent string `json:"parent"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

ListTaskPushNotificationConfigRequest defines model for ListTaskPushNotificationConfigRequest.

type ListTaskPushNotificationConfigResponse

type ListTaskPushNotificationConfigResponse struct {
	// Configs The list of push notification configurations.
	Configs []TaskPushNotificationConfig `json:"configs,omitempty"`

	// NextPageToken A token, which can be sent as `page_token` to retrieve the next page.
	//  If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken"`
}

ListTaskPushNotificationConfigResponse Represents a successful response for the `tasks/pushNotificationConfig/list`

method.

type ListTasksRequest

type ListTasksRequest struct {
	// ContextID Filter tasks by context ID to get tasks from a specific conversation or session.
	ContextID string `json:"contextId"`

	// HistoryLength The maximum number of messages to include in each task's history.
	HistoryLength *int `json:"historyLength,omitempty"`

	// IncludeArtifacts Whether to include artifacts in the returned tasks.
	//  Defaults to false to reduce payload size.
	IncludeArtifacts *bool `json:"includeArtifacts,omitempty"`

	// LastUpdatedAfter Filter tasks updated after this timestamp (milliseconds since epoch).
	//  Only tasks with a last updated time greater than or equal to this value will be returned.
	LastUpdatedAfter int `json:"lastUpdatedAfter"`

	// PageSize Maximum number of tasks to return. Must be between 1 and 100.
	//  Defaults to 50 if not specified.
	PageSize *int `json:"pageSize,omitempty"`

	// PageToken Token for pagination. Use the next_page_token from a previous ListTasksResponse.
	PageToken string `json:"pageToken"`

	// Status Filter tasks by their current status state.
	Status TaskState `json:"status"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

ListTasksRequest Parameters for listing tasks with optional filtering criteria.

type ListTasksResponse

type ListTasksResponse struct {
	// NextPageToken Token for retrieving the next page. Empty string if no more results.
	NextPageToken string `json:"nextPageToken"`

	// PageSize The size of page requested.
	PageSize int `json:"pageSize"`

	// Tasks Array of tasks matching the specified criteria.
	Tasks []Task `json:"tasks"`

	// TotalSize Total number of tasks available (before pagination).
	TotalSize int `json:"totalSize"`
}

ListTasksResponse Result object for tasks/list method containing an array of tasks and pagination information.

type Message

type Message struct {
	// ContextID The context id of the message. This is optional and if set, the message
	//  will be associated with the given context.
	ContextID *string `json:"contextId,omitempty"`

	// Extensions The URIs of extensions that are present or contributed to this Message.
	Extensions []string `json:"extensions,omitempty"`

	// MessageID The unique identifier (e.g. UUID) of the message. This is required and
	//  created by the message creator.
	MessageID string `json:"messageId"`

	// Metadata protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
	//  Any optional metadata to provide along with the message.
	Metadata *Struct `json:"metadata,omitempty"`

	// Parts protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
	//  Parts is the container of the message content.
	Parts []Part `json:"parts"`

	// ReferenceTaskIds A list of task IDs that this message references for additional context.
	ReferenceTaskIds []string `json:"referenceTaskIds,omitempty"`

	// Role Identifies the sender of the message.
	Role Role `json:"role"`

	// TaskID The task id of the message. This is optional and if set, the message
	//  will be associated with the given task.
	TaskID *string `json:"taskId,omitempty"`
}

Message Message is one unit of communication between client and server. It is

associated with a context and optionally a task. Since the server is
responsible for the context definition, it must always provide a context_id
in its messages. The client can optionally provide the context_id if it
knows the context to associate the message to. Similarly for task_id,
except the server decides if a task is created and whether to include the
task_id.

func NewAssistantMessage added in v0.9.4

func NewAssistantMessage(messageID string, parts []Part) *Message

NewAssistantMessage creates a standardized assistant message

func NewInputRequiredMessage added in v0.9.4

func NewInputRequiredMessage(toolCallID, message string) *Message

NewInputRequiredMessage creates an input required message

func NewStreamingStatusMessage added in v0.9.4

func NewStreamingStatusMessage(messageID, status string, metadata map[string]any) *Message

NewStreamingStatusMessage creates a status message for streaming

func NewToolResultMessage added in v0.9.4

func NewToolResultMessage(toolCallID string, toolName string, result any, hasError bool) *Message

NewToolResultMessage creates a standardized tool result message

func (*Message) UnmarshalJSON added in v0.14.0

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaler for Message that properly handles typed Parts

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]any            `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 MutualTLSSecurityScheme added in v0.8.0

type MutualTLSSecurityScheme struct {
	// Description An optional description for the security scheme.
	Description string `json:"description"`
}

MutualTLSSecurityScheme Defines a security scheme using mTLS authentication.

type OAuth2SecurityScheme

type OAuth2SecurityScheme struct {
	// Description An optional description for the security scheme.
	Description *string `json:"description,omitempty"`

	// Flows An object containing configuration information for the supported OAuth 2.0 flows.
	Flows OAuthFlows `json:"flows"`

	// Oauth2MetadataURL URL to the oauth2 authorization server metadata
	//  RFC8414 (https://datatracker.ietf.org/doc/html/rfc8414). TLS is required.
	Oauth2MetadataURL *string `json:"oauth2MetadataUrl,omitempty"`
}

OAuth2SecurityScheme Defines a security scheme using OAuth 2.0.

type OAuthFlows

type OAuthFlows struct {
	// AuthorizationCode Configuration for the OAuth Authorization Code flow.
	AuthorizationCode *AuthorizationCodeOAuthFlow `json:"authorizationCode,omitempty"`

	// ClientCredentials Configuration for the OAuth Client Credentials flow.
	ClientCredentials *ClientCredentialsOAuthFlow `json:"clientCredentials,omitempty"`

	// Implicit Configuration for the OAuth Implicit flow.
	Implicit *ImplicitOAuthFlow `json:"implicit,omitempty"`

	// Password Configuration for the OAuth Resource Owner Password flow.
	Password *PasswordOAuthFlow `json:"password,omitempty"`
}

OAuthFlows Defines the configuration for the supported OAuth 2.0 flows.

type OpenIDConnectSecurityScheme added in v0.25.0

type OpenIDConnectSecurityScheme struct {
	// Description An optional description for the security scheme.
	Description *string `json:"description,omitempty"`

	// OpenIDConnectURL The OpenID Connect Discovery URL for the OIDC provider's metadata.
	//  See: https://openid.net/specs/openid-connect-discovery-1_0.html
	OpenIDConnectURL string `json:"openIdConnectUrl"`
}

OpenIDConnectSecurityScheme Defines a security scheme using OpenID Connect.

type Part

type Part struct {
	// Data The structured data content.
	Data *DataPart `json:"data,omitempty"`

	// File The file content, represented as either a URI or as base64-encoded bytes.
	File *FilePart `json:"file,omitempty"`

	// Metadata Optional metadata associated with this part.
	Metadata *Struct `json:"metadata,omitempty"`

	// Text The string content of the text part.
	Text *string `json:"text,omitempty"`
}

Part Part represents a container for a section of communication content.

Parts can be purely textual, some sort of file (image, video, etc) or
a structured data blob (i.e. JSON).

func CreateDataPart added in v0.14.0

func CreateDataPart(data map[string]any, metadata ...map[string]any) Part

CreateDataPart creates a Part with data content

func CreateFilePart added in v0.14.0

func CreateFilePart(name, mediaType string, fileWithBytes *string, fileWithURI *string, metadata ...map[string]any) Part

CreateFilePart creates a Part with file content

func CreateTextPart added in v0.14.0

func CreateTextPart(text string, metadata ...map[string]any) Part

CreateTextPart creates a Part with text content

func NewDataPart added in v0.9.4

func NewDataPart(data map[string]any) Part

NewDataPart creates a generic data part for a message

func NewTextPart added in v0.9.4

func NewTextPart(text string) Part

NewTextPart creates a text part for a message

func NewToolCallPart added in v0.9.4

func NewToolCallPart(toolCallID, toolName string, arguments map[string]any) Part

NewToolCallPart creates a tool call part for a message

func UnmarshalPart added in v0.14.0

func UnmarshalPart(data []byte) (Part, error)

UnmarshalPart unmarshals a single Part from JSON with proper type handling

func UnmarshalParts added in v0.14.0

func UnmarshalParts(data []byte) ([]Part, error)

UnmarshalParts is a utility function to unmarshal a slice of Parts with proper type handling

type PasswordOAuthFlow

type PasswordOAuthFlow struct {
	// RefreshURL The URL to be used for obtaining refresh tokens.
	RefreshURL *string `json:"refreshUrl,omitempty"`

	// Scopes The available scopes for the OAuth2 security scheme.
	Scopes map[string]string `json:"scopes"`

	// TokenURL The token URL to be used for this flow.
	TokenURL string `json:"tokenUrl"`
}

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

type PushNotificationConfig

type PushNotificationConfig struct {
	// Authentication Information about the authentication to sent with the notification
	Authentication *AuthenticationInfo `json:"authentication,omitempty"`

	// ID A unique identifier (e.g. UUID) for this push notification.
	ID *string `json:"id,omitempty"`

	// Token Token unique for this task/session
	Token *string `json:"token,omitempty"`

	// URL Url to send the notification too
	URL string `json:"url"`
}

PushNotificationConfig Configuration for setting up push notifications for task updates.

type Role added in v0.17.0

type Role string

Role Identifies the sender of the message.

const (
	RoleAgent       Role = "ROLE_AGENT"
	RoleUnspecified Role = "ROLE_UNSPECIFIED"
	RoleUser        Role = "ROLE_USER"
)

Defines values for Role.

func (Role) Valid added in v0.25.0

func (e Role) Valid() bool

Valid indicates whether the value is a known member of the Role enum.

type Security added in v0.17.0

type Security struct {
	Schemes map[string]StringList `json:"schemes,omitempty"`
}

Security defines model for Security.

type SecurityScheme

type SecurityScheme struct {
	// APIKeySecurityScheme API key-based authentication.
	APIKeySecurityScheme *APIKeySecurityScheme `json:"apiKeySecurityScheme,omitempty"`

	// HTTPAuthSecurityScheme HTTP authentication (Basic, Bearer, etc.).
	HTTPAuthSecurityScheme *HTTPAuthSecurityScheme `json:"httpAuthSecurityScheme,omitempty"`

	// MtlsSecurityScheme Mutual TLS authentication.
	MtlsSecurityScheme *MutualTLSSecurityScheme `json:"mtlsSecurityScheme,omitempty"`

	// Oauth2SecurityScheme OAuth 2.0 authentication.
	Oauth2SecurityScheme *OAuth2SecurityScheme `json:"oauth2SecurityScheme,omitempty"`

	// OpenIDConnectSecurityScheme OpenID Connect authentication.
	OpenIDConnectSecurityScheme *OpenIDConnectSecurityScheme `json:"openIdConnectSecurityScheme,omitempty"`
}

SecurityScheme 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.2 Security Scheme Object.
See: https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object

type SendMessageConfiguration added in v0.17.0

type SendMessageConfiguration struct {
	// AcceptedOutputModes A list of media types the client is prepared to accept for response parts. Agents SHOULD use this to tailor their output.
	AcceptedOutputModes []string `json:"acceptedOutputModes,omitempty"`

	// Blocking If true, the operation waits until the task reaches a terminal state before returning. Default is false.
	Blocking bool `json:"blocking"`

	// HistoryLength The maximum number of messages to include in the history.
	HistoryLength *int `json:"historyLength,omitempty"`

	// PushNotificationConfig Configuration for the agent to send push notifications for task updates.
	PushNotificationConfig *PushNotificationConfig `json:"pushNotificationConfig,omitempty"`
}

SendMessageConfiguration Configuration of a send message request.

type SendMessageRequest

type SendMessageRequest struct {
	// Configuration Configuration for the send request.
	Configuration *SendMessageConfiguration `json:"configuration,omitempty"`

	// Message The message to send to the agent.
	Message *Message `json:"message,omitempty"`

	// Metadata A flexible key-value map for passing additional context or parameters.
	Metadata *Struct `json:"metadata,omitempty"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

SendMessageRequest /////////// Request Messages ///////////

Represents a request for the `message/send` method.

type SendMessageResponse

type SendMessageResponse struct {
	// Message Message is one unit of communication between client and server. It is
	//  associated with a context and optionally a task. Since the server is
	//  responsible for the context definition, it must always provide a context_id
	//  in its messages. The client can optionally provide the context_id if it
	//  knows the context to associate the message to. Similarly for task_id,
	//  except the server decides if a task is created and whether to include the
	//  task_id.
	Message *Message `json:"message,omitempty"`

	// Task Task is the core unit of action for A2A. It has a current status
	//  and when results are created for the task they are stored in the
	//  artifact. If there are multiple turns for a task, these are stored in
	//  history.
	Task *Task `json:"task,omitempty"`
}

SendMessageResponse ////// Response Messages ///////////

type SetTaskPushNotificationConfigRequest

type SetTaskPushNotificationConfigRequest struct {
	// Config The configuration to create.
	Config TaskPushNotificationConfig `json:"config"`

	// ConfigID The ID for the new config.
	ConfigID string `json:"configId"`

	// Parent The parent task resource for this config.
	//  Format: tasks/{task_id}
	Parent string `json:"parent"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant *string `json:"tenant,omitempty"`
}

SetTaskPushNotificationConfigRequest Represents a request for the `tasks/pushNotificationConfig/set` method.

type StreamResponse added in v0.17.0

type StreamResponse struct {
	// ArtifactUpdate An event indicating a task artifact update.
	ArtifactUpdate *TaskArtifactUpdateEvent `json:"artifactUpdate,omitempty"`

	// Message A Message object containing a message from the agent.
	Message *Message `json:"message,omitempty"`

	// StatusUpdate An event indicating a task status update.
	StatusUpdate *TaskStatusUpdateEvent `json:"statusUpdate,omitempty"`

	// Task A Task object containing the current state of the task.
	Task *Task `json:"task,omitempty"`
}

StreamResponse A wrapper object used in streaming operations to encapsulate different types of response data.

type StringList added in v0.17.0

type StringList struct {
	List []string `json:"list,omitempty"`
}

StringList protolint:disable REPEATED_FIELD_NAMES_PLURALIZED

type Struct added in v0.17.0

type Struct = map[string]any

Struct defines model for Struct.

type SubscribeToTaskRequest added in v0.17.0

type SubscribeToTaskRequest struct {
	// Name The resource name of the task to subscribe to.
	//  Format: tasks/{task_id}
	Name string `json:"name"`

	// Tenant Optional tenant, provided as a path parameter.
	Tenant string `json:"tenant"`
}

SubscribeToTaskRequest defines model for SubscribeToTaskRequest.

type Task

type Task struct {
	// Artifacts A set of output artifacts for a Task.
	Artifacts []Artifact `json:"artifacts,omitempty"`

	// ContextID Unique identifier (e.g. UUID) for the contextual collection of interactions
	//  (tasks and messages). Created by the A2A server.
	ContextID string `json:"contextId"`

	// History protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
	//  The history of interactions from a task.
	History []Message `json:"history,omitempty"`

	// ID Unique identifier (e.g. UUID) for the task, generated by the server for a
	//  new task.
	ID string `json:"id"`

	// Metadata protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
	//  A key/value object to store custom metadata about a task.
	Metadata *Struct `json:"metadata,omitempty"`

	// Status The current status of a Task, including state and a message.
	Status TaskStatus `json:"status"`
}

Task Task is the core unit of action for A2A. It has a current status

and when results are created for the task they are stored in the
artifact. If there are multiple turns for a task, these are stored in
history.

type TaskArtifactUpdateEvent

type TaskArtifactUpdateEvent struct {
	// Append If true, the content of this artifact should be appended to a previously
	//  sent artifact with the same ID.
	Append *bool `json:"append,omitempty"`

	// Artifact The artifact that was generated or updated.
	Artifact Artifact `json:"artifact"`

	// ContextID The id of the context that this task belongs to.
	ContextID string `json:"contextId"`

	// LastChunk If true, this is the final chunk of the artifact.
	LastChunk *bool `json:"lastChunk,omitempty"`

	// Metadata Optional metadata associated with the artifact update.
	Metadata *Struct `json:"metadata,omitempty"`

	// TaskID The id of the task for this artifact.
	TaskID string `json:"taskId"`
}

TaskArtifactUpdateEvent TaskArtifactUpdateEvent represents a task delta where an artifact has

been generated.

type TaskIdParams

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

Parameters for task operations that require only a task ID.

type TaskList

type TaskList = ListTasksResponse

TaskList represents a list of tasks with pagination info (alias for generated type)

type TaskListParams

type TaskListParams struct {
	ContextID *string        `json:"contextId,omitempty"`
	Limit     int            `json:"limit,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	Offset    int            `json:"offset,omitempty"`
	State     *TaskState     `json:"state,omitempty"`
}

Parameters for listing tasks with optional filtering and pagination.

type TaskPushNotificationConfig

type TaskPushNotificationConfig struct {
	// Name The resource name of the config.
	//  Format: tasks/{task_id}/pushNotificationConfigs/{config_id}
	Name string `json:"name"`

	// PushNotificationConfig The push notification configuration details.
	PushNotificationConfig PushNotificationConfig `json:"pushNotificationConfig"`
}

TaskPushNotificationConfig 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]any `json:"metadata,omitempty"`
}

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

type TaskResubscriptionParams added in v0.18.0

type TaskResubscriptionParams = SubscribeToTaskRequest

TaskResubscriptionParams is an alias for SubscribeToTaskRequest

type TaskState

type TaskState string

TaskState Filter tasks by their current status state.

const (
	TaskStateAuthRequired  TaskState = "TASK_STATE_AUTH_REQUIRED"
	TaskStateCancelled     TaskState = "TASK_STATE_CANCELLED"
	TaskStateCompleted     TaskState = "TASK_STATE_COMPLETED"
	TaskStateFailed        TaskState = "TASK_STATE_FAILED"
	TaskStateInputRequired TaskState = "TASK_STATE_INPUT_REQUIRED"
	TaskStateRejected      TaskState = "TASK_STATE_REJECTED"
	TaskStateSubmitted     TaskState = "TASK_STATE_SUBMITTED"
	TaskStateUnspecified   TaskState = "TASK_STATE_UNSPECIFIED"
	TaskStateWorking       TaskState = "TASK_STATE_WORKING"
)

Defines values for TaskState.

func (TaskState) Valid added in v0.25.0

func (e TaskState) Valid() bool

Valid indicates whether the value is a known member of the TaskState enum.

type TaskStatus

type TaskStatus struct {
	// Message A message associated with the status.
	Message *Message `json:"message,omitempty"`

	// State Filter tasks by their current status state.
	State TaskState `json:"state"`

	// Timestamp ISO 8601 Timestamp when the status was recorded.
	//  Example: "2023-10-27T10:00:00Z"
	Timestamp *Timestamp `json:"timestamp,omitempty"`
}

TaskStatus A container for the status of a task

type TaskStatusUpdateEvent

type TaskStatusUpdateEvent struct {
	// ContextID The id of the context that the task belongs to
	ContextID string `json:"contextId"`

	// Final If true, this is the final event in the stream for this interaction.
	Final bool `json:"final"`

	// Metadata Optional metadata to associate with the task update.
	Metadata *Struct `json:"metadata,omitempty"`

	// Status The new status of the task.
	Status TaskStatus `json:"status"`

	// TaskID The id of the task that is changed
	TaskID string `json:"taskId"`
}

TaskStatusUpdateEvent An event sent by the agent to notify the client of a change in a task's

status.

type Timestamp added in v0.17.0

type Timestamp = time.Time

Timestamp defines model for Timestamp.

Jump to

Keyboard shortcuts

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