Class BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionThreadStatusIdleEvent.StopReasonThe agent completed its turn naturally and is ready for the next user message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionThreadStatusIdleEvent.StopReason.VisitorAn interface that defines how to map each variant of StopReason to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsSessionEndTurn>endTurn()The agent completed its turn naturally and is ready for the next user message. final Optional<BetaManagedAgentsSessionRequiresAction>requiresAction()The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). final Optional<BetaManagedAgentsSessionRetriesExhausted>retriesExhausted()The turn ended because the retry budget was exhausted ( max_iterationshit or an error escalated toretry_status: 'exhausted').final BooleanisEndTurn()final BooleanisRequiresAction()final BooleanisRetriesExhausted()final BetaManagedAgentsSessionEndTurnasEndTurn()The agent completed its turn naturally and is ready for the next user message. final BetaManagedAgentsSessionRequiresActionasRequiresAction()The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). final BetaManagedAgentsSessionRetriesExhaustedasRetriesExhausted()The turn ended because the retry budget was exhausted ( max_iterationshit or an error escalated toretry_status: 'exhausted').final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionThreadStatusIdleEvent.StopReasonvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReasonofEndTurn(BetaManagedAgentsSessionEndTurn endTurn)The agent completed its turn naturally and is ready for the next user message. final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReasonofRequiresAction(BetaManagedAgentsSessionRequiresAction requiresAction)The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReasonofRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)The turn ended because the retry budget was exhausted ( max_iterationshit or an error escalated toretry_status: 'exhausted').-
-
Method Detail
-
endTurn
final Optional<BetaManagedAgentsSessionEndTurn> endTurn()
The agent completed its turn naturally and is ready for the next user message.
-
requiresAction
final Optional<BetaManagedAgentsSessionRequiresAction> requiresAction()
The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
retriesExhausted
final Optional<BetaManagedAgentsSessionRetriesExhausted> retriesExhausted()
The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
isRequiresAction
final Boolean isRequiresAction()
-
isRetriesExhausted
final Boolean isRetriesExhausted()
-
asEndTurn
final BetaManagedAgentsSessionEndTurn asEndTurn()
The agent completed its turn naturally and is ready for the next user message.
-
asRequiresAction
final BetaManagedAgentsSessionRequiresAction asRequiresAction()
The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
asRetriesExhausted
final BetaManagedAgentsSessionRetriesExhausted asRetriesExhausted()
The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = stopReason.accept(new StopReason.Visitor<Optional<String>>() { @Override public Optional<String> visitEndTurn(BetaManagedAgentsSessionEndTurn endTurn) { return Optional.of(endTurn.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofEndTurn
final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason ofEndTurn(BetaManagedAgentsSessionEndTurn endTurn)
The agent completed its turn naturally and is ready for the next user message.
-
ofRequiresAction
final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason ofRequiresAction(BetaManagedAgentsSessionRequiresAction requiresAction)
The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.
-
ofRetriesExhausted
final static BetaManagedAgentsSessionThreadStatusIdleEvent.StopReason ofRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)
The turn ended because the retry budget was exhausted (
max_iterationshit or an error escalated toretry_status: 'exhausted').
-
-
-
-