Package com.google.genai.gaos
Class AsyncInteractions
java.lang.Object
com.google.genai.gaos.AsyncInteractions
-
Method Summary
Modifier and TypeMethodDescriptioncancel()Canceling an interactionCanceling an interactionCanceling an interactioncreate()Creating an interactionCreating an interactioncreate(String apiVersion, CreateInteractionRequestBody body, Options options) Creating an interactiondelete()Deleting an interactionDeleting an interactionDeleting an interactionget()Retrieving an interactionget(GetInteractionByIdRequest request) Retrieving an interactionget(GetInteractionByIdRequest request, Options options) Retrieving an interactionsync()Switches to the sync SDK.
-
Method Details
-
sync
Switches to the sync SDK.- Returns:
- The sync SDK
-
create
Creating an interactionCreates a new interaction.
- Returns:
- The async call builder
-
create
public CompletableFuture<EventStream<InteractionSSEStreamEvent>> create(@Nonnull CreateInteractionRequestBody body) Creating an interactionCreates 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) Creating an interactionCreates a new interaction.
- Parameters:
apiVersion- Which version of the API to use.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
Deleting an interactionDeletes the interaction by id.
- Returns:
- The async call builder
-
delete
Deleting an interactionDeletes the interaction by id.
- Parameters:
id- The unique identifier 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) Deleting an interactionDeletes the interaction by id.
- Parameters:
apiVersion- Which version of the API to use.id- The unique identifier of the interaction to delete.options- additional options- Returns:
CompletableFuture<DeleteInteractionResponse>- The async response
-
get
Retrieving an interactionRetrieves 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) Retrieving an interactionRetrieves 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) Retrieving an interactionRetrieves 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
Canceling an interactionCancels an interaction by id. This only applies to background interactions that are still running.
- Returns:
- The async call builder
-
cancel
Canceling an interactionCancels an interaction by id. This only applies to background interactions that are still running.
- Parameters:
id- The unique identifier 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) Canceling an interactionCancels an interaction by id. This only applies to background interactions that are still running.
- Parameters:
apiVersion- Which version of the API to use.id- The unique identifier of the interaction to cancel.options- additional options- Returns:
CompletableFuture<CancelInteractionByIdResponse>- The async response
-