pub struct AgentToolResult {
pub success: bool,
pub output: String,
pub metadata: Option<Value>,
pub content_blocks: Option<Vec<ContentBlock>>,
pub terminate: bool,
}Expand description
Result of tool execution
Fields§
§success: boolpub.
output: Stringpub.
metadata: Option<Value>pub.
content_blocks: Option<Vec<ContentBlock>>Optional content blocks (e.g., image blocks) to include in the tool result message.
When present, these are used as the content of the ToolResultMessage instead of
wrapping output in a Text block.
terminate: boolWhen true, signals that the agent loop should terminate after this batch
of tool calls completes. Defaults to false so that the loop continues
unless a tool explicitly opts-in to termination.
Implementations§
Source§impl AgentToolResult
impl AgentToolResult
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
TODO: document this function.
Sourcepub fn with_content_blocks(self, blocks: Vec<ContentBlock>) -> Self
pub fn with_content_blocks(self, blocks: Vec<ContentBlock>) -> Self
TODO: document this function.
Sourcepub fn with_terminate(self) -> Self
pub fn with_terminate(self) -> Self
Mark this result as requesting agent-loop termination.
Trait Implementations§
Source§impl Debug for AgentToolResult
impl Debug for AgentToolResult
Auto Trait Implementations§
impl Freeze for AgentToolResult
impl RefUnwindSafe for AgentToolResult
impl Send for AgentToolResult
impl Sync for AgentToolResult
impl Unpin for AgentToolResult
impl UnsafeUnpin for AgentToolResult
impl UnwindSafe for AgentToolResult
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