Package com.google.genai.gaos
Class InteractionContinuation
java.lang.Object
com.google.genai.gaos.InteractionContinuation
Automatic continuation for
interactions.create().
Hand-written (not generated). Every create entry point of Interactions, AsyncInteractions and their request builders delegates here. It mirrors the Python SDK's
_interactions_continuation.py: a unary loop that follows requires_continuation hops and
merges them into one Interaction, a streaming wrapper (ContinuationEventStream)
that yields every hop's events in order and resumes from checkpoints, and a whole-call deadline.
Behavior summary (see Interactions.create(CreateInteractionRequest, Options)):
automaticContinuationdefaults totrue. It is a no-op forbackground=trueand for agent interactions, whose loops are managed by the server.- Continuation hops send
continuation_token; withstoreenabled (the default) they also send the hop that issued the token asprevious_interaction_idand omitinput; withstore=falsethe originalinputis resent. - A failure after progress throws
ContinuationInterruptedException(cause attached) carrying the token to resume from; a first-hop failure throws the underlying error.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe per-calltimeoutran out before automatic continuation finished. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum consecutive reconnects after a mid-hop disconnect that made no progress (no new checkpoint token since the hop's start token). -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateInteractionResponsecreate(SDKConfiguration sdkConfiguration, CreateInteractionRequest request, Options options, Headers headers) Runs a synchronouscreatewith automatic continuation.createAsync(SDKConfiguration sdkConfiguration, CreateInteractionRequest request, Options options, Headers headers) Runs an asynchronouscreatewith automatic continuation.
-
Field Details
-
MAX_STREAM_RECONNECTS_WITHOUT_PROGRESS
public static final int MAX_STREAM_RECONNECTS_WITHOUT_PROGRESSMaximum consecutive reconnects after a mid-hop disconnect that made no progress (no new checkpoint token since the hop's start token).- See Also:
-
-
Method Details
-
create
public static CreateInteractionResponse create(SDKConfiguration sdkConfiguration, CreateInteractionRequest request, @Nullable Options options, Headers headers) Runs a synchronouscreatewith automatic continuation.- Throws:
IllegalArgumentException- ifautomaticContinuation=falseis combined withbackground=true(before any request is sent)
-
createAsync
public static CompletableFuture<EventStream<InteractionSSEStreamEvent>> createAsync(SDKConfiguration sdkConfiguration, CreateInteractionRequest request, @Nullable Options options, Headers headers) Runs an asynchronouscreatewith automatic continuation.The generated async surface exposes the response as a blocking
EventStream(it is meant forstream=true); continuation hops are fetched on the thread iterating it.- Throws:
IllegalArgumentException- ifautomaticContinuation=falseis combined withbackground=true(before any request is sent)
-