pub struct ToolResult { /* private fields */ }Expand description
Result returned by a tool execution.
Implementations§
Source§impl ToolResult
impl ToolResult
pub fn success(content: impl Into<String>) -> Self
pub fn error(content: impl Into<String>) -> Self
Sourcepub fn with_structured_output(self, value: Value) -> Self
pub fn with_structured_output(self, value: Value) -> Self
Attach a structured-output side-effect. Used by StructuredOutputTool so the
agent loop doesn’t need to match on tool names.
Sourcepub fn with_discovered_tools(self, names: Vec<String>) -> Self
pub fn with_discovered_tools(self, names: Vec<String>) -> Self
Attach discovered tool names. Used by ToolSearchTool so the agent loop doesn’t
need to parse tool output by name.
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
Returns a duplicate of the value. Read more
1.0.0 · 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 ToolResult
impl Debug for ToolResult
Source§impl Default for ToolResult
impl Default for ToolResult
Source§fn default() -> ToolResult
fn default() -> ToolResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin for ToolResult
impl UnwindSafe for ToolResult
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