#[non_exhaustive]pub struct ToolResult {
pub content: ToolResultContent,
pub is_error: bool,
pub structured_content: Option<Value>,
pub mcp_meta: Option<McpMeta>,
pub new_messages: Option<Vec<Value>>,
pub file_changes: Vec<FileChange>,
pub ends_turn: Option<Option<String>>,
}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: ToolResultContent§is_error: bool§structured_content: Option<Value>§mcp_meta: Option<McpMeta>§new_messages: Option<Vec<Value>>§file_changes: Vec<FileChange>The files this call wrote, for the host; the model never sees it.
ends_turn: Option<Option<String>>No model call follows the round this result is in; what the tool says of the end, if anything.
Implementations§
Source§impl ToolResult
impl ToolResult
pub fn text(s: impl Into<String>) -> Self
pub fn error_text(s: impl Into<String>) -> Self
pub fn blocks(blocks: Vec<ToolResultBlock>) -> Self
pub fn ending_turn(self, message: Option<String>) -> Self
pub fn with_error(self, is_error: bool) -> Self
pub fn with_structured(self, v: Value) -> Self
pub fn with_mcp_meta(self, m: McpMeta) -> Self
pub fn with_new_messages(self, m: Vec<Value>) -> Self
pub fn with_file_change(self, change: FileChange) -> Self
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl Default for ToolResult
impl Default for ToolResult
Source§impl<'de> Deserialize<'de> for ToolResult
impl<'de> Deserialize<'de> for ToolResult
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
Auto Trait Implementations§
impl Forget for ToolResult
impl Freeze for ToolResultwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<ToolResultBlock>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<FileChange>: Freeze,
impl Move for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin for ToolResultwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ToolResultBlock>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<FileChange>: UnsafeUnpin,
impl UnwindSafe for ToolResult
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