pub struct AgentCardBuilder { /* private fields */ }Expand description
Implementations§
Source§impl AgentCardBuilder
impl AgentCardBuilder
Sourcepub fn with_name(self, name: impl Into<Arc<str>>) -> Self
pub fn with_name(self, name: impl Into<Arc<str>>) -> Self
Sets the agent’s human-readable name.
Sourcepub fn with_description(self, description: impl Into<Arc<str>>) -> Self
pub fn with_description(self, description: impl Into<Arc<str>>) -> Self
Sets the agent’s human-readable description.
Sourcepub fn with_version(self, version: impl Into<Arc<str>>) -> Self
pub fn with_version(self, version: impl Into<Arc<str>>) -> Self
Sets the agent’s version string.
Sourcepub fn with_interface(self, interface: AgentInterface) -> Self
pub fn with_interface(self, interface: AgentInterface) -> Self
Adds an interface the agent publishes. The first call is the preferred interface; subsequent calls are fallbacks in the order the spec reads.
Sourcepub fn with_provider(self, provider: AgentProvider) -> Self
pub fn with_provider(self, provider: AgentProvider) -> Self
Sets the service provider of the agent. Optional in the spec; a builder that does not call this method produces a card with no provider field on the wire.
Sourcepub fn with_documentation_url(self, url: Url) -> Self
pub fn with_documentation_url(self, url: Url) -> Self
Sets the URL providing additional documentation about the agent. Optional in the spec; absent on the wire unless this method is called.
Sourcepub fn with_icon_url(self, url: Url) -> Self
pub fn with_icon_url(self, url: Url) -> Self
Sets the URL to an icon for the agent. Optional in the spec; absent on the wire unless this method is called. UI clients surface this as the agent’s avatar in a directory listing.
Sourcepub fn with_capabilities(self, capabilities: AgentCapabilities) -> Self
pub fn with_capabilities(self, capabilities: AgentCapabilities) -> Self
Sets the capability set.
Sourcepub fn with_extension(self, extension: AgentExtension) -> Self
pub fn with_extension(self, extension: AgentExtension) -> Self
Adds a single protocol extension the agent supports.
Convenience for the common “one extension at a time”
pattern; a caller that wants to set several at once
builds the AgentCapabilities directly and uses
with_capabilities.
Sourcepub fn with_security_scheme(
self,
name: impl Into<Arc<str>>,
scheme: SecurityScheme,
) -> Self
pub fn with_security_scheme( self, name: impl Into<Arc<str>>, scheme: SecurityScheme, ) -> Self
Registers a security scheme under name. The same
name is the key in
AgentCard::security_schemes
and the key a client uses in
SecurityRequirement
to demand that scheme. The wire form is OpenAPI 3.x.
Sourcepub fn with_security_requirement(self, requirement: SecurityRequirement) -> Self
pub fn with_security_requirement(self, requirement: SecurityRequirement) -> Self
Adds a security requirement to the agent’s published list. The requirements are tried in the order they are added; a client picks the first one it can satisfy.
Sourcepub fn with_input_mode(self, mode: impl Into<Arc<str>>) -> Self
pub fn with_input_mode(self, mode: impl Into<Arc<str>>) -> Self
Adds a default input mode.
Sourcepub fn with_output_mode(self, mode: impl Into<Arc<str>>) -> Self
pub fn with_output_mode(self, mode: impl Into<Arc<str>>) -> Self
Adds a default output mode.
Sourcepub fn with_skill(self, skill: AgentSkill) -> Self
pub fn with_skill(self, skill: AgentSkill) -> Self
Adds a skill the agent advertises.
Sourcepub fn build(self) -> Result<AgentCard, AgentCardError>
pub fn build(self) -> Result<AgentCard, AgentCardError>
Builds the card, checking the spec’s required-field invariants.
§Errors
AgentCardError on the first invariant failure. The
error names the field so the caller can fix the input.