Class BetaManagedAgentsSessionStatusIdleEvent.StopReason
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionStatusIdleEvent.StopReason
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionStatusIdleEvent.StopReason.VisitorAn interface that defines how to map each variant of StopReason to a value of type T.
public final classBetaManagedAgentsSessionStatusIdleEvent.StopReason.Type
-
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 repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.final Optional<BetaManagedAgentsSessionBudgetReached>budgetReached()The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). final Optional<BetaManagedAgentsSessionRefusal>refusal()The turn ended because the model's response was refused, for example by a safety classifier. final Optional<JsonValue>_json()final BetaManagedAgentsSessionStatusIdleEvent.StopReason.Typetype()final BooleanisEndTurn()final BooleanisRequiresAction()final BooleanisRetriesExhausted()final BooleanisBudgetReached()final BooleanisRefusal()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 repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.final BetaManagedAgentsSessionBudgetReachedasBudgetReached()The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). final BetaManagedAgentsSessionRefusalasRefusal()The turn ended because the model's response was refused, for example by a safety classifier. final <T extends Any> Taccept(BetaManagedAgentsSessionStatusIdleEvent.StopReason.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionStatusIdleEvent.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 BetaManagedAgentsSessionStatusIdleEvent.StopReasonofEndTurn(BetaManagedAgentsSessionEndTurn endTurn)The agent completed its turn naturally and is ready for the next user message. final static BetaManagedAgentsSessionStatusIdleEvent.StopReasonofRequiresAction(BetaManagedAgentsSessionRequiresAction requiresAction)The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). final static BetaManagedAgentsSessionStatusIdleEvent.StopReasonofRequiresAction(List<String> eventIds)Returns an immutable instance of StopReason whose ofRequiresAction variant is built from the given required eventIds. final static BetaManagedAgentsSessionStatusIdleEvent.StopReasonofRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)The turn ended because repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.final static BetaManagedAgentsSessionStatusIdleEvent.StopReasonofBudgetReached(BetaManagedAgentsSessionBudgetReached budgetReached)The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). final static BetaManagedAgentsSessionStatusIdleEvent.StopReasonofRefusal(BetaManagedAgentsSessionRefusal refusal)The turn ended because the model's response was refused, for example by a safety classifier. -
-
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 repeated errors exhausted the retry budget or an error escalated to
retry_status: 'exhausted'.
-
budgetReached
final Optional<BetaManagedAgentsSessionBudgetReached> budgetReached()
The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.
-
refusal
final Optional<BetaManagedAgentsSessionRefusal> refusal()
The turn ended because the model's response was refused, for example by a safety classifier.
-
isRequiresAction
final Boolean isRequiresAction()
-
isRetriesExhausted
final Boolean isRetriesExhausted()
-
isBudgetReached
final Boolean isBudgetReached()
-
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 repeated errors exhausted the retry budget or an error escalated to
retry_status: 'exhausted'.
-
asBudgetReached
final BetaManagedAgentsSessionBudgetReached asBudgetReached()
The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.
-
asRefusal
final BetaManagedAgentsSessionRefusal asRefusal()
The turn ended because the model's response was refused, for example by a safety classifier.
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionStatusIdleEvent.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 BetaManagedAgentsSessionStatusIdleEvent.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 BetaManagedAgentsSessionStatusIdleEvent.StopReason ofEndTurn(BetaManagedAgentsSessionEndTurn endTurn)
The agent completed its turn naturally and is ready for the next user message.
-
ofRequiresAction
final static BetaManagedAgentsSessionStatusIdleEvent.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.
-
ofRequiresAction
final static BetaManagedAgentsSessionStatusIdleEvent.StopReason ofRequiresAction(List<String> eventIds)
Returns an immutable instance of StopReason whose ofRequiresAction variant is built from the given required eventIds.
-
ofRetriesExhausted
final static BetaManagedAgentsSessionStatusIdleEvent.StopReason ofRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)
The turn ended because repeated errors exhausted the retry budget or an error escalated to
retry_status: 'exhausted'.
-
ofBudgetReached
final static BetaManagedAgentsSessionStatusIdleEvent.StopReason ofBudgetReached(BetaManagedAgentsSessionBudgetReached budgetReached)
The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.
-
ofRefusal
final static BetaManagedAgentsSessionStatusIdleEvent.StopReason ofRefusal(BetaManagedAgentsSessionRefusal refusal)
The turn ended because the model's response was refused, for example by a safety classifier.
-
-
-
-