@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_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AmazonBedrockRuntimeAsyncClientBuilder |
asyncBuilder() |
Future<ConverseResult> |
converseAsync(ConverseRequest request)
Sends messages to the specified Amazon Bedrock model.
|
Future<ConverseResult> |
converseAsync(ConverseRequest request,
AsyncHandler<ConverseRequest,ConverseResult> asyncHandler)
Sends messages to the specified Amazon Bedrock model.
|
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, converse, getCachedResponseMetadata, invokeModel
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
converse, getCachedResponseMetadata, invokeModel
public static AmazonBedrockRuntimeAsyncClientBuilder asyncBuilder()
public ExecutorService getExecutorService()
public Future<ConverseResult> converseAsync(ConverseRequest request)
AmazonBedrockRuntimeAsync
Sends messages to the specified Amazon Bedrock model. Converse
provides a consistent interface that
works with all models that support messages. This allows you to write code once and use it with different models.
Should a model have unique inference parameters, you can also pass those unique parameters to the model. For more
information, see Run
inference in the Bedrock User Guide.
This operation requires permission for the bedrock:InvokeModel
action.
converseAsync
in interface AmazonBedrockRuntimeAsync
public Future<ConverseResult> converseAsync(ConverseRequest request, AsyncHandler<ConverseRequest,ConverseResult> asyncHandler)
AmazonBedrockRuntimeAsync
Sends messages to the specified Amazon Bedrock model. Converse
provides a consistent interface that
works with all models that support messages. This allows you to write code once and use it with different models.
Should a model have unique inference parameters, you can also pass those unique parameters to the model. For more
information, see Run
inference in the Bedrock User Guide.
This operation requires permission for the bedrock:InvokeModel
action.
converseAsync
in interface AmazonBedrockRuntimeAsync
asyncHandler
- 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 Future<InvokeModelResult> invokeModelAsync(InvokeModelRequest request)
AmazonBedrockRuntimeAsync
Invokes 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 AmazonBedrockRuntimeAsync
public Future<InvokeModelResult> invokeModelAsync(InvokeModelRequest request, AsyncHandler<InvokeModelRequest,InvokeModelResult> asyncHandler)
AmazonBedrockRuntimeAsync
Invokes 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 AmazonBedrockRuntimeAsync
asyncHandler
- 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 AmazonBedrockRuntime
shutdown
in class AmazonBedrockRuntimeClient