Interface BetaManagedAgentsSessionStatusIdleEvent.StopReason.Visitor
-
- All Implemented Interfaces:
public interface BetaManagedAgentsSessionStatusIdleEvent.StopReason.Visitor<T extends Object>An interface that defines how to map each variant of StopReason to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitEndTurn(BetaManagedAgentsSessionEndTurn endTurn)The agent completed its turn naturally and is ready for the next user message. abstract TvisitRequiresAction(BetaManagedAgentsSessionRequiresAction requiresAction)The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). abstract TvisitRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)The turn ended because repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.abstract TvisitBudgetReached(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). abstract TvisitRefusal(BetaManagedAgentsSessionRefusal refusal)The turn ended because the model's response was refused, for example by a safety classifier. Tunknown(JsonValue json)Maps an unknown variant of StopReason to a value of type T. -
-
Method Detail
-
visitEndTurn
abstract T visitEndTurn(BetaManagedAgentsSessionEndTurn endTurn)
The agent completed its turn naturally and is ready for the next user message.
-
visitRequiresAction
abstract T visitRequiresAction(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.
-
visitRetriesExhausted
abstract T visitRetriesExhausted(BetaManagedAgentsSessionRetriesExhausted retriesExhausted)
The turn ended because repeated errors exhausted the retry budget or an error escalated to
retry_status: 'exhausted'.
-
visitBudgetReached
abstract T visitBudgetReached(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.
-
visitRefusal
abstract T visitRefusal(BetaManagedAgentsSessionRefusal refusal)
The turn ended because the model's response was refused, for example by a safety classifier.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of StopReason to a value of type T.
An instance of StopReason can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-