Interface BedrockRuntimeClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface BedrockRuntimeClient extends AwsClient
Service client for accessing Amazon Bedrock Runtime. This can be created using the staticbuilder()method.Describes the API operations for running inference using Bedrock models.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.static StringSERVICE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static BedrockRuntimeClientBuilderbuilder()Create a builder that can be used to configure and create aBedrockRuntimeClient.static BedrockRuntimeClientcreate()Create aBedrockRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default InvokeModelResponseinvokeModel(Consumer<InvokeModelRequest.Builder> invokeModelRequest)Invokes the specified Bedrock model to run inference using the input provided in the request body.default InvokeModelResponseinvokeModel(InvokeModelRequest invokeModelRequest)Invokes the specified Bedrock model to run inference using the input provided in the request body.default BedrockRuntimeServiceClientConfigurationserviceClientConfiguration()static ServiceMetadataserviceMetadata()-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
SERVICE_METADATA_ID
static final String SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
- Constant Field Values
-
-
Method Detail
-
invokeModel
default InvokeModelResponse invokeModel(InvokeModelRequest invokeModelRequest) throws AccessDeniedException, ResourceNotFoundException, ThrottlingException, ModelTimeoutException, InternalServerException, ValidationException, ModelNotReadyException, ServiceQuotaExceededException, ModelErrorException, AwsServiceException, SdkClientException, BedrockRuntimeException
Invokes 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).
- Parameters:
invokeModelRequest-- Returns:
- Result of the InvokeModel operation returned by the service.
- Throws:
AccessDeniedException- The request is denied because of missing access permissions.ResourceNotFoundException- The specified resource ARN was not found. Check the ARN and try your request again.ThrottlingException- The number of requests exceeds the limit. Resubmit your request later.ModelTimeoutException- The request took too long to process. Processing time exceeded the model timeout length.InternalServerException- An internal server error occurred. Retry your request.ValidationException- Input validation failed. Check your request parameters and retry the request.ModelNotReadyException- The model specified in the request is not ready to serve inference requests.ServiceQuotaExceededException- The number of requests exceeds the service quota. Resubmit your request later.ModelErrorException- The request failed due to an error while processing the model.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.BedrockRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
invokeModel
default InvokeModelResponse invokeModel(Consumer<InvokeModelRequest.Builder> invokeModelRequest) throws AccessDeniedException, ResourceNotFoundException, ThrottlingException, ModelTimeoutException, InternalServerException, ValidationException, ModelNotReadyException, ServiceQuotaExceededException, ModelErrorException, AwsServiceException, SdkClientException, BedrockRuntimeException
Invokes 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).
This is a convenience which creates an instance of the
InvokeModelRequest.Builderavoiding the need to create one manually viaInvokeModelRequest.builder()- Parameters:
invokeModelRequest- AConsumerthat will call methods onInvokeModelRequest.Builderto create a request.- Returns:
- Result of the InvokeModel operation returned by the service.
- Throws:
AccessDeniedException- The request is denied because of missing access permissions.ResourceNotFoundException- The specified resource ARN was not found. Check the ARN and try your request again.ThrottlingException- The number of requests exceeds the limit. Resubmit your request later.ModelTimeoutException- The request took too long to process. Processing time exceeded the model timeout length.InternalServerException- An internal server error occurred. Retry your request.ValidationException- Input validation failed. Check your request parameters and retry the request.ModelNotReadyException- The model specified in the request is not ready to serve inference requests.ServiceQuotaExceededException- The number of requests exceeds the service quota. Resubmit your request later.ModelErrorException- The request failed due to an error while processing the model.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.BedrockRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
create
static BedrockRuntimeClient create()
Create aBedrockRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static BedrockRuntimeClientBuilder builder()
Create a builder that can be used to configure and create aBedrockRuntimeClient.
-
serviceMetadata
static ServiceMetadata serviceMetadata()
-
serviceClientConfiguration
default BedrockRuntimeServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
-