@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonBedrockRuntimeAsyncClient extends AmazonBedrockRuntimeClient implements AmazonBedrockRuntimeAsync
AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Describes the API operations for running inference using Amazon Bedrock models.
LOGGING_AWS_REQUEST_METRICENDPOINT_PREFIX| Modifier and Type | Method and Description |
|---|---|
static AmazonBedrockRuntimeAsyncClientBuilder |
asyncBuilder() |
ExecutorService |
getExecutorService()
Returns the executor service used by this client to execute async requests.
|
Future<InvokeModelResult> |
invokeModelAsync(InvokeModelRequest request)
Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in
the request body.
|
Future<InvokeModelResult> |
invokeModelAsync(InvokeModelRequest request,
AsyncHandler<InvokeModelRequest,InvokeModelResult> asyncHandler)
Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in
the request body.
|
void |
shutdown()
Shuts down the client, releasing all managed resources.
|
builder, getCachedResponseMetadata, invokeModeladdRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffsetequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCachedResponseMetadata, invokeModelpublic static AmazonBedrockRuntimeAsyncClientBuilder asyncBuilder()
public ExecutorService getExecutorService()
public Future<InvokeModelResult> invokeModelAsync(InvokeModelRequest request)
AmazonBedrockRuntimeAsyncInvokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.
For example code, see Invoke model code examples in the Amazon Bedrock User Guide.
This operation requires permission for the bedrock:InvokeModel action.
invokeModelAsync in interface AmazonBedrockRuntimeAsyncpublic Future<InvokeModelResult> invokeModelAsync(InvokeModelRequest request, AsyncHandler<InvokeModelRequest,InvokeModelResult> asyncHandler)
AmazonBedrockRuntimeAsyncInvokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.
For example code, see Invoke model code examples in the Amazon Bedrock User Guide.
This operation requires permission for the bedrock:InvokeModel action.
invokeModelAsync in interface AmazonBedrockRuntimeAsyncasyncHandler - Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
implementation of the callback methods in this interface to receive notification of successful or
unsuccessful completion of the operation.public void shutdown()
getExecutorService().shutdown() followed by getExecutorService().awaitTermination() prior to
calling this method.shutdown in interface AmazonBedrockRuntimeshutdown in class AmazonBedrockRuntimeClient