#[non_exhaustive]pub struct Command {
pub name: String,
pub description: String,
pub input: Option<AvailableCommandInput>,
pub meta: Option<Map<String, Value>>,
}unstable_protocol_v2 only.Expand description
A slash command the user can invoke by including it in a prompt.
The type discriminator value is command.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringCommand name (e.g., create_plan, research_codebase).
description: StringHuman-readable description of what the command does.
input: Option<AvailableCommandInput>Input for the command if required
Omitted and null are equivalent and mean the command takes no input.
meta: Option<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Omitted and null are equivalent and mean no metadata.
Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl Command
impl Command
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Command
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Command
Builds Command with the required fields set; optional fields start unset or empty.
Sourcepub fn input(self, input: impl IntoOption<AvailableCommandInput>) -> Command
pub fn input(self, input: impl IntoOption<AvailableCommandInput>) -> Command
Input for the command if required
Sourcepub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> Command
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> Command
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Command, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Command, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Command
Source§impl JsonSchema for Command
impl JsonSchema for Command
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Command
impl Serialize for Command
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,
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.