pub struct AgentSkill {
pub id: String,
pub name: String,
pub description: String,
pub tags: Vec<String>,
pub examples: Option<Vec<String>>,
pub input_modes: Option<Vec<String>>,
pub output_modes: Option<Vec<String>>,
pub security_requirements: Option<Vec<SecurityRequirement>>,
}Expand description
A discrete capability offered by an agent.
Fields§
§id: StringUnique skill identifier within the agent.
name: StringHuman-readable skill name.
description: StringHuman-readable description of what the skill does.
Searchable tags for the skill.
ProtoJSON printers omit empty repeated fields — a skill published by
an official SDK with no tags arrives without the key. Absence means
empty; failing the whole card parse over it is not interoperable.
examples: Option<Vec<String>>Example prompts illustrating how to invoke the skill.
input_modes: Option<Vec<String>>MIME types accepted as input by this skill.
output_modes: Option<Vec<String>>MIME types produced as output by this skill.
security_requirements: Option<Vec<SecurityRequirement>>Security requirements specific to this skill.
Implementations§
Source§impl AgentSkill
impl AgentSkill
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
) -> AgentSkill
pub fn new( id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, ) -> AgentSkill
A new skill with no tags, examples, modes or security requirements.
use a2a_protocol_types::agent_card::AgentSkill;
let skill = AgentSkill::new("echo", "Echo", "Repeats the caller's text");
assert!(skill.tags.is_empty());
assert!(skill.examples.is_none());Replaces the skill’s searchable tags.
use a2a_protocol_types::agent_card::AgentSkill;
let skill = AgentSkill::new("analyze", "Analysis", "Counts things")
.with_tags(["code", "metrics"]);
assert_eq!(skill.tags, ["code", "metrics"]);Sourcepub fn with_examples<I, S>(self, examples: I) -> AgentSkill
pub fn with_examples<I, S>(self, examples: I) -> AgentSkill
Replaces the skill’s example prompts.
use a2a_protocol_types::agent_card::AgentSkill;
let skill = AgentSkill::new("echo", "Echo", "Repeats").with_examples(["say hello"]);
assert_eq!(skill.examples.as_deref(), Some(&["say hello".to_owned()][..]));Sourcepub fn with_input_modes<I, S>(self, modes: I) -> AgentSkill
pub fn with_input_modes<I, S>(self, modes: I) -> AgentSkill
Replaces the MIME types this skill accepts.
use a2a_protocol_types::agent_card::AgentSkill;
let skill = AgentSkill::new("ocr", "OCR", "Reads text").with_input_modes(["image/png"]);
assert_eq!(skill.input_modes.as_deref(), Some(&["image/png".to_owned()][..]));Sourcepub fn with_output_modes<I, S>(self, modes: I) -> AgentSkill
pub fn with_output_modes<I, S>(self, modes: I) -> AgentSkill
Replaces the MIME types this skill produces.
use a2a_protocol_types::agent_card::AgentSkill;
let skill = AgentSkill::new("ocr", "OCR", "Reads text").with_output_modes(["text/plain"]);
assert_eq!(skill.output_modes.as_deref(), Some(&["text/plain".to_owned()][..]));Sourcepub fn with_security_requirements(
self,
reqs: Vec<SecurityRequirement>,
) -> AgentSkill
pub fn with_security_requirements( self, reqs: Vec<SecurityRequirement>, ) -> AgentSkill
Replaces the security requirements that apply to this skill alone.
Trait Implementations§
Source§impl Clone for AgentSkill
impl Clone for AgentSkill
Source§fn clone(&self) -> AgentSkill
fn clone(&self) -> AgentSkill
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentSkill
impl Debug for AgentSkill
Source§impl<'de> Deserialize<'de> for AgentSkill
impl<'de> Deserialize<'de> for AgentSkill
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentSkill, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentSkill, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<AgentSkill> for AgentSkill
impl From<AgentSkill> for AgentSkill
Source§fn from(value: AgentSkill) -> AgentSkill
fn from(value: AgentSkill) -> AgentSkill
Source§impl From<AgentSkill> for AgentSkill
impl From<AgentSkill> for AgentSkill
Source§fn from(value: AgentSkill) -> AgentSkill
fn from(value: AgentSkill) -> AgentSkill
Source§impl Serialize for AgentSkill
impl Serialize for AgentSkill
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for AgentSkill
impl RefUnwindSafe for AgentSkill
impl Send for AgentSkill
impl Sync for AgentSkill
impl Unpin for AgentSkill
impl UnsafeUnpin for AgentSkill
impl UnwindSafe for AgentSkill
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request