View Source AWS.Bedrock (aws-elixir v1.0.2)

Describes the API operations for creating, managing, fine-turning, and evaluating Amazon Bedrock models.

Link to this section Summary

Functions

API operation for creating and managing Amazon Bedrock automatic model evaluation jobs and model evaluation jobs that use human workers.

Creates a guardrail to block topics and to filter out harmful content.

Creates a fine-tuning job to customize a base model.

Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify.

Deletes a custom model that you created earlier.

Get the properties associated with a Amazon Bedrock custom model that you have created.For more information, see Custom models in the Amazon Bedrock User Guide.

Retrieves the properties associated with a model evaluation job, including the status of the job.

Get details about a Amazon Bedrock foundation model.

Retrieves the properties associated with a model-customization job, including the status of the job.

Get the current configuration values for model invocation logging.

List the tags associated with the specified resource.

Set the configuration values for model invocation logging.

Stops an in progress model evaluation job.

Associate tags with a resource.

Remove one or more tags from a resource.

Updates a guardrail with the values you specify.

Updates the name or associated model for a Provisioned Throughput.

Link to this section Functions

Link to this function

create_evaluation_job(client, input, options \\ [])

View Source

API operation for creating and managing Amazon Bedrock automatic model evaluation jobs and model evaluation jobs that use human workers.

To learn more about the requirements for creating a model evaluation job see, Model evaluations.

Link to this function

create_guardrail(client, input, options \\ [])

View Source

Creates a guardrail to block topics and to filter out harmful content.

* Specify a name and optional description.

* Specify messages for when the guardrail successfully blocks a prompt or a model response in the blockedInputMessaging and blockedOutputsMessaging fields.

* Specify topics for the guardrail to deny in the topicPolicyConfig object. Each GuardrailTopicConfig object in the topicsConfig list pertains to one topic.

*

Give a name and description so that the guardrail can properly identify the topic.

*

Specify DENY in the type field.

*

(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the examples list.

* Specify filter strengths for the harmful categories defined in Amazon Bedrock in the contentPolicyConfig object. Each GuardrailContentFilterConfig object in the filtersConfig list pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig.

*

Specify the category in the type field.

*

Specify the strength of the filter for prompts in the inputStrength field and for model responses in the strength field of the GuardrailContentFilterConfig.

* (Optional) For security, include the ARN of a KMS key in the kmsKeyId field.

* (Optional) Attach any tags to the guardrail in the tags object. For more information, see Tag resources.

Link to this function

create_guardrail_version(client, guardrail_identifier, input, options \\ [])

View Source

Creates a version of the guardrail.

Use this API to create a snapshot of the guardrail when you are satisfied with a configuration, or to compare the configuration with another version.

Link to this function

create_model_customization_job(client, input, options \\ [])

View Source

Creates a fine-tuning job to customize a base model.

You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes.

For information on the format of training and validation data, see Prepare the datasets.

Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the GetModelCustomizationJob operation to retrieve the job status.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

create_provisioned_model_throughput(client, input, options \\ [])

View Source

Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify.

For pricing details, see Amazon Bedrock Pricing. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.

Link to this function

delete_custom_model(client, model_identifier, input, options \\ [])

View Source

Deletes a custom model that you created earlier.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

delete_guardrail(client, guardrail_identifier, input, options \\ [])

View Source

Deletes a guardrail.

* To delete a guardrail, only specify the ARN of the guardrail in the guardrailIdentifier field. If you delete a guardrail, all of its versions will be deleted.

* To delete a version of a guardrail, specify the ARN of the guardrail in the guardrailIdentifier field and the version in the guardrailVersion field.

Link to this function

delete_model_invocation_logging_configuration(client, input, options \\ [])

View Source

Delete the invocation logging.

Link to this function

delete_provisioned_model_throughput(client, provisioned_model_id, input, options \\ [])

View Source

Deletes a Provisioned Throughput.

You can't delete a Provisioned Throughput before the commitment term is over. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.

Link to this function

get_custom_model(client, model_identifier, options \\ [])

View Source

Get the properties associated with a Amazon Bedrock custom model that you have created.For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

get_evaluation_job(client, job_identifier, options \\ [])

View Source

Retrieves the properties associated with a model evaluation job, including the status of the job.

For more information, see Model evaluations.

Link to this function

get_foundation_model(client, model_identifier, options \\ [])

View Source

Get details about a Amazon Bedrock foundation model.

Link to this function

get_guardrail(client, guardrail_identifier, guardrail_version \\ nil, options \\ [])

View Source

Gets details about a guardrail.

If you don't specify a version, the response returns details for the DRAFT version.

Link to this function

get_model_customization_job(client, job_identifier, options \\ [])

View Source

Retrieves the properties associated with a model-customization job, including the status of the job.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

get_model_invocation_logging_configuration(client, options \\ [])

View Source

Get the current configuration values for model invocation logging.

Link to this function

get_provisioned_model_throughput(client, provisioned_model_id, options \\ [])

View Source

Returns details for a Provisioned Throughput.

For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.

Link to this function

list_custom_models(client, base_model_arn_equals \\ nil, creation_time_after \\ nil, creation_time_before \\ nil, foundation_model_arn_equals \\ nil, max_results \\ nil, name_contains \\ nil, next_token \\ nil, sort_by \\ nil, sort_order \\ nil, options \\ [])

View Source

Returns a list of the custom models that you have created with the CreateModelCustomizationJob operation.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

list_evaluation_jobs(client, creation_time_after \\ nil, creation_time_before \\ nil, max_results \\ nil, name_contains \\ nil, next_token \\ nil, sort_by \\ nil, sort_order \\ nil, status_equals \\ nil, options \\ [])

View Source

Lists model evaluation jobs.

Link to this function

list_foundation_models(client, by_customization_type \\ nil, by_inference_type \\ nil, by_output_modality \\ nil, by_provider \\ nil, options \\ [])

View Source

Lists Amazon Bedrock foundation models that you can use.

You can filter the results with the request parameters. For more information, see Foundation models in the Amazon Bedrock User Guide.

Link to this function

list_guardrails(client, guardrail_identifier \\ nil, max_results \\ nil, next_token \\ nil, options \\ [])

View Source

Lists details about all the guardrails in an account.

To list the DRAFT version of all your guardrails, don't specify the guardrailIdentifier field. To list all versions of a guardrail, specify the ARN of the guardrail in the guardrailIdentifier field.

You can set the maximum number of results to return in a response in the maxResults field. If there are more results than the number you set, the response returns a nextToken that you can send in another ListGuardrails request to see the next batch of results.

Link to this function

list_model_customization_jobs(client, creation_time_after \\ nil, creation_time_before \\ nil, max_results \\ nil, name_contains \\ nil, next_token \\ nil, sort_by \\ nil, sort_order \\ nil, status_equals \\ nil, options \\ [])

View Source

Returns a list of model customization jobs that you have submitted.

You can filter the jobs to return based on one or more criteria.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

list_provisioned_model_throughputs(client, creation_time_after \\ nil, creation_time_before \\ nil, max_results \\ nil, model_arn_equals \\ nil, name_contains \\ nil, next_token \\ nil, sort_by \\ nil, sort_order \\ nil, status_equals \\ nil, options \\ [])

View Source

Lists the Provisioned Throughputs in the account.

For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.

Link to this function

list_tags_for_resource(client, input, options \\ [])

View Source

List the tags associated with the specified resource.

For more information, see Tagging resources in the Amazon Bedrock User Guide.

Link to this function

put_model_invocation_logging_configuration(client, input, options \\ [])

View Source

Set the configuration values for model invocation logging.

Link to this function

stop_evaluation_job(client, job_identifier, input, options \\ [])

View Source

Stops an in progress model evaluation job.

Link to this function

stop_model_customization_job(client, job_identifier, input, options \\ [])

View Source

Stops an active model customization job.

For more information, see Custom models in the Amazon Bedrock User Guide.

Link to this function

tag_resource(client, input, options \\ [])

View Source

Associate tags with a resource.

For more information, see Tagging resources in the Amazon Bedrock User Guide.

Link to this function

untag_resource(client, input, options \\ [])

View Source

Remove one or more tags from a resource.

For more information, see Tagging resources in the Amazon Bedrock User Guide.

Link to this function

update_guardrail(client, guardrail_identifier, input, options \\ [])

View Source

Updates a guardrail with the values you specify.

* Specify a name and optional description.

* Specify messages for when the guardrail successfully blocks a prompt or a model response in the blockedInputMessaging and blockedOutputsMessaging fields.

* Specify topics for the guardrail to deny in the topicPolicyConfig object. Each GuardrailTopicConfig object in the topicsConfig list pertains to one topic.

*

Give a name and description so that the guardrail can properly identify the topic.

*

Specify DENY in the type field.

*

(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the examples list.

* Specify filter strengths for the harmful categories defined in Amazon Bedrock in the contentPolicyConfig object. Each GuardrailContentFilterConfig object in the filtersConfig list pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig.

*

Specify the category in the type field.

*

Specify the strength of the filter for prompts in the inputStrength field and for model responses in the strength field of the GuardrailContentFilterConfig.

* (Optional) For security, include the ARN of a KMS key in the kmsKeyId field.

* (Optional) Attach any tags to the guardrail in the tags object. For more information, see Tag resources.

Link to this function

update_provisioned_model_throughput(client, provisioned_model_id, input, options \\ [])

View Source

Updates the name or associated model for a Provisioned Throughput.

For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.