#[non_exhaustive]pub enum StopReason {
EndTurn,
MaxTokens,
ToolUse,
StopSequence,
Refusal,
PauseTurn,
Unknown(String),
}Expand description
Why the model stopped generating (Anthropic-shaped, provider-neutral).
Mirrors an open wire enum (a provider can return a reason we don’t model),
so it is #[non_exhaustive] with an StopReason::Unknown catch-all carrying
the raw string — the same approach codex-rs takes for forward-compatibility. Not
serialized (it is mapped to locode_protocol::Status by the engine), so no
serde derive is needed.
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.
EndTurn
The model finished its turn with a natural stop.
MaxTokens
The output hit the max_tokens ceiling.
ToolUse
The model wants to call one or more tools.
StopSequence
A configured stop sequence was produced.
Refusal
The model refused to continue.
PauseTurn
The turn was paused (e.g. a server-tool round-trip).
Unknown(String)
A stop reason this client does not model, carried verbatim.
Trait Implementations§
Source§impl Clone for StopReason
impl Clone for StopReason
Source§fn clone(&self) -> StopReason
fn clone(&self) -> StopReason
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StopReason
impl Debug 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
Mutably borrows from an owned value. Read more
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§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
Compare self to
key and return true if they are equal.