Skip to main content

TurnInterruption

Enum TurnInterruption 

Source
#[non_exhaustive]
pub enum TurnInterruption {
Show 18 variants
#[non_exhaustive]
Cancelled { invocation_id: Option<InvocationId>, },
#[non_exhaustive]
DeadlineExceeded { invocation_id: Option<InvocationId>, },
#[non_exhaustive]
MaxModelRounds { limit: u32, },
#[non_exhaustive]
MaxToolCalls { invocation_id: InvocationId, limit: u32, declared_before: u32, declared_this_round: usize, },
#[non_exhaustive]
ToolCatalogFailed { invocation_id: InvocationId, error: ToolCatalogError, },
#[non_exhaustive]
PrepareFailed { invocation_id: InvocationId, error: PrepareError, },
#[non_exhaustive]
ModelCallFailed { invocation_id: InvocationId, error: ModelInvokeError, },
#[non_exhaustive]
ModelMaxTokens { invocation_id: InvocationId, output: ModelOutput, },
#[non_exhaustive]
ModelRefusal { invocation_id: InvocationId, output: ModelOutput, },
#[non_exhaustive]
ModelContextWindowExceeded { invocation_id: InvocationId, output: ModelOutput, },
#[non_exhaustive]
ModelStopUnrecognized { invocation_id: InvocationId, output: ModelOutput, },
#[non_exhaustive]
ModelConversionFailed { invocation_id: InvocationId, error: ModelBlockError, output: ModelOutput, block_ids: Vec<BlockId>, },
#[non_exhaustive]
ModelBatchFailed { invocation_id: InvocationId, error: BatchError, output: ModelOutput, blocks: Vec<ContextBlock>, },
#[non_exhaustive]
ModelCommitFailed { invocation_id: InvocationId, error: EditFailure, output: ModelOutput, },
#[non_exhaustive]
ToolProcessingFailed { invocation_id: InvocationId, error: ToolProcessingError, },
#[non_exhaustive]
ToolResultValidationFailed { invocation_id: InvocationId, error: ToolResultError, },
#[non_exhaustive]
ToolCommitFailed { invocation_id: InvocationId, error: EditFailure, },
#[non_exhaustive]
UnknownToolOutcome { invocation_id: InvocationId, call_block_id: BlockId, },
}
Expand description

Typed interruption causes retaining the relevant failure inputs.

Display gives one sentence a host can show. More causes may be added; a match needs a wildcard arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
Cancelled

Caller cancellation stopped an unselected execution stage.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: Option<InvocationId>

Logical invocation, or none when stopping between invocations.

§

#[non_exhaustive]
DeadlineExceeded

The inherited absolute execution deadline stopped a stage.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: Option<InvocationId>

Logical invocation, or none when stopping between invocations.

§

#[non_exhaustive]
MaxModelRounds

The logical invocation limit was reached before creating a new invocation.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§limit: u32

Configured maximum for this execution.

§

#[non_exhaustive]
MaxToolCalls

New declarations committed, but their cumulative count exceeds the limit.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§limit: u32

Configured maximum for this execution.

§declared_before: u32

Number of declarations accepted in earlier invocations.

§declared_this_round: usize

Untruncated number of newly committed declarations.

§

#[non_exhaustive]
ToolCatalogFailed

Tool binding failed before preparation or model invocation.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolCatalogError

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
PrepareFailed

Preparation failed; any edits already committed by the preparer remain.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: PrepareError

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
ModelCallFailed

The logical gateway call failed; its original classification is retained.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ModelInvokeError

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
ModelMaxTokens

Generation reached its token limit; the complete output was not committed.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

#[non_exhaustive]
ModelRefusal

The model refused; the complete output was not committed.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

#[non_exhaustive]
ModelContextWindowExceeded

The provider stopped on the context window; the complete output was not committed.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

#[non_exhaustive]
ModelStopUnrecognized

The provider reported a stop value the kernel has no meaning for; the complete output was not committed. The wire value is on output.raw_stop_reason and is kept out of this message, because it is provider text of any length and content.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

#[non_exhaustive]
ModelConversionFailed

Pure conversion failed before commit, retaining output and supplied IDs.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ModelBlockError

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§block_ids: Vec<BlockId>

All IDs supplied to the failed pure conversion.

§

#[non_exhaustive]
ModelBatchFailed

Fresh batch construction failed before the converted blocks were committed.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: BatchError

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§blocks: Vec<ContextBlock>

All converted blocks rejected before model commit.

§

#[non_exhaustive]
ModelCommitFailed

Atomic model append failed; the edit error retains every submitted block.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: EditFailure

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

#[non_exhaustive]
ToolProcessingFailed

Tool processing failed; the complete current batch is returned in the outcome.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolProcessingError

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
ToolResultValidationFailed

Result scope validation failed; the complete batch remains uncommitted.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolResultError

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
ToolCommitFailed

Atomic tool-result append failed; both the batch and edit inputs are retained.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: EditFailure

Original typed failure, including any inputs owned by that error.

§

#[non_exhaustive]
UnknownToolOutcome

The full result batch committed, then execution stopped on an unknown result.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§invocation_id: InvocationId

The logical invocation associated with this stage.

§call_block_id: BlockId

Declaration of the first unknown result in final postprocessor order.

Trait Implementations§

Source§

impl Debug for TurnInterruption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TurnInterruption

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for TurnInterruption

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more