Package com.google.genkit.ai
Class ResumeOptions
java.lang.Object
com.google.genkit.ai.ResumeOptions
Options for resuming after an interrupt.
When generation is interrupted by a tool, you can resume by providing responses to the interrupted tool requests or by restarting them with new inputs.
Example usage:
// Respond to an interrupt
ResumeOptions resume = ResumeOptions.builder().respond(interrupt.respond("user confirmed")).build();
// Restart an interrupt with new input
ResumeOptions resume = ResumeOptions.builder().restart(interrupt.restart(null, newInput)).build();
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResumeOptions.Builderbuilder()Creates a new builder.Gets the tool responses for interrupted requests.Gets the tool requests to restart.voidsetRespond(List<ToolResponse> respond) Sets the tool responses for interrupted requests.voidsetRestart(List<ToolRequest> restart) Sets the tool requests to restart.
-
Constructor Details
-
ResumeOptions
public ResumeOptions()Default constructor.
-
-
Method Details
-
getRespond
Gets the tool responses for interrupted requests.- Returns:
- the tool responses
-
setRespond
Sets the tool responses for interrupted requests.- Parameters:
respond- the tool responses
-
getRestart
Gets the tool requests to restart.- Returns:
- the tool requests to restart
-
setRestart
Sets the tool requests to restart.- Parameters:
restart- the tool requests to restart
-
builder
Creates a new builder.- Returns:
- a new builder
-