pub struct AgentToolResult {
pub content: Vec<TextContentOrImage>,
pub details: Value,
pub usage: Option<Usage>,
pub added_tool_names: Vec<String>,
pub terminate: bool,
}Expand description
Result returned from a tool execute. Mirrors TS AgentToolResult<T>:
content goes back to the model, details are structured log/UI payload,
usage is optionally reported, and terminate hints the batch should stop.
Fields§
§content: Vec<TextContentOrImage>§details: Value§usage: Option<Usage>§added_tool_names: Vec<String>§terminate: boolImplementations§
Source§impl AgentToolResult
impl AgentToolResult
Sourcepub fn text(message: impl Into<String>) -> Self
pub fn text(message: impl Into<String>) -> Self
Convenience: a single text block, empty details.
Sourcepub fn error_text(message: impl Into<String>) -> Self
pub fn error_text(message: impl Into<String>) -> Self
Convenience: an error text block. is_error is carried on the
ToolResultMessage, not the result; this just builds the content.
pub fn into_content(self) -> Vec<Content>
Trait Implementations§
Source§impl Clone for AgentToolResult
impl Clone for AgentToolResult
Source§fn clone(&self) -> AgentToolResult
fn clone(&self) -> AgentToolResult
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 moreSource§impl Debug for AgentToolResult
impl Debug for AgentToolResult
Source§impl Default for AgentToolResult
impl Default for AgentToolResult
Source§fn default() -> AgentToolResult
fn default() -> AgentToolResult
Returns the “default value” for a type. Read more
Source§impl From<AgentToolResult> for Result<AgentToolResult, AgentError>
impl From<AgentToolResult> for Result<AgentToolResult, AgentError>
Source§fn from(r: AgentToolResult) -> Self
fn from(r: AgentToolResult) -> Self
Converts to this type from the input type.
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