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 success(output: impl Into<String>) -> AgentToolResult
pub fn success(output: impl Into<String>) -> AgentToolResult
TODO.
Sourcepub fn error(output: impl Into<String>) -> AgentToolResult
pub fn error(output: impl Into<String>) -> AgentToolResult
TODO.
Sourcepub fn with_metadata(self, metadata: Value) -> AgentToolResult
pub fn with_metadata(self, metadata: Value) -> AgentToolResult
TODO: document this function.
Sourcepub fn with_content_blocks(self, blocks: Vec<ContentBlock>) -> AgentToolResult
pub fn with_content_blocks(self, blocks: Vec<ContentBlock>) -> AgentToolResult
TODO: document this function.
Sourcepub fn with_terminate(self) -> AgentToolResult
pub fn with_terminate(self) -> AgentToolResult
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more