pub struct ToolSpec { /* private fields */ }Expand description
Provider-neutral tool specification.
Implementations§
Source§impl ToolSpec
impl ToolSpec
Sourcepub fn new(
name: ToolName,
description: &str,
input_schema: ToolInputSchema,
) -> Result<ToolSpec, CoreError>
pub fn new( name: ToolName, description: &str, input_schema: ToolInputSchema, ) -> Result<ToolSpec, CoreError>
Creates a validated provider-neutral tool specification.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Borrows the human-readable tool description.
Sourcepub fn input_schema(&self) -> &ToolInputSchema
pub fn input_schema(&self) -> &ToolInputSchema
Borrows the provider-neutral input schema.
Sourcepub fn with_input_schema(
self,
input_schema: ToolInputSchema,
) -> Result<ToolSpec, CoreError>
pub fn with_input_schema( self, input_schema: ToolInputSchema, ) -> Result<ToolSpec, CoreError>
Returns this specification with a validated replacement input schema.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolSpec
impl<'de> Deserialize<'de> for ToolSpec
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ToolSpec, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ToolSpec, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ToolSpec
impl JsonSchema for ToolSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for ToolSpec
impl Serialize for ToolSpec
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ToolSpec
Auto Trait Implementations§
impl Forget for ToolSpec
impl Freeze for ToolSpecwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpecwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
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