AgentCard

Struct AgentCard 

Source
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: String

A human-readable name for the agent.

§description: String

A human-readable description of the agent.

§version: String

The agent’s own version number.

§protocol_version: String

The version of the A2A protocol this agent supports.

§url: String

The preferred endpoint URL for interacting with the agent.

§preferred_transport: TransportProtocol

The transport protocol for the preferred endpoint.

§capabilities: AgentCapabilities

A 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

Source

pub fn new( name: impl Into<String>, description: impl Into<String>, version: impl Into<String>, url: impl Into<String>, ) -> AgentCard

Create a new AgentCard with minimal required fields

Source

pub fn with_name(self, name: impl Into<String>) -> AgentCard

Set the agent’s name

Source

pub fn with_description(self, description: impl Into<String>) -> AgentCard

Set the agent’s description

Source

pub fn with_version(self, version: impl Into<String>) -> AgentCard

Set the agent’s version

Source

pub fn with_protocol_version( self, protocol_version: impl Into<String>, ) -> AgentCard

Set the A2A protocol version

Source

pub fn with_url(self, url: impl Into<String>) -> AgentCard

Set the agent’s URL endpoint

Source

pub fn with_preferred_transport(self, transport: TransportProtocol) -> AgentCard

Set the preferred transport protocol

Source

pub fn with_capabilities(self, capabilities: AgentCapabilities) -> AgentCard

Set the agent’s capabilities

Source

pub fn with_streaming(self, enabled: bool) -> AgentCard

Enable streaming capability

Source

pub fn with_push_notifications(self, enabled: bool) -> AgentCard

Enable push notifications capability

Source

pub fn with_state_transition_history(self, enabled: bool) -> AgentCard

Enable state transition history capability

Source

pub fn add_extension(self, extension: AgentExtension) -> AgentCard

Add an extension to the capabilities

Source

pub fn with_default_input_modes(self, modes: Vec<String>) -> AgentCard

Set default input modes (replaces existing)

Source

pub fn add_input_mode(self, mode: impl Into<String>) -> AgentCard

Add a default input mode

Source

pub fn with_default_output_modes(self, modes: Vec<String>) -> AgentCard

Set default output modes (replaces existing)

Source

pub fn add_output_mode(self, mode: impl Into<String>) -> AgentCard

Add a default output mode

Source

pub fn with_skills(self, skills: Vec<AgentSkill>) -> AgentCard

Set skills (replaces existing)

Source

pub fn add_skill(self, skill: AgentSkill) -> AgentCard

Add a skill

Source

pub fn add_skill_with<F>( self, id: impl Into<String>, name: impl Into<String>, f: F, ) -> AgentCard

Create a skill using a builder pattern and add it

Source

pub fn with_provider( self, organization: impl Into<String>, url: impl Into<String>, ) -> AgentCard

Set the provider information

Source

pub fn with_additional_interfaces( self, interfaces: Vec<AgentInterface>, ) -> AgentCard

Set additional interfaces (replaces existing)

Source

pub fn add_interface( self, transport: TransportProtocol, url: impl Into<String>, ) -> AgentCard

Add an additional interface

Source

pub fn with_documentation_url(self, url: impl Into<String>) -> AgentCard

Set documentation URL

Source

pub fn with_icon_url(self, url: impl Into<String>) -> AgentCard

Set icon URL

Source

pub fn with_security( self, security: Vec<HashMap<String, Vec<String>>>, ) -> AgentCard

Set security requirements

Source

pub fn add_security_requirement( self, requirement: HashMap<String, Vec<String>>, ) -> AgentCard

Add a security requirement

Source

pub fn with_security_schemes( self, schemes: HashMap<String, SecurityScheme>, ) -> AgentCard

Set security schemes

Source

pub fn with_authenticated_extended_card(self, supported: bool) -> AgentCard

Enable authenticated extended card support

Source

pub fn with_signatures(self, signatures: Vec<AgentCardSignature>) -> AgentCard

Set signatures (replaces existing)

Source

pub fn add_signature(self, signature: AgentCardSignature) -> AgentCard

Add a signature

Trait Implementations§

Source§

impl Clone for AgentCard

Source§

fn clone(&self) -> AgentCard

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentCard

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentCard

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<AgentCard, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for AgentCard

Source§

fn eq(&self, other: &AgentCard) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AgentCard

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AgentCard

Source§

impl StructuralPartialEq for AgentCard

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,