Class: AWS.Bedrock
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.Bedrock
- Identifier:
- bedrock
- API Version:
- 2023-04-20
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Describes the API operations for creating, managing, fine-turning, and evaluating Amazon Bedrock models.
Sending a Request Using Bedrock
var bedrock = new AWS.Bedrock();
bedrock.createEvaluationJob(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the Bedrock object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var bedrock = new AWS.Bedrock({apiVersion: '2023-04-20'});
You can also set the API version globally in AWS.config.apiVersions
using
the bedrock service identifier:
AWS.config.apiVersions = {
bedrock: '2023-04-20',
// other service API versions
};
var bedrock = new AWS.Bedrock();
Constructor Summary collapse
-
new AWS.Bedrock(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
createEvaluationJob(params = {}, callback) ⇒ AWS.Request
API operation for creating and managing Amazon Bedrock automatic model evaluation jobs and model evaluation jobs that use human workers.
-
createGuardrail(params = {}, callback) ⇒ AWS.Request
Creates a guardrail to block topics and to filter out harmful content.
-
Specify a
name
and optionaldescription
. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessaging
andblockedOutputsMessaging
fields. -
Specify topics for the guardrail to deny in the
topicPolicyConfig
object.
-
-
createGuardrailVersion(params = {}, callback) ⇒ AWS.Request
Creates a version of the guardrail.
-
createModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Creates a fine-tuning job to customize a base model.
You specify the base foundation model and the location of the training data.
-
createProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify.
-
deleteCustomModel(params = {}, callback) ⇒ AWS.Request
Deletes a custom model that you created earlier.
-
deleteGuardrail(params = {}, callback) ⇒ AWS.Request
Deletes a guardrail.
-
To delete a guardrail, only specify the ARN of the guardrail in the
guardrailIdentifier
field.
-
-
deleteModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Delete the invocation logging.
-
deleteProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Deletes a Provisioned Throughput.
-
getCustomModel(params = {}, callback) ⇒ AWS.Request
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.
.
-
getEvaluationJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with a model evaluation job, including the status of the job.
-
getFoundationModel(params = {}, callback) ⇒ AWS.Request
Get details about a Amazon Bedrock foundation model.
.
-
getGuardrail(params = {}, callback) ⇒ AWS.Request
Gets details about a guardrail.
-
getModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with a model-customization job, including the status of the job.
-
getModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Get the current configuration values for model invocation logging.
.
-
getProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Returns details for a Provisioned Throughput.
-
listCustomModels(params = {}, callback) ⇒ AWS.Request
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.
. -
listEvaluationJobs(params = {}, callback) ⇒ AWS.Request
Lists model evaluation jobs.
.
-
listFoundationModels(params = {}, callback) ⇒ AWS.Request
Lists Amazon Bedrock foundation models that you can use.
-
listGuardrails(params = {}, callback) ⇒ AWS.Request
Lists details about all the guardrails in an account.
-
listModelCustomizationJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of model customization jobs that you have submitted.
-
listProvisionedModelThroughputs(params = {}, callback) ⇒ AWS.Request
Lists the Provisioned Throughputs in the account.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
List the tags associated with the specified resource.
For more information, see Tagging resources in the Amazon Bedrock User Guide.
. -
putModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Set the configuration values for model invocation logging.
.
-
stopEvaluationJob(params = {}, callback) ⇒ AWS.Request
Stops an in progress model evaluation job.
.
-
stopModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Stops an active model customization job.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Associate tags with a resource.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Remove one or more tags from a resource.
-
updateGuardrail(params = {}, callback) ⇒ AWS.Request
Updates a guardrail with the values you specify.
-
Specify a
name
and optionaldescription
. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessaging
andblockedOutputsMessaging
fields. -
Specify topics for the guardrail to deny in the
topicPolicyConfig
object.
-
-
updateProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Updates the name or associated model for a Provisioned Throughput.
-
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given Bedrock resource.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService
Constructor Details
new AWS.Bedrock(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Property Details
Method Details
createEvaluationJob(params = {}, callback) ⇒ AWS.Request
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.
createGuardrail(params = {}, callback) ⇒ AWS.Request
Creates a guardrail to block topics and to filter out harmful content.
-
Specify a
name
and optionaldescription
. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessaging
andblockedOutputsMessaging
fields. -
Specify topics for the guardrail to deny in the
topicPolicyConfig
object. Each GuardrailTopicConfig object in thetopicsConfig
list pertains to one topic.-
Give a
name
anddescription
so that the guardrail can properly identify the topic. -
Specify
DENY
in thetype
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 thefiltersConfig
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 thestrength
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.
createGuardrailVersion(params = {}, callback) ⇒ AWS.Request
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.
createModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
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.
createProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
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.
deleteCustomModel(params = {}, callback) ⇒ AWS.Request
Deletes a custom model that you created earlier. For more information, see Custom models in the Amazon Bedrock User Guide.
deleteGuardrail(params = {}, callback) ⇒ AWS.Request
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 theguardrailVersion
field.
deleteModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Delete the invocation logging.
deleteProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
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.
getCustomModel(params = {}, callback) ⇒ AWS.Request
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.
getEvaluationJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with a model evaluation job, including the status of the job. For more information, see Model evaluations.
getFoundationModel(params = {}, callback) ⇒ AWS.Request
Get details about a Amazon Bedrock foundation model.
getGuardrail(params = {}, callback) ⇒ AWS.Request
Gets details about a guardrail. If you don't specify a version, the response returns details for the DRAFT
version.
getModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
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.
getModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Get the current configuration values for model invocation logging.
getProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Returns details for a Provisioned Throughput. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
listCustomModels(params = {}, callback) ⇒ AWS.Request
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.
listFoundationModels(params = {}, callback) ⇒ AWS.Request
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.
listGuardrails(params = {}, callback) ⇒ AWS.Request
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.
listModelCustomizationJobs(params = {}, callback) ⇒ AWS.Request
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.
listProvisionedModelThroughputs(params = {}, callback) ⇒ AWS.Request
Lists the Provisioned Throughputs in the account. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
listTagsForResource(params = {}, callback) ⇒ AWS.Request
List the tags associated with the specified resource.
For more information, see Tagging resources in the Amazon Bedrock User Guide.
putModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Set the configuration values for model invocation logging.
stopModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Stops an active model customization job. For more information, see Custom models in the Amazon Bedrock User Guide.
tagResource(params = {}, callback) ⇒ AWS.Request
Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
untagResource(params = {}, callback) ⇒ AWS.Request
Remove one or more tags from a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
updateGuardrail(params = {}, callback) ⇒ AWS.Request
Updates a guardrail with the values you specify.
-
Specify a
name
and optionaldescription
. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessaging
andblockedOutputsMessaging
fields. -
Specify topics for the guardrail to deny in the
topicPolicyConfig
object. Each GuardrailTopicConfig object in thetopicsConfig
list pertains to one topic.-
Give a
name
anddescription
so that the guardrail can properly identify the topic. -
Specify
DENY
in thetype
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 thefiltersConfig
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 thestrength
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.
updateProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Updates the name or associated model for a Provisioned Throughput. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given Bedrock resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.