pub struct ToolSpec {
pub name: String,
pub description: String,
pub input_schema: Value,
pub annotations: ToolAnnotations,
pub tier: Tier,
pub charge: BudgetCharge,
}Expand description
What the model sees about a tool, plus how the runtime treats it.
Fields§
§name: String§description: String§input_schema: ValueJSON Schema for the arguments.
annotations: ToolAnnotations§tier: Tier§charge: BudgetChargeImplementations§
Source§impl ToolSpec
impl ToolSpec
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
A tool with an empty object schema and the conservative default tier (Navigate).
pub fn schema(self, schema: Value) -> Self
Sourcepub fn annotations(self, a: ToolAnnotations) -> Self
pub fn annotations(self, a: ToolAnnotations) -> Self
Sets annotations and derives the tier from them.
Sourcepub fn tier(self, tier: Tier) -> Self
pub fn tier(self, tier: Tier) -> Self
Sets the tier directly (for first-party tools that know their tier).
pub fn charge(self, charge: BudgetCharge) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolSpec
impl<'de> Deserialize<'de> for ToolSpec
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
impl StructuralPartialEq for ToolSpec
Auto Trait Implementations§
impl Forget for ToolSpec
impl Freeze for ToolSpec
impl Move for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpec
impl UnwindSafe for ToolSpec
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