Class ContinuationInterruptedException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.genai.gaos.models.errors.ContinuationInterruptedException
All Implemented Interfaces:
Serializable

public class ContinuationInterruptedException extends RuntimeException
Thrown when Interactions automatic continuation fails after progress.

interactions.create() with automatic continuation enabled (the default) may make several requests ("hops"), each one resuming the decode from the previous hop's continuation_token. If a hop fails after the server already produced (and billed) output in an earlier hop, or after a resumable checkpoint was reached, this exception is thrown instead of the underlying error so the work is not lost. The underlying error is Throwable.getCause().

To resume, pass continuationToken() as continuation_token to interactions.create(): with store enabled (the default), also pass interactionId() as previous_interaction_id and no input; with store=false, resend the original input.

See Also:
  • Constructor Details

    • ContinuationInterruptedException

      public ContinuationInterruptedException(String message, @Nullable Throwable cause, @Nullable Interaction partialInteraction, @Nullable String continuationToken, @Nullable String interactionId, @Nullable List<String> continuationIds)
  • Method Details

    • partialInteraction

      public Optional<Interaction> partialInteraction()
      For unary calls, the interaction merged from the hops that completed (status requires_continuation, with the resumable continuation_token). Always empty for streams, whose events were already yielded.
    • continuationToken

      public Optional<String> continuationToken()
      The latest resumable continuation_token. For streams this may be a mid-hop checkpoint: resuming from it re-generates any output yielded after the checkpoint.
    • interactionId

      public Optional<String> interactionId()
      The id of the interaction that issued continuationToken() (the value to send as previous_interaction_id), or empty if unknown or unstored (store=false).
    • continuationIds

      public List<String> continuationIds()
      The ids of every hop created during the call, in order.