pub enum StopReason {
EndOfSpeech,
FrameCapReached,
DurationLimitReached,
Cancelled,
}Expand description
Why a generation stopped.
The reason travels with every result because two of these produce audio that sounds finished and are not.
Variants§
EndOfSpeech
The model emitted end-of-speech. The only clean completion.
FrameCapReached
The frame cap was reached without end-of-speech — the audio is cut off mid-utterance.
DurationLimitReached
A hard duration limit stopped generation — also a cut-off.
Cancelled
The caller cancelled.
Implementations§
Source§impl StopReason
impl StopReason
Sourcepub const fn is_truncated(self) -> bool
pub const fn is_truncated(self) -> bool
Whether the audio was cut off rather than completed.
The predicate the CLI branches its exit code on. An agent cannot hear a truncated word, so this must be inspectable rather than audible.
Sourcepub const fn is_clean_completion(self) -> bool
pub const fn is_clean_completion(self) -> bool
Whether this outcome may be reported as an unqualified success.
Only StopReason::EndOfSpeech may. Anything else is either truncated or cancelled, and
reporting it as plain success is the counterfeit green Doctrine #0.4 forbids.
Trait Implementations§
Source§impl Clone for StopReason
impl Clone for StopReason
Source§fn clone(&self) -> StopReason
fn clone(&self) -> StopReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StopReason
Source§impl Debug for StopReason
impl Debug for StopReason
Source§impl Display for StopReason
impl Display for StopReason
impl Eq for StopReason
Source§impl PartialEq for StopReason
impl PartialEq for StopReason
impl StructuralPartialEq for StopReason
Auto Trait Implementations§
impl Freeze for StopReason
impl RefUnwindSafe for StopReason
impl Send for StopReason
impl Sync for StopReason
impl Unpin for StopReason
impl UnsafeUnpin for StopReason
impl UnwindSafe for StopReason
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.