pub struct ToolReturnValue {
pub is_error: bool,
pub output: ToolOutput,
pub message: String,
pub display: Vec<DisplayBlock>,
pub extras: Option<Value>,
}Expand description
The result of a tool execution.
Fields§
§is_error: boolWhether the tool execution failed.
output: ToolOutputOutput returned to the model. Can be plain text or content parts.
message: StringExplanatory message for the model.
display: Vec<DisplayBlock>Display blocks shown to the user.
extras: Option<Value>Extra debug info.
Implementations§
Source§impl ToolReturnValue
impl ToolReturnValue
Sourcepub fn with_error(self) -> Self
pub fn with_error(self) -> Self
Mark this return value as an error.
Sourcepub fn with_output(self, output: impl Into<ToolOutput>) -> Self
pub fn with_output(self, output: impl Into<ToolOutput>) -> Self
Set the tool output.
Sourcepub fn with_display(self, block: DisplayBlock) -> Self
pub fn with_display(self, block: DisplayBlock) -> Self
Add a display block.
Trait Implementations§
Source§impl Clone for ToolReturnValue
impl Clone for ToolReturnValue
Source§fn clone(&self) -> ToolReturnValue
fn clone(&self) -> ToolReturnValue
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 ToolReturnValue
impl Debug for ToolReturnValue
Source§impl<'de> Deserialize<'de> for ToolReturnValue
impl<'de> Deserialize<'de> for ToolReturnValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolReturnValue
impl PartialEq for ToolReturnValue
Source§fn eq(&self, other: &ToolReturnValue) -> bool
fn eq(&self, other: &ToolReturnValue) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolReturnValue
impl Serialize for ToolReturnValue
impl StructuralPartialEq for ToolReturnValue
Auto Trait Implementations§
impl Freeze for ToolReturnValue
impl RefUnwindSafe for ToolReturnValue
impl Send for ToolReturnValue
impl Sync for ToolReturnValue
impl Unpin for ToolReturnValue
impl UnsafeUnpin for ToolReturnValue
impl UnwindSafe for ToolReturnValue
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