@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 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 Bedrock model to run inference using the input provided in the request body.
|
Future<InvokeModelResult> |
invokeModelAsync(InvokeModelRequest request,
AsyncHandler<InvokeModelRequest,InvokeModelResult> asyncHandler)
Invokes the specified Bedrock model to run inference using the input 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 Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.
For more information, see Run inference in the Bedrock User Guide.
For example requests, see Examples (after the Errors section).
invokeModelAsync in interface AmazonBedrockRuntimeAsyncpublic Future<InvokeModelResult> invokeModelAsync(InvokeModelRequest request, AsyncHandler<InvokeModelRequest,InvokeModelResult> asyncHandler)
AmazonBedrockRuntimeAsyncInvokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.
For more information, see Run inference in the Bedrock User Guide.
For example requests, see Examples (after the Errors section).
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