Enum Tool
pub enum Tool {
Mcp(McpToolset),
Provider {
provider: FormatId,
raw: Value,
},
Function(ToolDefinition),
}Expand description
A tool available to the model, in catalog order.
Variants§
Mcp(McpToolset)
A remote MCP server and the tools it exposes.
Provider
A definition without a supported neutral representation.
Fields
Function(ToolDefinition)
An agent-executed function. Its JSON retains the existing flat definition shape.
Implementations§
§impl Tool
impl Tool
pub fn function(&self) -> Option<&ToolDefinition>
pub fn function(&self) -> Option<&ToolDefinition>
Returns the function definition, if this is an agent-executed function.
Trait Implementations§
§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
§fn deserialize<D>(
deserializer: D,
) -> Result<Tool, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Tool, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<ToolDefinition> for Tool
impl From<ToolDefinition> for Tool
§fn from(definition: ToolDefinition) -> Tool
fn from(definition: ToolDefinition) -> Tool
Converts to this type from the input type.
§impl Serialize for Tool
impl Serialize for Tool
§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 Tool
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl UnwindSafe for Tool
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