pub struct ToolResult {
pub content: String,
pub is_error: bool,
pub images: Vec<ToolImage>,
pub is_pending: bool,
pub pending_task_id: Option<String>,
}Expand description
Result returned to the LLM after tool execution.
Fields§
§content: StringText content - LLM will read this.
is_error: boolWhether this is an error (LLM can see errors and adjust strategy).
images: Vec<ToolImage>Images attached to this result (e.g. from read tool reading an image
file). Most tools leave this empty.
is_pending: booltrue when this is a placeholder for an async task: content tells
the LLM the work is in progress, and the real result is reinjected
later (by the Agent) when the background task finishes. The Agent uses
this flag to emit AsyncToolStarted instead of treating the call as
finished. The placeholder content is still added to history as the tool
message so the LLM can continue other work while waiting.
pending_task_id: Option<String>Task id of the background task, set iff is_pending. Used by the Agent
to track/cancel the task and by the frontend to correlate progress.
Implementations§
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more