pub struct Tool {
pub name: String,
pub description: String,
pub parameters: Option<Value>,
pub execute: ToolExecutionLocation,
}Expand description
AG-UI tool definition.
Fields§
§name: StringTool name.
description: StringTool description.
parameters: Option<Value>JSON Schema for tool parameters.
execute: ToolExecutionLocationWhere the tool executes (frontend or backend).
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn backend(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn backend(name: impl Into<String>, description: impl Into<String>) -> Self
Create a new backend tool definition.
Sourcepub fn frontend(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn frontend(name: impl Into<String>, description: impl Into<String>) -> Self
Create a new frontend tool definition.
Sourcepub fn with_parameters(self, parameters: Value) -> Self
pub fn with_parameters(self, parameters: Value) -> Self
Set the JSON Schema parameters.
Sourcepub fn is_frontend(&self) -> bool
pub fn is_frontend(&self) -> bool
Check if this is a frontend tool.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
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 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 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