#[non_exhaustive]pub struct ToolResultPayload {
pub call_block_id: BlockId,
pub status: ToolResultStatus,
pub output: ToolOutput,
pub media: Vec<MediaRef>,
pub notes: Vec<TextPayload>,
}Expand description
The result fact for one tool call: its declaration identity, terminal status, output, media, and ordered notes. Pairing is kernel-enforced.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.call_block_id: BlockIdThe declaration block this result answers.
status: ToolResultStatusTerminal status of the invocation.
output: ToolOutputThe tool’s output, possibly truncated with an artifact spill.
media: Vec<MediaRef>Media artifacts attached to this result — references only; the bytes live in the host’s asset store, resolved provider-side at render time. Serde-additive: absent media defaults to empty.
notes: Vec<TextPayload>Ordered result notes. ToolBatch::resolve_at places any pre-execution
context notes before notes returned by the tool; tool implementations
should return only notes they add.
Implementations§
Source§impl ToolResultPayload
impl ToolResultPayload
Sourcepub fn new(
call_block_id: BlockId,
status: ToolResultStatus,
output: ToolOutput,
) -> Self
pub fn new( call_block_id: BlockId, status: ToolResultStatus, output: ToolOutput, ) -> Self
A result for one declaration, with no media and no notes.
Sourcepub fn with_media(self, media: Vec<MediaRef>) -> Self
pub fn with_media(self, media: Vec<MediaRef>) -> Self
Replaces the media artifacts attached to this result.
Sourcepub fn with_notes(self, notes: Vec<TextPayload>) -> Self
pub fn with_notes(self, notes: Vec<TextPayload>) -> Self
Replaces the ordered result notes.