#[non_exhaustive]pub struct ToolOutput {
pub content: Value,
pub truncation: Truncation,
pub meta: Option<ToolOutputMeta>,
pub artifact: Option<ArtifactRef>,
}Expand description
What a tool returned, as recorded by the tool door.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: ValueThe observation payload; after middle truncation this is a JSON string (head + notice + tail) regardless of the original shape.
truncation: TruncationWhether and how the content was shortened.
meta: Option<ToolOutputMeta>Optional observability metadata.
artifact: Option<ArtifactRef>Reference to the full output in an artifact store, if spilled.
Implementations§
Source§impl ToolOutput
impl ToolOutput
Sourcepub fn new(content: Value) -> Self
pub fn new(content: Value) -> Self
Creates an output with no truncation, metadata, or artifact.
Sourcepub fn is_truncated(&self) -> bool
pub fn is_truncated(&self) -> bool
Returns whether the content was shortened (any marker other than
Truncation::None).
Trait Implementations§
Source§impl Clone for ToolOutput
impl Clone for ToolOutput
Source§impl Debug for ToolOutput
impl Debug for ToolOutput
Source§impl<'de> Deserialize<'de> for ToolOutput
impl<'de> Deserialize<'de> for ToolOutput
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 ToolOutput
impl PartialEq for ToolOutput
Source§impl Serialize for ToolOutput
impl Serialize for ToolOutput
impl StructuralPartialEq for ToolOutput
Auto Trait Implementations§
impl Forget for ToolOutput
impl Freeze for ToolOutput
impl Move for ToolOutput
impl RefUnwindSafe for ToolOutput
impl Send for ToolOutput
impl Sync for ToolOutput
impl Unpin for ToolOutput
impl UnsafeUnpin for ToolOutput
impl UnwindSafe for ToolOutput
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