pub struct ToolOutput {
pub content: String,
pub compact: Option<String>,
pub is_error: bool,
pub terminate: bool,
}Expand description
Output from a tool execution, carrying both the full content (shown in expanded mode / sent to the LLM) and an optional compact label for collapsed UI display.
Fields§
§content: StringFull content sent to the LLM and shown when expanded.
compact: Option<String>Compact label shown in collapsed mode (e.g. read docs docs/README.md).
When None, the full content is always shown.
is_error: boolWhether the result is an error.
terminate: boolWhen true, the agent loop stops after this batch of tool calls
(no more LLM calls). Pi-compatible: terminate on tool results.
Implementations§
Source§impl ToolOutput
impl ToolOutput
pub fn ok(content: impl Into<String>) -> Self
pub fn ok_with_compact( content: impl Into<String>, compact: impl Into<String>, ) -> Self
pub fn err(message: impl Into<String>) -> Self
Sourcepub fn with_terminate(self, terminate: bool) -> Self
pub fn with_terminate(self, terminate: bool) -> Self
Mark this tool output as terminal — the agent loop will stop after this batch of tool calls when ALL tools in the batch return terminate=true.
Trait Implementations§
Source§impl Clone for ToolOutput
impl Clone for ToolOutput
Source§fn clone(&self) -> ToolOutput
fn clone(&self) -> ToolOutput
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 ToolOutput
impl RefUnwindSafe for ToolOutput
impl Send for ToolOutput
impl Sync for ToolOutput
impl Unpin for ToolOutput
impl UnsafeUnpin for ToolOutput
impl UnwindSafe for ToolOutput
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