pub struct AgentCard {Show 18 fields
pub name: String,
pub description: String,
pub version: String,
pub protocol_version: String,
pub url: String,
pub preferred_transport: TransportProtocol,
pub capabilities: AgentCapabilities,
pub default_input_modes: Vec<String>,
pub default_output_modes: Vec<String>,
pub skills: Vec<AgentSkill>,
pub provider: Option<AgentProvider>,
pub additional_interfaces: Vec<AgentInterface>,
pub documentation_url: Option<String>,
pub icon_url: Option<String>,
pub security: Vec<HashMap<String, Vec<String>>>,
pub security_schemes: Option<HashMap<String, SecurityScheme>>,
pub signatures: Vec<AgentCardSignature>,
pub supports_authenticated_extended_card: Option<bool>,
}Expand description
The AgentCard is a self-describing manifest for an agent.
Fields§
§name: StringA human-readable name for the agent.
description: StringA human-readable description of the agent.
version: StringThe agent’s own version number.
protocol_version: StringThe version of the A2A protocol this agent supports.
url: StringThe preferred endpoint URL for interacting with the agent.
preferred_transport: TransportProtocolThe transport protocol for the preferred endpoint.
capabilities: AgentCapabilitiesA declaration of optional capabilities supported by the agent.
default_input_modes: Vec<String>Default set of supported input MIME types for all skills.
default_output_modes: Vec<String>Default set of supported output MIME types for all skills.
skills: Vec<AgentSkill>The set of skills that the agent can perform.
provider: Option<AgentProvider>Information about the agent’s service provider.
additional_interfaces: Vec<AgentInterface>A list of additional supported interfaces (transport and URL combinations).
documentation_url: Option<String>An optional URL to the agent’s documentation.
icon_url: Option<String>An optional URL to an icon for the agent.
security: Vec<HashMap<String, Vec<String>>>A list of security requirement objects that apply to all agent interactions.
security_schemes: Option<HashMap<String, SecurityScheme>>A declaration of the security schemes available to authorize requests.
signatures: Vec<AgentCardSignature>JSON Web Signatures computed for this AgentCard.
supports_authenticated_extended_card: Option<bool>If true, the agent can provide an extended agent card to authenticated users.
Implementations§
Source§impl AgentCard
impl AgentCard
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
version: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, version: impl Into<String>, url: impl Into<String>, ) -> Self
Create a new AgentCard with minimal required fields
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the agent’s description
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set the agent’s version
Sourcepub fn with_protocol_version(self, protocol_version: impl Into<String>) -> Self
pub fn with_protocol_version(self, protocol_version: impl Into<String>) -> Self
Set the A2A protocol version
Sourcepub fn with_preferred_transport(self, transport: TransportProtocol) -> Self
pub fn with_preferred_transport(self, transport: TransportProtocol) -> Self
Set the preferred transport protocol
Sourcepub fn with_capabilities(self, capabilities: AgentCapabilities) -> Self
pub fn with_capabilities(self, capabilities: AgentCapabilities) -> Self
Set the agent’s capabilities
Sourcepub fn with_streaming(self, enabled: bool) -> Self
pub fn with_streaming(self, enabled: bool) -> Self
Enable streaming capability
Sourcepub fn with_push_notifications(self, enabled: bool) -> Self
pub fn with_push_notifications(self, enabled: bool) -> Self
Enable push notifications capability
Sourcepub fn with_state_transition_history(self, enabled: bool) -> Self
pub fn with_state_transition_history(self, enabled: bool) -> Self
Enable state transition history capability
Sourcepub fn add_extension(self, extension: AgentExtension) -> Self
pub fn add_extension(self, extension: AgentExtension) -> Self
Add an extension to the capabilities
Sourcepub fn with_default_input_modes(self, modes: Vec<String>) -> Self
pub fn with_default_input_modes(self, modes: Vec<String>) -> Self
Set default input modes (replaces existing)
Sourcepub fn add_input_mode(self, mode: impl Into<String>) -> Self
pub fn add_input_mode(self, mode: impl Into<String>) -> Self
Add a default input mode
Sourcepub fn with_default_output_modes(self, modes: Vec<String>) -> Self
pub fn with_default_output_modes(self, modes: Vec<String>) -> Self
Set default output modes (replaces existing)
Sourcepub fn add_output_mode(self, mode: impl Into<String>) -> Self
pub fn add_output_mode(self, mode: impl Into<String>) -> Self
Add a default output mode
Sourcepub fn with_skills(self, skills: Vec<AgentSkill>) -> Self
pub fn with_skills(self, skills: Vec<AgentSkill>) -> Self
Set skills (replaces existing)
Sourcepub fn add_skill(self, skill: AgentSkill) -> Self
pub fn add_skill(self, skill: AgentSkill) -> Self
Add a skill
Sourcepub fn add_skill_with<F>(
self,
id: impl Into<String>,
name: impl Into<String>,
f: F,
) -> Self
pub fn add_skill_with<F>( self, id: impl Into<String>, name: impl Into<String>, f: F, ) -> Self
Create a skill using a builder pattern and add it
Sourcepub fn with_provider(
self,
organization: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn with_provider( self, organization: impl Into<String>, url: impl Into<String>, ) -> Self
Set the provider information
Sourcepub fn with_additional_interfaces(self, interfaces: Vec<AgentInterface>) -> Self
pub fn with_additional_interfaces(self, interfaces: Vec<AgentInterface>) -> Self
Set additional interfaces (replaces existing)
Sourcepub fn add_interface(
self,
transport: TransportProtocol,
url: impl Into<String>,
) -> Self
pub fn add_interface( self, transport: TransportProtocol, url: impl Into<String>, ) -> Self
Add an additional interface
Sourcepub fn with_documentation_url(self, url: impl Into<String>) -> Self
pub fn with_documentation_url(self, url: impl Into<String>) -> Self
Set documentation URL
Sourcepub fn with_icon_url(self, url: impl Into<String>) -> Self
pub fn with_icon_url(self, url: impl Into<String>) -> Self
Set icon URL
Sourcepub fn with_security(self, security: Vec<HashMap<String, Vec<String>>>) -> Self
pub fn with_security(self, security: Vec<HashMap<String, Vec<String>>>) -> Self
Set security requirements
Sourcepub fn add_security_requirement(
self,
requirement: HashMap<String, Vec<String>>,
) -> Self
pub fn add_security_requirement( self, requirement: HashMap<String, Vec<String>>, ) -> Self
Add a security requirement
Sourcepub fn with_security_schemes(
self,
schemes: HashMap<String, SecurityScheme>,
) -> Self
pub fn with_security_schemes( self, schemes: HashMap<String, SecurityScheme>, ) -> Self
Set security schemes
Sourcepub fn with_authenticated_extended_card(self, supported: bool) -> Self
pub fn with_authenticated_extended_card(self, supported: bool) -> Self
Enable authenticated extended card support
Sourcepub fn with_signatures(self, signatures: Vec<AgentCardSignature>) -> Self
pub fn with_signatures(self, signatures: Vec<AgentCardSignature>) -> Self
Set signatures (replaces existing)
Sourcepub fn add_signature(self, signature: AgentCardSignature) -> Self
pub fn add_signature(self, signature: AgentCardSignature) -> Self
Add a signature