pub struct ToolOutput(/* private fields */);Expand description
Ordered, serializable tool output without decrypted bytes or host paths.
Implementations§
Source§impl ToolOutput
impl ToolOutput
pub fn empty() -> Self
pub fn text(value: impl Into<String>) -> Self
pub fn from_parts(parts: Vec<ToolOutputPart>) -> Self
pub fn parts(&self) -> &[ToolOutputPart]
pub fn parts_mut(&mut self) -> &mut [ToolOutputPart]
pub fn push_text(&mut self, value: impl Into<String>)
pub fn push_artifact(&mut self, artifact: ArtifactRef)
Sourcepub fn retain_artifacts(&mut self, retain: impl FnMut(&ArtifactRef) -> bool)
pub fn retain_artifacts(&mut self, retain: impl FnMut(&ArtifactRef) -> bool)
Retain artifact parts selected for an ephemeral model request. Text parts are always preserved.
pub fn has_artifacts(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn contains(&self, pattern: &str) -> bool
Sourcepub fn text_content(&self) -> String
pub fn text_content(&self) -> String
Concatenate textual parts for logs, previews, and text-only UI surfaces.
pub fn len(&self) -> usize
Trait Implementations§
Source§impl Clone for ToolOutput
impl Clone for ToolOutput
Source§impl Debug for ToolOutput
impl Debug for ToolOutput
Source§impl Default for ToolOutput
impl Default 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 Display for ToolOutput
impl Display for ToolOutput
impl Eq for ToolOutput
Source§impl From<&str> for ToolOutput
impl From<&str> for ToolOutput
Source§impl From<String> for ToolOutput
impl From<String> for ToolOutput
Source§impl PartialEq for ToolOutput
impl PartialEq for ToolOutput
Source§impl PartialEq<&str> for ToolOutput
impl PartialEq<&str> for ToolOutput
Source§impl PartialEq<ToolOutput> for &str
impl PartialEq<ToolOutput> for &str
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 ToolOutputwhere
RawVecInner: Sync,
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