pub enum OutcomeAction {
Proceed,
Replace(Result<Answered, ErrorReport>),
}Expand description
Outcome-boundary action.
Variants§
Implementations§
Source§impl OutcomeAction
impl OutcomeAction
Sourcepub fn replace(outcome: Result<Answered, ErrorReport>) -> Self
pub fn replace(outcome: Result<Answered, ErrorReport>) -> Self
Use this answer instead.
Sourcepub fn stop(reason: impl Into<String>) -> Self
pub fn stop(reason: impl Into<String>) -> Self
Stop the run with reason: a replacement whose error is Cancelled
terminates the run instead of being delivered. This is how a hook
that observed an answer (a completion, a tool result) ends the run.
The cancellation short-circuits nested hook stacks; later hooks cannot
replace it with a successful answer.
Sourcepub fn rewrite_tool_output(event: &OutcomeEvent<'_>, output: ToolOutput) -> Self
pub fn rewrite_tool_output(event: &OutcomeEvent<'_>, output: ToolOutput) -> Self
Replace the model-visible output of a tool result, keeping the
result’s status and the dispatch context. Proceed when event
did not resolve to a tool result.
Sourcepub fn rewrite_tool_result(
event: &OutcomeEvent<'_>,
text: impl Into<String>,
) -> Self
pub fn rewrite_tool_result( event: &OutcomeEvent<'_>, text: impl Into<String>, ) -> Self
OutcomeAction::rewrite_tool_output with a text output.
Trait Implementations§
Source§impl Clone for OutcomeAction
impl Clone for OutcomeAction
Auto Trait Implementations§
impl !RefUnwindSafe for OutcomeAction
impl !UnwindSafe for OutcomeAction
impl Forget for OutcomeAction
impl Freeze for OutcomeAction
impl Move for OutcomeAction
impl Send for OutcomeAction
impl Sync for OutcomeAction
impl Unpin for OutcomeAction
impl UnsafeUnpin for OutcomeAction
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