pub struct ToolCapability {
pub tool_id: String,
pub name: String,
pub version: String,
pub input_schema: Option<String>,
pub output_schema: Option<String>,
pub requires: Vec<String>,
pub estimated_time_ms: u32,
pub stateless: bool,
}Expand description
Tool capability
Fields§
§tool_id: StringUnique tool identifier
name: StringHuman-readable name
version: StringVersion
input_schema: Option<String>Input schema (JSON Schema as string)
output_schema: Option<String>Output schema (JSON Schema as string)
requires: Vec<String>Required capabilities/dependencies
estimated_time_ms: u32Estimated execution time in ms (for typical input)
stateless: boolWhether tool is stateless
Implementations§
Source§impl ToolCapability
impl ToolCapability
Sourcepub fn input_schema_metadata_key(tool_id: &str) -> String
pub fn input_schema_metadata_key(tool_id: &str) -> String
Metadata key carrying this tool’s input JSON Schema.
Phase A.5.N convention: tool input/output schemas live in
CapabilitySet::metadata rather than the tag wire format
(JSON contains =/:/, which can’t round-trip through
tags). Format: tool::<tool_id>::input_schema.
Sourcepub fn output_schema_metadata_key(tool_id: &str) -> String
pub fn output_schema_metadata_key(tool_id: &str) -> String
Metadata key carrying this tool’s output JSON Schema.
See Self::input_schema_metadata_key.
Sourcepub fn new(tool_id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(tool_id: impl Into<String>, name: impl Into<String>) -> Self
Create new tool capability
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set version
Sourcepub fn with_input_schema(self, schema: impl Into<String>) -> Self
pub fn with_input_schema(self, schema: impl Into<String>) -> Self
Set input schema
Sourcepub fn with_output_schema(self, schema: impl Into<String>) -> Self
pub fn with_output_schema(self, schema: impl Into<String>) -> Self
Set output schema
Sourcepub fn with_estimated_time(self, ms: u32) -> Self
pub fn with_estimated_time(self, ms: u32) -> Self
Set estimated time
Sourcepub fn with_stateless(self, stateless: bool) -> Self
pub fn with_stateless(self, stateless: bool) -> Self
Set stateless flag
Trait Implementations§
Source§impl Clone for ToolCapability
impl Clone for ToolCapability
Source§fn clone(&self) -> ToolCapability
fn clone(&self) -> ToolCapability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolCapability
impl Debug for ToolCapability
Source§impl<'de> Deserialize<'de> for ToolCapability
impl<'de> Deserialize<'de> for ToolCapability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolCapability
impl PartialEq for ToolCapability
Source§fn eq(&self, other: &ToolCapability) -> bool
fn eq(&self, other: &ToolCapability) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolCapability
impl Serialize for ToolCapability
impl Eq for ToolCapability
impl StructuralPartialEq for ToolCapability
Auto Trait Implementations§
impl Freeze for ToolCapability
impl RefUnwindSafe for ToolCapability
impl Send for ToolCapability
impl Sync for ToolCapability
impl Unpin for ToolCapability
impl UnsafeUnpin for ToolCapability
impl UnwindSafe for ToolCapability
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.