pub struct OutcomeEvent<'a> {
pub id: EffectId,
pub kind: &'a EffectKind,
pub outcome: &'a Result<Answered, ErrorReport>,
pub turn: usize,
pub call_id: Option<&'a CallId>,
pub context: Option<&'a ToolContext>,
}Expand description
An effect’s answer: what on_outcome sees.
Fields§
§id: EffectIdThe dispatch’s id.
kind: &'a EffectKindThe effect that was dispatched (after patches).
outcome: &'a Result<Answered, ErrorReport>The answer, after any earlier hook’s replacement.
turn: usizeThe turn the effect belongs to.
call_id: Option<&'a CallId>The call the effect answered, for a tool call the model emitted.
context: Option<&'a ToolContext>Published tool context, carried separately from the outcome.
Implementations§
Source§impl<'a> OutcomeEvent<'a>
impl<'a> OutcomeEvent<'a>
Sourcepub fn tool_result(&self) -> Option<&'a ToolResult>
pub fn tool_result(&self) -> Option<&'a ToolResult>
The tool result this outcome carries, for a tool-call effect.
Sourcepub fn tool_context(&self) -> Option<&'a ToolContext>
pub fn tool_context(&self) -> Option<&'a ToolContext>
The dispatch context the tool answered with, for a tool-call effect.
Sourcepub fn completion(&self) -> Option<&'a CompletionResponse>
pub fn completion(&self) -> Option<&'a CompletionResponse>
The completion this outcome carries, for a completion effect.
Trait Implementations§
Source§impl<'a> Clone for OutcomeEvent<'a>
impl<'a> Clone for OutcomeEvent<'a>
impl<'a> Copy for OutcomeEvent<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for OutcomeEvent<'a>
impl<'a> !UnwindSafe for OutcomeEvent<'a>
impl<'a> Freeze for OutcomeEvent<'a>
impl<'a> Send for OutcomeEvent<'a>
impl<'a> Sync for OutcomeEvent<'a>
impl<'a> Unpin for OutcomeEvent<'a>
impl<'a> UnsafeUnpin for OutcomeEvent<'a>
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