Package com.google.genai.gaos
Class AsyncInteractions
java.lang.Object
com.google.genai.gaos.AsyncInteractions
-
Method Summary
Modifier and TypeMethodDescriptioncancel()Cancels an interaction by id.Cancels an interaction by id.Cancels an interaction by id.create()Creates a new interaction.Creates a new interaction.create(String apiVersion, CreateInteractionRequestBody body, Options options) Creates a new interaction.delete()Deletes the interaction by id.Deletes the interaction by id.Deletes the interaction by id.get()Retrieves the full details of a single interaction based on its `Interaction.id`.get(GetInteractionByIdRequest request) Retrieves the full details of a single interaction based on its `Interaction.id`.get(GetInteractionByIdRequest request, Options options) Retrieves the full details of a single interaction based on its `Interaction.id`.sync()Switches to the sync SDK.
-
Method Details
-
sync
Switches to the sync SDK.- Returns:
- The sync SDK
-
create
Creates a new interaction.- Returns:
- The async call builder
-
create
public CompletableFuture<EventStream<InteractionSSEStreamEvent>> create(@Nonnull CreateInteractionRequestBody body) Creates a new interaction.- Parameters:
body- The request body.- Returns:
CompletableFuture<EventStream<InteractionSSEStreamEvent>> - The async response
-
create
public CompletableFuture<EventStream<InteractionSSEStreamEvent>> create(@Nullable String apiVersion, @Nonnull CreateInteractionRequestBody body, @Nullable Options options) Creates a new interaction.- Parameters:
apiVersion- API version for request routing.body- The request body.options- additional options- Returns:
- A CompletableFuture that completes with a blocking event stream once response headers are received. Iterating the stream blocks the calling thread; close it after use.
-
delete
Deletes the interaction by id.- Returns:
- The async call builder
-
delete
Deletes the interaction by id.- Parameters:
id- Required. The name of the interaction to delete.- Returns:
CompletableFuture<DeleteInteractionResponse>- The async response
-
delete
public CompletableFuture<DeleteInteractionResponse> delete(@Nullable String apiVersion, @Nonnull String id, @Nullable Options options) Deletes the interaction by id.- Parameters:
apiVersion- API version for request routing.id- Required. The name of the interaction to delete.options- additional options- Returns:
CompletableFuture<DeleteInteractionResponse>- The async response
-
get
Retrieves the full details of a single interaction based on its `Interaction.id`.- Returns:
- The async call builder
-
get
public CompletableFuture<EventStream<InteractionSSEStreamEvent>> get(@Nonnull GetInteractionByIdRequest request) Retrieves the full details of a single interaction based on its `Interaction.id`.- Parameters:
request- The request object containing all the parameters for the API call.- Returns:
CompletableFuture<EventStream<InteractionSSEStreamEvent>> - The async response
-
get
public CompletableFuture<EventStream<InteractionSSEStreamEvent>> get(@Nonnull GetInteractionByIdRequest request, @Nullable Options options) Retrieves the full details of a single interaction based on its `Interaction.id`.- Parameters:
request- The request object containing all the parameters for the API call.options- additional options- Returns:
- A CompletableFuture that completes with a blocking event stream once response headers are received. Iterating the stream blocks the calling thread; close it after use.
-
cancel
Cancels an interaction by id. This only applies to background interactions that are still running.- Returns:
- The async call builder
-
cancel
Cancels an interaction by id. This only applies to background interactions that are still running.- Parameters:
id- Required. The name of the interaction to cancel.- Returns:
CompletableFuture<CancelInteractionByIdResponse>- The async response
-
cancel
public CompletableFuture<CancelInteractionByIdResponse> cancel(@Nullable String apiVersion, @Nonnull String id, @Nullable Options options) Cancels an interaction by id. This only applies to background interactions that are still running.- Parameters:
apiVersion- API version for request routing.id- Required. The name of the interaction to cancel.options- additional options- Returns:
CompletableFuture<CancelInteractionByIdResponse>- The async response
-