Struct aws_sdk_bedrock::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Bedrock
Client for invoking operations on Amazon Bedrock. Each operation on Amazon Bedrock is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_bedrock::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_bedrock::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
Implementations§
source§impl Client
impl Client
sourcepub fn create_evaluation_job(&self) -> CreateEvaluationJobFluentBuilder
pub fn create_evaluation_job(&self) -> CreateEvaluationJobFluentBuilder
Constructs a fluent builder for the CreateEvaluationJob
operation.
- The fluent builder is configurable:
job_name(impl Into<String>)
/set_job_name(Option<String>)
:
required: trueThe name of the model evaluation job. Model evaluation job names must unique with your AWS account, and your account’s AWS region.
job_description(impl Into<String>)
/set_job_description(Option<String>)
:
required: falseA description of the model evaluation job.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. The service role must have Amazon Bedrock as the service principal, and provide access to any Amazon S3 buckets specified in the
EvaluationConfig
object. To pass this role to Amazon Bedrock, the caller of this API must have theiam:PassRole
permission. To learn more about the required permissions, see Required permissions.customer_encryption_key_id(impl Into<String>)
/set_customer_encryption_key_id(Option<String>)
:
required: falseSpecify your customer managed key ARN that will be used to encrypt your model evaluation job.
job_tags(Tag)
/set_job_tags(Option<Vec::<Tag>>)
:
required: falseTags to attach to the model evaluation job.
evaluation_config(EvaluationConfig)
/set_evaluation_config(Option<EvaluationConfig>)
:
required: trueSpecifies whether the model evaluation job is automatic or uses human worker.
inference_config(EvaluationInferenceConfig)
/set_inference_config(Option<EvaluationInferenceConfig>)
:
required: trueSpecify the models you want to use in your model evaluation job. Automatic model evaluation jobs support a single model, and model evaluation job that use human workers support two models.
output_data_config(EvaluationOutputDataConfig)
/set_output_data_config(Option<EvaluationOutputDataConfig>)
:
required: trueAn object that defines where the results of model evaluation job will be saved in Amazon S3.
- On success, responds with
CreateEvaluationJobOutput
with field(s):job_arn(String)
:The ARN of the model evaluation job.
- On failure, responds with
SdkError<CreateEvaluationJobError>
source§impl Client
impl Client
sourcepub fn create_guardrail(&self) -> CreateGuardrailFluentBuilder
pub fn create_guardrail(&self) -> CreateGuardrailFluentBuilder
Constructs a fluent builder for the CreateGuardrail
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name to give the guardrail.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description of the guardrail.
topic_policy_config(GuardrailTopicPolicyConfig)
/set_topic_policy_config(Option<GuardrailTopicPolicyConfig>)
:
required: falseThe topic policies to configure for the guardrail.
content_policy_config(GuardrailContentPolicyConfig)
/set_content_policy_config(Option<GuardrailContentPolicyConfig>)
:
required: falseThe content filter policies to configure for the guardrail.
word_policy_config(GuardrailWordPolicyConfig)
/set_word_policy_config(Option<GuardrailWordPolicyConfig>)
:
required: falseThe word policy you configure for the guardrail.
sensitive_information_policy_config(GuardrailSensitiveInformationPolicyConfig)
/set_sensitive_information_policy_config(Option<GuardrailSensitiveInformationPolicyConfig>)
:
required: falseThe sensitive information policy to configure for the guardrail.
blocked_input_messaging(impl Into<String>)
/set_blocked_input_messaging(Option<String>)
:
required: trueThe message to return when the guardrail blocks a prompt.
blocked_outputs_messaging(impl Into<String>)
/set_blocked_outputs_messaging(Option<String>)
:
required: trueThe message to return when the guardrail blocks a model response.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:
required: falseThe ARN of the KMS key that you use to encrypt the guardrail.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseThe tags that you want to attach to the guardrail.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency in the Amazon S3 User Guide.
- On success, responds with
CreateGuardrailOutput
with field(s):guardrail_id(String)
:The unique identifier of the guardrail that was created.
guardrail_arn(String)
:The ARN of the guardrail that was created.
version(String)
:The version of the guardrail that was created. This value should be 1.
created_at(DateTime)
:The time at which the guardrail was created.
- On failure, responds with
SdkError<CreateGuardrailError>
source§impl Client
impl Client
sourcepub fn create_guardrail_version(&self) -> CreateGuardrailVersionFluentBuilder
pub fn create_guardrail_version(&self) -> CreateGuardrailVersionFluentBuilder
Constructs a fluent builder for the CreateGuardrailVersion
operation.
- The fluent builder is configurable:
guardrail_identifier(impl Into<String>)
/set_guardrail_identifier(Option<String>)
:
required: trueThe unique identifier of the guardrail.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description of the guardrail version.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency in the Amazon S3 User Guide.
- On success, responds with
CreateGuardrailVersionOutput
with field(s):guardrail_id(String)
:The unique identifier of the guardrail.
version(String)
:The number of the version of the guardrail.
- On failure, responds with
SdkError<CreateGuardrailVersionError>
source§impl Client
impl Client
sourcepub fn create_model_customization_job(
&self
) -> CreateModelCustomizationJobFluentBuilder
pub fn create_model_customization_job( &self ) -> CreateModelCustomizationJobFluentBuilder
Constructs a fluent builder for the CreateModelCustomizationJob
operation.
- The fluent builder is configurable:
job_name(impl Into<String>)
/set_job_name(Option<String>)
:
required: trueA name for the fine-tuning job.
custom_model_name(impl Into<String>)
/set_custom_model_name(Option<String>)
:
required: trueA name for the resulting custom model.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the
iam:PassRole
permission.client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
base_model_identifier(impl Into<String>)
/set_base_model_identifier(Option<String>)
:
required: trueName of the base model.
customization_type(CustomizationType)
/set_customization_type(Option<CustomizationType>)
:
required: falseThe customization type.
custom_model_kms_key_id(impl Into<String>)
/set_custom_model_kms_key_id(Option<String>)
:
required: falseThe custom model is encrypted at rest using this key.
job_tags(Tag)
/set_job_tags(Option<Vec::<Tag>>)
:
required: falseTags to attach to the job.
custom_model_tags(Tag)
/set_custom_model_tags(Option<Vec::<Tag>>)
:
required: falseTags to attach to the resulting custom model.
training_data_config(TrainingDataConfig)
/set_training_data_config(Option<TrainingDataConfig>)
:
required: trueInformation about the training dataset.
validation_data_config(ValidationDataConfig)
/set_validation_data_config(Option<ValidationDataConfig>)
:
required: falseInformation about the validation dataset.
output_data_config(OutputDataConfig)
/set_output_data_config(Option<OutputDataConfig>)
:
required: trueS3 location for the output data.
hyper_parameters(impl Into<String>, impl Into<String>)
/set_hyper_parameters(Option<HashMap::<String, String>>)
:
required: trueParameters related to tuning the model. For details on the format for different models, see Custom model hyperparameters.
vpc_config(VpcConfig)
/set_vpc_config(Option<VpcConfig>)
:
required: falseVPC configuration (optional). Configuration parameters for the private Virtual Private Cloud (VPC) that contains the resources you are using for this job.
- On success, responds with
CreateModelCustomizationJobOutput
with field(s):job_arn(String)
:Amazon Resource Name (ARN) of the fine tuning job
- On failure, responds with
SdkError<CreateModelCustomizationJobError>
source§impl Client
impl Client
sourcepub fn create_provisioned_model_throughput(
&self
) -> CreateProvisionedModelThroughputFluentBuilder
pub fn create_provisioned_model_throughput( &self ) -> CreateProvisionedModelThroughputFluentBuilder
Constructs a fluent builder for the CreateProvisionedModelThroughput
operation.
- The fluent builder is configurable:
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency in the Amazon S3 User Guide.
model_units(i32)
/set_model_units(Option<i32>)
:
required: trueNumber of model units to allocate. A model unit delivers a specific throughput level for the specified model. The throughput level of a model unit specifies the total number of input and output tokens that it can process and generate within a span of one minute. By default, your account has no model units for purchasing Provisioned Throughputs with commitment. You must first visit the Amazon Web Services support center to request MUs.
For model unit quotas, see Provisioned Throughput quotas in the Amazon Bedrock User Guide.
For more information about what an MU specifies, contact your Amazon Web Services account manager.
provisioned_model_name(impl Into<String>)
/set_provisioned_model_name(Option<String>)
:
required: trueThe name for this Provisioned Throughput.
model_id(impl Into<String>)
/set_model_id(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) or name of the model to associate with this Provisioned Throughput. For a list of models for which you can purchase Provisioned Throughput, see Amazon Bedrock model IDs for purchasing Provisioned Throughput in the Amazon Bedrock User Guide.
commitment_duration(CommitmentDuration)
/set_commitment_duration(Option<CommitmentDuration>)
:
required: falseThe commitment duration requested for the Provisioned Throughput. Billing occurs hourly and is discounted for longer commitment terms. To request a no-commit Provisioned Throughput, omit this field.
Custom models support all levels of commitment. To see which base models support no commitment, see Supported regions and models for Provisioned Throughput in the Amazon Bedrock User Guide
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseTags to associate with this Provisioned Throughput.
- On success, responds with
CreateProvisionedModelThroughputOutput
with field(s):provisioned_model_arn(String)
:The Amazon Resource Name (ARN) for this Provisioned Throughput.
- On failure, responds with
SdkError<CreateProvisionedModelThroughputError>
source§impl Client
impl Client
sourcepub fn delete_custom_model(&self) -> DeleteCustomModelFluentBuilder
pub fn delete_custom_model(&self) -> DeleteCustomModelFluentBuilder
Constructs a fluent builder for the DeleteCustomModel
operation.
- The fluent builder is configurable:
model_identifier(impl Into<String>)
/set_model_identifier(Option<String>)
:
required: trueName of the model to delete.
- On success, responds with
DeleteCustomModelOutput
- On failure, responds with
SdkError<DeleteCustomModelError>
source§impl Client
impl Client
sourcepub fn delete_guardrail(&self) -> DeleteGuardrailFluentBuilder
pub fn delete_guardrail(&self) -> DeleteGuardrailFluentBuilder
Constructs a fluent builder for the DeleteGuardrail
operation.
- The fluent builder is configurable:
guardrail_identifier(impl Into<String>)
/set_guardrail_identifier(Option<String>)
:
required: trueThe unique identifier of the guardrail.
guardrail_version(impl Into<String>)
/set_guardrail_version(Option<String>)
:
required: falseThe version of the guardrail.
- On success, responds with
DeleteGuardrailOutput
- On failure, responds with
SdkError<DeleteGuardrailError>
source§impl Client
impl Client
sourcepub fn delete_model_invocation_logging_configuration(
&self
) -> DeleteModelInvocationLoggingConfigurationFluentBuilder
pub fn delete_model_invocation_logging_configuration( &self ) -> DeleteModelInvocationLoggingConfigurationFluentBuilder
Constructs a fluent builder for the DeleteModelInvocationLoggingConfiguration
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DeleteModelInvocationLoggingConfigurationOutput
- On failure, responds with
SdkError<DeleteModelInvocationLoggingConfigurationError>
source§impl Client
impl Client
sourcepub fn delete_provisioned_model_throughput(
&self
) -> DeleteProvisionedModelThroughputFluentBuilder
pub fn delete_provisioned_model_throughput( &self ) -> DeleteProvisionedModelThroughputFluentBuilder
Constructs a fluent builder for the DeleteProvisionedModelThroughput
operation.
- The fluent builder is configurable:
provisioned_model_id(impl Into<String>)
/set_provisioned_model_id(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) or name of the Provisioned Throughput.
- On success, responds with
DeleteProvisionedModelThroughputOutput
- On failure, responds with
SdkError<DeleteProvisionedModelThroughputError>
source§impl Client
impl Client
sourcepub fn get_custom_model(&self) -> GetCustomModelFluentBuilder
pub fn get_custom_model(&self) -> GetCustomModelFluentBuilder
Constructs a fluent builder for the GetCustomModel
operation.
- The fluent builder is configurable:
model_identifier(impl Into<String>)
/set_model_identifier(Option<String>)
:
required: trueName or Amazon Resource Name (ARN) of the custom model.
- On success, responds with
GetCustomModelOutput
with field(s):model_arn(String)
:Amazon Resource Name (ARN) associated with this model.
model_name(String)
:Model name associated with this model.
job_name(Option<String>)
:Job name associated with this model.
job_arn(String)
:Job Amazon Resource Name (ARN) associated with this model.
base_model_arn(String)
:Amazon Resource Name (ARN) of the base model.
customization_type(Option<CustomizationType>)
:The type of model customization.
model_kms_key_arn(Option<String>)
:The custom model is encrypted at rest using this key.
hyper_parameters(Option<HashMap::<String, String>>)
:Hyperparameter values associated with this model. For details on the format for different models, see Custom model hyperparameters.
training_data_config(Option<TrainingDataConfig>)
:Contains information about the training dataset.
validation_data_config(Option<ValidationDataConfig>)
:Contains information about the validation dataset.
output_data_config(Option<OutputDataConfig>)
:Output data configuration associated with this custom model.
training_metrics(Option<TrainingMetrics>)
:Contains training metrics from the job creation.
validation_metrics(Option<Vec::<ValidatorMetric>>)
:The validation metrics from the job creation.
creation_time(DateTime)
:Creation time of the model.
- On failure, responds with
SdkError<GetCustomModelError>
source§impl Client
impl Client
sourcepub fn get_evaluation_job(&self) -> GetEvaluationJobFluentBuilder
pub fn get_evaluation_job(&self) -> GetEvaluationJobFluentBuilder
Constructs a fluent builder for the GetEvaluationJob
operation.
- The fluent builder is configurable:
job_identifier(impl Into<String>)
/set_job_identifier(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the model evaluation job.
- On success, responds with
GetEvaluationJobOutput
with field(s):job_name(String)
:The name of the model evaluation job.
status(EvaluationJobStatus)
:The status of the model evaluation job.
job_arn(String)
:The Amazon Resource Name (ARN) of the model evaluation job.
job_description(Option<String>)
:The description of the model evaluation job.
role_arn(String)
:The Amazon Resource Name (ARN) of the IAM service role used in the model evaluation job.
customer_encryption_key_id(Option<String>)
:The Amazon Resource Name (ARN) of the customer managed key specified when the model evaluation job was created.
job_type(EvaluationJobType)
:The type of model evaluation job.
evaluation_config(Option<EvaluationConfig>)
:Contains details about the type of model evaluation job, the metrics used, the task type selected, the datasets used, and any custom metrics you defined.
inference_config(Option<EvaluationInferenceConfig>)
:Details about the models you specified in your model evaluation job.
output_data_config(Option<EvaluationOutputDataConfig>)
:Amazon S3 location for where output data is saved.
creation_time(DateTime)
:When the model evaluation job was created.
last_modified_time(Option<DateTime>)
:When the model evaluation job was last modified.
failure_messages(Option<Vec::<String>>)
:An array of strings the specify why the model evaluation job has failed.
- On failure, responds with
SdkError<GetEvaluationJobError>
source§impl Client
impl Client
sourcepub fn get_foundation_model(&self) -> GetFoundationModelFluentBuilder
pub fn get_foundation_model(&self) -> GetFoundationModelFluentBuilder
Constructs a fluent builder for the GetFoundationModel
operation.
- The fluent builder is configurable:
model_identifier(impl Into<String>)
/set_model_identifier(Option<String>)
:
required: trueThe model identifier.
- On success, responds with
GetFoundationModelOutput
with field(s):model_details(Option<FoundationModelDetails>)
:Information about the foundation model.
- On failure, responds with
SdkError<GetFoundationModelError>
source§impl Client
impl Client
sourcepub fn get_guardrail(&self) -> GetGuardrailFluentBuilder
pub fn get_guardrail(&self) -> GetGuardrailFluentBuilder
Constructs a fluent builder for the GetGuardrail
operation.
- The fluent builder is configurable:
guardrail_identifier(impl Into<String>)
/set_guardrail_identifier(Option<String>)
:
required: trueThe unique identifier of the guardrail for which to get details.
guardrail_version(impl Into<String>)
/set_guardrail_version(Option<String>)
:
required: falseThe version of the guardrail for which to get details. If you don’t specify a version, the response returns details for the
DRAFT
version.
- On success, responds with
GetGuardrailOutput
with field(s):name(String)
:The name of the guardrail.
description(Option<String>)
:The description of the guardrail.
guardrail_id(String)
:The unique identifier of the guardrail.
guardrail_arn(String)
:The ARN of the guardrail that was created.
version(String)
:The version of the guardrail.
status(GuardrailStatus)
:The status of the guardrail.
topic_policy(Option<GuardrailTopicPolicy>)
:The topic policy that was configured for the guardrail.
content_policy(Option<GuardrailContentPolicy>)
:The content policy that was configured for the guardrail.
word_policy(Option<GuardrailWordPolicy>)
:The word policy that was configured for the guardrail.
sensitive_information_policy(Option<GuardrailSensitiveInformationPolicy>)
:The sensitive information policy that was configured for the guardrail.
created_at(DateTime)
:The date and time at which the guardrail was created.
updated_at(DateTime)
:The date and time at which the guardrail was updated.
status_reasons(Option<Vec::<String>>)
:Appears if the
status
isFAILED
. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.failure_recommendations(Option<Vec::<String>>)
:Appears if the
status
of the guardrail isFAILED
. A list of recommendations to carry out before retrying the request.blocked_input_messaging(String)
:The message that the guardrail returns when it blocks a prompt.
blocked_outputs_messaging(String)
:The message that the guardrail returns when it blocks a model response.
kms_key_arn(Option<String>)
:The ARN of the KMS key that encrypts the guardrail.
- On failure, responds with
SdkError<GetGuardrailError>
source§impl Client
impl Client
sourcepub fn get_model_customization_job(
&self
) -> GetModelCustomizationJobFluentBuilder
pub fn get_model_customization_job( &self ) -> GetModelCustomizationJobFluentBuilder
Constructs a fluent builder for the GetModelCustomizationJob
operation.
- The fluent builder is configurable:
job_identifier(impl Into<String>)
/set_job_identifier(Option<String>)
:
required: trueIdentifier for the customization job.
- On success, responds with
GetModelCustomizationJobOutput
with field(s):job_arn(String)
:The Amazon Resource Name (ARN) of the customization job.
job_name(String)
:The name of the customization job.
output_model_name(String)
:The name of the output model.
output_model_arn(Option<String>)
:The Amazon Resource Name (ARN) of the output model.
client_request_token(Option<String>)
:The token that you specified in the
CreateCustomizationJob
request.role_arn(String)
:The Amazon Resource Name (ARN) of the IAM role.
status(Option<ModelCustomizationJobStatus>)
:The status of the job. A successful job transitions from in-progress to completed when the output model is ready to use. If the job failed, the failure message contains information about why the job failed.
failure_message(Option<String>)
:Information about why the job failed.
creation_time(DateTime)
:Time that the resource was created.
last_modified_time(Option<DateTime>)
:Time that the resource was last modified.
end_time(Option<DateTime>)
:Time that the resource transitioned to terminal state.
base_model_arn(String)
:Amazon Resource Name (ARN) of the base model.
hyper_parameters(HashMap::<String, String>)
:The hyperparameter values for the job. For details on the format for different models, see Custom model hyperparameters.
training_data_config(Option<TrainingDataConfig>)
:Contains information about the training dataset.
validation_data_config(Option<ValidationDataConfig>)
:Contains information about the validation dataset.
output_data_config(Option<OutputDataConfig>)
:Output data configuration
customization_type(Option<CustomizationType>)
:The type of model customization.
output_model_kms_key_arn(Option<String>)
:The custom model is encrypted at rest using this key.
training_metrics(Option<TrainingMetrics>)
:Contains training metrics from the job creation.
validation_metrics(Option<Vec::<ValidatorMetric>>)
:The loss metric for each validator that you provided in the createjob request.
vpc_config(Option<VpcConfig>)
:VPC configuration for the custom model job.
- On failure, responds with
SdkError<GetModelCustomizationJobError>
source§impl Client
impl Client
sourcepub fn get_model_invocation_logging_configuration(
&self
) -> GetModelInvocationLoggingConfigurationFluentBuilder
pub fn get_model_invocation_logging_configuration( &self ) -> GetModelInvocationLoggingConfigurationFluentBuilder
Constructs a fluent builder for the GetModelInvocationLoggingConfiguration
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetModelInvocationLoggingConfigurationOutput
with field(s):logging_config(Option<LoggingConfig>)
:The current configuration values.
- On failure, responds with
SdkError<GetModelInvocationLoggingConfigurationError>
source§impl Client
impl Client
sourcepub fn get_provisioned_model_throughput(
&self
) -> GetProvisionedModelThroughputFluentBuilder
pub fn get_provisioned_model_throughput( &self ) -> GetProvisionedModelThroughputFluentBuilder
Constructs a fluent builder for the GetProvisionedModelThroughput
operation.
- The fluent builder is configurable:
provisioned_model_id(impl Into<String>)
/set_provisioned_model_id(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) or name of the Provisioned Throughput.
- On success, responds with
GetProvisionedModelThroughputOutput
with field(s):model_units(i32)
:The number of model units allocated to this Provisioned Throughput.
desired_model_units(i32)
:The number of model units that was requested for this Provisioned Throughput.
provisioned_model_name(String)
:The name of the Provisioned Throughput.
provisioned_model_arn(String)
:The Amazon Resource Name (ARN) of the Provisioned Throughput.
model_arn(String)
:The Amazon Resource Name (ARN) of the model associated with this Provisioned Throughput.
desired_model_arn(String)
:The Amazon Resource Name (ARN) of the model requested to be associated to this Provisioned Throughput. This value differs from the
modelArn
if updating hasn’t completed.foundation_model_arn(String)
:The Amazon Resource Name (ARN) of the base model for which the Provisioned Throughput was created, or of the base model that the custom model for which the Provisioned Throughput was created was customized.
status(ProvisionedModelStatus)
:The status of the Provisioned Throughput.
creation_time(DateTime)
:The timestamp of the creation time for this Provisioned Throughput.
last_modified_time(DateTime)
:The timestamp of the last time that this Provisioned Throughput was modified.
failure_message(Option<String>)
:A failure message for any issues that occurred during creation, updating, or deletion of the Provisioned Throughput.
commitment_duration(Option<CommitmentDuration>)
:Commitment duration of the Provisioned Throughput.
commitment_expiration_time(Option<DateTime>)
:The timestamp for when the commitment term for the Provisioned Throughput expires.
- On failure, responds with
SdkError<GetProvisionedModelThroughputError>
source§impl Client
impl Client
sourcepub fn list_custom_models(&self) -> ListCustomModelsFluentBuilder
pub fn list_custom_models(&self) -> ListCustomModelsFluentBuilder
Constructs a fluent builder for the ListCustomModels
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
creation_time_before(DateTime)
/set_creation_time_before(Option<DateTime>)
:
required: falseReturn custom models created before the specified time.
creation_time_after(DateTime)
/set_creation_time_after(Option<DateTime>)
:
required: falseReturn custom models created after the specified time.
name_contains(impl Into<String>)
/set_name_contains(Option<String>)
:
required: falseReturn custom models only if the job name contains these characters.
base_model_arn_equals(impl Into<String>)
/set_base_model_arn_equals(Option<String>)
:
required: falseReturn custom models only if the base model Amazon Resource Name (ARN) matches this parameter.
foundation_model_arn_equals(impl Into<String>)
/set_foundation_model_arn_equals(Option<String>)
:
required: falseReturn custom models only if the foundation model Amazon Resource Name (ARN) matches this parameter.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseMaximum number of results to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseContinuation token from the previous response, for Amazon Bedrock to list the next set of results.
sort_by(SortModelsBy)
/set_sort_by(Option<SortModelsBy>)
:
required: falseThe field to sort by in the returned list of models.
sort_order(SortOrder)
/set_sort_order(Option<SortOrder>)
:
required: falseThe sort order of the results.
- On success, responds with
ListCustomModelsOutput
with field(s):next_token(Option<String>)
:Continuation token for the next request to list the next set of results.
model_summaries(Option<Vec::<CustomModelSummary>>)
:Model summaries.
- On failure, responds with
SdkError<ListCustomModelsError>
source§impl Client
impl Client
sourcepub fn list_evaluation_jobs(&self) -> ListEvaluationJobsFluentBuilder
pub fn list_evaluation_jobs(&self) -> ListEvaluationJobsFluentBuilder
Constructs a fluent builder for the ListEvaluationJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
creation_time_after(DateTime)
/set_creation_time_after(Option<DateTime>)
:
required: falseA filter that includes model evaluation jobs created after the time specified.
creation_time_before(DateTime)
/set_creation_time_before(Option<DateTime>)
:
required: falseA filter that includes model evaluation jobs created prior to the time specified.
status_equals(EvaluationJobStatus)
/set_status_equals(Option<EvaluationJobStatus>)
:
required: falseOnly return jobs where the status condition is met.
name_contains(impl Into<String>)
/set_name_contains(Option<String>)
:
required: falseQuery parameter string for model evaluation job names.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseContinuation token from the previous response, for Amazon Bedrock to list the next set of results.
sort_by(SortJobsBy)
/set_sort_by(Option<SortJobsBy>)
:
required: falseAllows you to sort model evaluation jobs by when they were created.
sort_order(SortOrder)
/set_sort_order(Option<SortOrder>)
:
required: falseHow you want the order of jobs sorted.
- On success, responds with
ListEvaluationJobsOutput
with field(s):next_token(Option<String>)
:Continuation token from the previous response, for Amazon Bedrock to list the next set of results.
job_summaries(Option<Vec::<EvaluationSummary>>)
:A summary of the model evaluation jobs.
- On failure, responds with
SdkError<ListEvaluationJobsError>
source§impl Client
impl Client
sourcepub fn list_foundation_models(&self) -> ListFoundationModelsFluentBuilder
pub fn list_foundation_models(&self) -> ListFoundationModelsFluentBuilder
Constructs a fluent builder for the ListFoundationModels
operation.
- The fluent builder is configurable:
by_provider(impl Into<String>)
/set_by_provider(Option<String>)
:
required: falseReturn models belonging to the model provider that you specify.
by_customization_type(ModelCustomization)
/set_by_customization_type(Option<ModelCustomization>)
:
required: falseReturn models that support the customization type that you specify. For more information, see Custom models in the Amazon Bedrock User Guide.
by_output_modality(ModelModality)
/set_by_output_modality(Option<ModelModality>)
:
required: falseReturn models that support the output modality that you specify.
by_inference_type(InferenceType)
/set_by_inference_type(Option<InferenceType>)
:
required: falseReturn models that support the inference type that you specify. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
- On success, responds with
ListFoundationModelsOutput
with field(s):model_summaries(Option<Vec::<FoundationModelSummary>>)
:A list of Amazon Bedrock foundation models.
- On failure, responds with
SdkError<ListFoundationModelsError>
source§impl Client
impl Client
sourcepub fn list_guardrails(&self) -> ListGuardrailsFluentBuilder
pub fn list_guardrails(&self) -> ListGuardrailsFluentBuilder
Constructs a fluent builder for the ListGuardrails
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
guardrail_identifier(impl Into<String>)
/set_guardrail_identifier(Option<String>)
:
required: falseThe unique identifier of the guardrail.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf there are more results than were returned in the response, the response returns a
nextToken
that you can send in anotherListGuardrails
request to see the next batch of results.
- On success, responds with
ListGuardrailsOutput
with field(s):guardrails(Vec::<GuardrailSummary>)
:A list of objects, each of which contains details about a guardrail.
next_token(Option<String>)
:If there are more results than were returned in the response, the response returns a
nextToken
that you can send in anotherListGuardrails
request to see the next batch of results.
- On failure, responds with
SdkError<ListGuardrailsError>
source§impl Client
impl Client
sourcepub fn list_model_customization_jobs(
&self
) -> ListModelCustomizationJobsFluentBuilder
pub fn list_model_customization_jobs( &self ) -> ListModelCustomizationJobsFluentBuilder
Constructs a fluent builder for the ListModelCustomizationJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
creation_time_after(DateTime)
/set_creation_time_after(Option<DateTime>)
:
required: falseReturn customization jobs created after the specified time.
creation_time_before(DateTime)
/set_creation_time_before(Option<DateTime>)
:
required: falseReturn customization jobs created before the specified time.
status_equals(FineTuningJobStatus)
/set_status_equals(Option<FineTuningJobStatus>)
:
required: falseReturn customization jobs with the specified status.
name_contains(impl Into<String>)
/set_name_contains(Option<String>)
:
required: falseReturn customization jobs only if the job name contains these characters.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseMaximum number of results to return in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseContinuation token from the previous response, for Amazon Bedrock to list the next set of results.
sort_by(SortJobsBy)
/set_sort_by(Option<SortJobsBy>)
:
required: falseThe field to sort by in the returned list of jobs.
sort_order(SortOrder)
/set_sort_order(Option<SortOrder>)
:
required: falseThe sort order of the results.
- On success, responds with
ListModelCustomizationJobsOutput
with field(s):next_token(Option<String>)
:Page continuation token to use in the next request.
model_customization_job_summaries(Option<Vec::<ModelCustomizationJobSummary>>)
:Job summaries.
- On failure, responds with
SdkError<ListModelCustomizationJobsError>
source§impl Client
impl Client
sourcepub fn list_provisioned_model_throughputs(
&self
) -> ListProvisionedModelThroughputsFluentBuilder
pub fn list_provisioned_model_throughputs( &self ) -> ListProvisionedModelThroughputsFluentBuilder
Constructs a fluent builder for the ListProvisionedModelThroughputs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
creation_time_after(DateTime)
/set_creation_time_after(Option<DateTime>)
:
required: falseA filter that returns Provisioned Throughputs created after the specified time.
creation_time_before(DateTime)
/set_creation_time_before(Option<DateTime>)
:
required: falseA filter that returns Provisioned Throughputs created before the specified time.
status_equals(ProvisionedModelStatus)
/set_status_equals(Option<ProvisionedModelStatus>)
:
required: falseA filter that returns Provisioned Throughputs if their statuses matches the value that you specify.
model_arn_equals(impl Into<String>)
/set_model_arn_equals(Option<String>)
:
required: falseA filter that returns Provisioned Throughputs whose model Amazon Resource Name (ARN) is equal to the value that you specify.
name_contains(impl Into<String>)
/set_name_contains(Option<String>)
:
required: falseA filter that returns Provisioned Throughputs if their name contains the expression that you specify.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseTHe maximum number of results to return in the response. If there are more results than the number you specified, the response returns a
nextToken
value. To see the next batch of results, send thenextToken
value in another list request.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf there are more results than the number you specified in the
maxResults
field, the response returns anextToken
value. To see the next batch of results, specify thenextToken
value in this field.sort_by(SortByProvisionedModels)
/set_sort_by(Option<SortByProvisionedModels>)
:
required: falseThe field by which to sort the returned list of Provisioned Throughputs.
sort_order(SortOrder)
/set_sort_order(Option<SortOrder>)
:
required: falseThe sort order of the results.
- On success, responds with
ListProvisionedModelThroughputsOutput
with field(s):next_token(Option<String>)
:If there are more results than the number you specified in the
maxResults
field, this value is returned. To see the next batch of results, include this value in thenextToken
field in another list request.provisioned_model_summaries(Option<Vec::<ProvisionedModelSummary>>)
:A list of summaries, one for each Provisioned Throughput in the response.
- On failure, responds with
SdkError<ListProvisionedModelThroughputsError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:An array of the tags associated with this resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn put_model_invocation_logging_configuration(
&self
) -> PutModelInvocationLoggingConfigurationFluentBuilder
pub fn put_model_invocation_logging_configuration( &self ) -> PutModelInvocationLoggingConfigurationFluentBuilder
Constructs a fluent builder for the PutModelInvocationLoggingConfiguration
operation.
- The fluent builder is configurable:
logging_config(LoggingConfig)
/set_logging_config(Option<LoggingConfig>)
:
required: trueThe logging configuration values to set.
- On success, responds with
PutModelInvocationLoggingConfigurationOutput
- On failure, responds with
SdkError<PutModelInvocationLoggingConfigurationError>
source§impl Client
impl Client
sourcepub fn stop_evaluation_job(&self) -> StopEvaluationJobFluentBuilder
pub fn stop_evaluation_job(&self) -> StopEvaluationJobFluentBuilder
Constructs a fluent builder for the StopEvaluationJob
operation.
- The fluent builder is configurable:
job_identifier(impl Into<String>)
/set_job_identifier(Option<String>)
:
required: trueThe ARN of the model evaluation job you want to stop.
- On success, responds with
StopEvaluationJobOutput
- On failure, responds with
SdkError<StopEvaluationJobError>
source§impl Client
impl Client
sourcepub fn stop_model_customization_job(
&self
) -> StopModelCustomizationJobFluentBuilder
pub fn stop_model_customization_job( &self ) -> StopModelCustomizationJobFluentBuilder
Constructs a fluent builder for the StopModelCustomizationJob
operation.
- The fluent builder is configurable:
job_identifier(impl Into<String>)
/set_job_identifier(Option<String>)
:
required: trueJob identifier of the job to stop.
- On success, responds with
StopModelCustomizationJobOutput
- On failure, responds with
SdkError<StopModelCustomizationJobError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to tag.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueTags to associate with the resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to untag.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueTag keys of the tags to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_guardrail(&self) -> UpdateGuardrailFluentBuilder
pub fn update_guardrail(&self) -> UpdateGuardrailFluentBuilder
Constructs a fluent builder for the UpdateGuardrail
operation.
- The fluent builder is configurable:
guardrail_identifier(impl Into<String>)
/set_guardrail_identifier(Option<String>)
:
required: trueThe unique identifier of the guardrail
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueA name for the guardrail.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description of the guardrail.
topic_policy_config(GuardrailTopicPolicyConfig)
/set_topic_policy_config(Option<GuardrailTopicPolicyConfig>)
:
required: falseThe topic policy to configure for the guardrail.
content_policy_config(GuardrailContentPolicyConfig)
/set_content_policy_config(Option<GuardrailContentPolicyConfig>)
:
required: falseThe content policy to configure for the guardrail.
word_policy_config(GuardrailWordPolicyConfig)
/set_word_policy_config(Option<GuardrailWordPolicyConfig>)
:
required: falseThe word policy to configure for the guardrail.
sensitive_information_policy_config(GuardrailSensitiveInformationPolicyConfig)
/set_sensitive_information_policy_config(Option<GuardrailSensitiveInformationPolicyConfig>)
:
required: falseThe sensitive information policy to configure for the guardrail.
blocked_input_messaging(impl Into<String>)
/set_blocked_input_messaging(Option<String>)
:
required: trueThe message to return when the guardrail blocks a prompt.
blocked_outputs_messaging(impl Into<String>)
/set_blocked_outputs_messaging(Option<String>)
:
required: trueThe message to return when the guardrail blocks a model response.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:
required: falseThe ARN of the KMS key with which to encrypt the guardrail.
- On success, responds with
UpdateGuardrailOutput
with field(s):guardrail_id(String)
:The unique identifier of the guardrail
guardrail_arn(String)
:The ARN of the guardrail that was created.
version(String)
:The version of the guardrail.
updated_at(DateTime)
:The date and time at which the guardrail was updated.
- On failure, responds with
SdkError<UpdateGuardrailError>
source§impl Client
impl Client
sourcepub fn update_provisioned_model_throughput(
&self
) -> UpdateProvisionedModelThroughputFluentBuilder
pub fn update_provisioned_model_throughput( &self ) -> UpdateProvisionedModelThroughputFluentBuilder
Constructs a fluent builder for the UpdateProvisionedModelThroughput
operation.
- The fluent builder is configurable:
provisioned_model_id(impl Into<String>)
/set_provisioned_model_id(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) or name of the Provisioned Throughput to update.
desired_provisioned_model_name(impl Into<String>)
/set_desired_provisioned_model_name(Option<String>)
:
required: falseThe new name for this Provisioned Throughput.
desired_model_id(impl Into<String>)
/set_desired_model_id(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the new model to associate with this Provisioned Throughput. You can’t specify this field if this Provisioned Throughput is associated with a base model.
If this Provisioned Throughput is associated with a custom model, you can specify one of the following options:
-
The base model from which the custom model was customized.
-
Another custom model that was customized from the same base model as the custom model.
-
- On success, responds with
UpdateProvisionedModelThroughputOutput
- On failure, responds with
SdkError<UpdateProvisionedModelThroughputError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more