pub struct ToolResult {
pub content: String,
pub is_error: bool,
pub continuations: Vec<ToolContinuation>,
}Expand description
The result of executing a tool.
Fields§
§content: StringThe output content produced by the tool.
is_error: boolWhether the execution resulted in an error.
continuations: Vec<ToolContinuation>Runtime-only continuation hints for later tool presentation.
Implementations§
Source§impl ToolResult
impl ToolResult
Sourcepub fn success(content: impl Into<String>) -> Self
pub fn success(content: impl Into<String>) -> Self
Creates a successful tool result with the given content.
Sourcepub fn error(content: impl Into<String>) -> Self
pub fn error(content: impl Into<String>) -> Self
Creates an error tool result with the given error message.
Sourcepub fn with_continuation(self, continuation: ToolContinuation) -> Self
pub fn with_continuation(self, continuation: ToolContinuation) -> Self
Adds one runtime continuation hint to this tool result.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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