#[non_exhaustive]pub enum StopReason {
EndTurn,
MaxTokens,
MaxTurnRequests,
Refusal,
Cancelled,
Other(String),
}unstable_protocol_v2 only.Expand description
Reasons why an agent stops active session work.
See protocol docs: Stop Reasons
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EndTurn
The active work ended successfully.
MaxTokens
The active work ended because the agent reached the maximum number of tokens.
MaxTurnRequests
The active work ended because the agent reached the maximum number of allowed agent requests before returning idle.
Refusal
The active work ended because the agent refused to continue. The user prompt and everything that comes after it won’t be included in the next prompt, so this should be reflected in the UI.
Cancelled
Active session work was cancelled by the client via session/cancel.
Agents should report this stop reason on an idle state_update session update
when cancellation succeeds, even if cancellation causes exceptions in
underlying operations.
Other(String)
Custom or future stop reason.
Values beginning with _ are reserved for implementation-specific
extensions. Unknown values that do not begin with _ are reserved for
future ACP variants.
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 moreSource§impl Debug for StopReason
impl Debug for StopReason
Source§impl<'de> Deserialize<'de> for StopReason
impl<'de> Deserialize<'de> for StopReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for StopReason
Source§impl IntoV1 for StopReason
impl IntoV1 for StopReason
Source§impl JsonSchema for StopReason
impl JsonSchema for StopReason
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for StopReason
impl PartialEq for StopReason
Source§fn eq(&self, other: &StopReason) -> bool
fn eq(&self, other: &StopReason) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for StopReason
impl Serialize 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.