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.batchDeleteEvaluationJob(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();
Version:
-
2023-04-20
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
-
batchDeleteEvaluationJob(params = {}, callback) ⇒ AWS.Request
Creates a batch deletion job.
-
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 implement safeguards for your generative AI applications.
You can configure the following policies in a guardrail to avoid undesirable and harmful content, filter out denied topics and words, and remove sensitive information for privacy protection.
-
Content filters - Adjust filter strengths to block input prompts or model responses containing harmful content.
-
Denied topics - Define a set of topics that are undesirable in the context of your application.
-
-
createGuardrailVersion(params = {}, callback) ⇒ AWS.Request
Creates a version of the guardrail.
-
createModelCopyJob(params = {}, callback) ⇒ AWS.Request
Copies a model to another region so that it can be used there.
-
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.
-
createModelImportJob(params = {}, callback) ⇒ AWS.Request
Creates a model import job to import model that you have customized in other environments, such as Amazon SageMaker.
-
createModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Creates a batch inference job to invoke a model on multiple prompts.
-
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.
-
-
deleteImportedModel(params = {}, callback) ⇒ AWS.Request
Deletes a custom model that you imported earlier.
-
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.
-
getImportedModel(params = {}, callback) ⇒ AWS.Request
Gets properties associated with a customized model you imported.
-
getInferenceProfile(params = {}, callback) ⇒ AWS.Request
Gets information about an inference profile.
-
getModelCopyJob(params = {}, callback) ⇒ AWS.Request
Retrieves information about a model copy job.
-
getModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with a model-customization job, including the status of the job.
-
getModelImportJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with import model job, including the status of the job.
-
getModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Gets details about a batch inference 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.
-
listImportedModels(params = {}, callback) ⇒ AWS.Request
Returns a list of models you've imported.
-
listInferenceProfiles(params = {}, callback) ⇒ AWS.Request
Returns a list of inference profiles that you can use.
.
-
listModelCopyJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of model copy jobs that you have submitted.
-
listModelCustomizationJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of model customization jobs that you have submitted.
-
listModelImportJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of import jobs you've submitted.
-
listModelInvocationJobs(params = {}, callback) ⇒ AWS.Request
Lists all batch inference jobs in the account.
-
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.
-
stopModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Stops a batch inference 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.
Examples:
Constructing a Bedrock object
var bedrock = new AWS.Bedrock({apiVersion: '2023-04-20'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String|AWS.Endpoint)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
or an Endpoint object. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.Bedrock.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.Bedrock.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.Bedrock.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
s3UsEast1RegionalEndpoint
('legacy'|'regional')
—
when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to
legacy
-
s3UseArnRegion
(Boolean)
—
whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to
true
-
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a
retry count and error and returns the amount of time to delay in
milliseconds. If the result is a non-zero negative value, no further
retry attempts will be made. The
base
option will be ignored if this option is supplied. The function is only called for retryable errors.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean|undefined)
—
whether to call operations with endpoints given by service dynamically. Setting this
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
. -
stsRegionalEndpoints
('legacy'|'regional')
—
whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.
-
useFipsEndpoint
(Boolean)
—
Enables FIPS compatible endpoints. Defaults to
false
. -
useDualstackEndpoint
(Boolean)
—
Enables IPv6 dualstack endpoint. Defaults to
false
.
Property Details
Method Details
batchDeleteEvaluationJob(params = {}, callback) ⇒ AWS.Request
Creates a batch deletion job. A model evaluation job can only be deleted if it has following status FAILED
, COMPLETED
, and STOPPED
. You can request up to 25 model evaluation jobs be deleted in a single request.
Service Reference:
Examples:
Calling the batchDeleteEvaluationJob operation
var params = {
jobIdentifiers: [ /* required */
'STRING_VALUE',
/* more items */
]
};
bedrock.batchDeleteEvaluationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifiers
— (Array<String>
)An array of model evaluation job ARNs to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:errors
— (Array<map>
)A JSON object containing the HTTP status codes and the ARNs of model evaluation jobs that failed to be deleted.
jobIdentifier
— required — (String
)The ARN of the model evaluation job being deleted.
code
— required — (String
)A HTTP status code of the model evaluation job being deleted.
message
— (String
)A status message about the model evaluation job deletion.
evaluationJobs
— (Array<map>
)The list of model evaluation jobs to be deleted.
jobIdentifier
— required — (String
)The ARN of model evaluation job to be deleted.
jobStatus
— required — (String
)The status of the job's deletion.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"Deleting"
-
(AWS.Response)
—
Returns:
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 evaluation.
Service Reference:
Examples:
Calling the createEvaluationJob operation
var params = {
evaluationConfig: { /* required */
automated: {
datasetMetricConfigs: [ /* required */
{
dataset: { /* required */
name: 'STRING_VALUE', /* required */
datasetLocation: {
s3Uri: 'STRING_VALUE'
}
},
metricNames: [ /* required */
'STRING_VALUE',
/* more items */
],
taskType: Summarization | Classification | QuestionAndAnswer | Generation | Custom /* required */
},
/* more items */
]
},
human: {
datasetMetricConfigs: [ /* required */
{
dataset: { /* required */
name: 'STRING_VALUE', /* required */
datasetLocation: {
s3Uri: 'STRING_VALUE'
}
},
metricNames: [ /* required */
'STRING_VALUE',
/* more items */
],
taskType: Summarization | Classification | QuestionAndAnswer | Generation | Custom /* required */
},
/* more items */
],
customMetrics: [
{
name: 'STRING_VALUE', /* required */
ratingMethod: 'STRING_VALUE', /* required */
description: 'STRING_VALUE'
},
/* more items */
],
humanWorkflowConfig: {
flowDefinitionArn: 'STRING_VALUE', /* required */
instructions: 'STRING_VALUE'
}
}
},
inferenceConfig: { /* required */
models: [
{
bedrockModel: {
inferenceParams: 'STRING_VALUE', /* required */
modelIdentifier: 'STRING_VALUE' /* required */
}
},
/* more items */
]
},
jobName: 'STRING_VALUE', /* required */
outputDataConfig: { /* required */
s3Uri: 'STRING_VALUE' /* required */
},
roleArn: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
customerEncryptionKeyId: 'STRING_VALUE',
jobDescription: 'STRING_VALUE',
jobTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
]
};
bedrock.createEvaluationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobName
— (String
)The name of the model evaluation job. Model evaluation job names must unique with your AWS account, and your account's AWS region.
jobDescription
— (String
)A description of the model evaluation job.
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.roleArn
— (String
)The 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.customerEncryptionKeyId
— (String
)Specify your customer managed key ARN that will be used to encrypt your model evaluation job.
jobTags
— (Array<map>
)Tags to attach to the model evaluation job.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
evaluationConfig
— (map
)Specifies whether the model evaluation job is automatic or uses human worker.
automated
— (map
)Used to specify an automated model evaluation job. See
AutomatedEvaluationConfig
to view the required parameters.datasetMetricConfigs
— required — (Array<map>
)Specifies the required elements for an automatic model evaluation job.
taskType
— required — (String
)The task type you want the model to carry out.
Possible values include:"Summarization"
"Classification"
"QuestionAndAnswer"
"Generation"
"Custom"
dataset
— required — (map
)Specifies the prompt dataset.
name
— required — (String
)Used to specify supported built-in prompt datasets. Valid values are
Builtin.Bold
,Builtin.BoolQ
,Builtin.NaturalQuestions
,Builtin.Gigaword
,Builtin.RealToxicityPrompts
,Builtin.TriviaQA
,Builtin.T-Rex
,Builtin.WomensEcommerceClothingReviews
andBuiltin.Wikitext2
.datasetLocation
— (map
)For custom prompt datasets, you must specify the location in Amazon S3 where the prompt dataset is saved.
s3Uri
— (String
)The S3 URI of the S3 bucket specified in the job.
metricNames
— required — (Array<String>
)The names of the metrics used. For automated model evaluation jobs valid values are
"Builtin.Accuracy"
,"Builtin.Robustness"
, and"Builtin.Toxicity"
. In human-based model evaluation jobs the array of strings must match thename
parameter specified inHumanEvaluationCustomMetric
.
human
— (map
)Used to specify a model evaluation job that uses human workers.See
HumanEvaluationConfig
to view the required parameters.humanWorkflowConfig
— (map
)The parameters of the human workflow.
flowDefinitionArn
— required — (String
)The Amazon Resource Number (ARN) for the flow definition
instructions
— (String
)Instructions for the flow definition
customMetrics
— (Array<map>
)A
HumanEvaluationCustomMetric
object. It contains the names the metrics, how the metrics are to be evaluated, an optional description.name
— required — (String
)The name of the metric. Your human evaluators will see this name in the evaluation UI.
description
— (String
)An optional description of the metric. Use this parameter to provide more details about the metric.
ratingMethod
— required — (String
)Choose how you want your human workers to evaluation your model. Valid values for rating methods are
ThumbsUpDown
,IndividualLikertScale
,ComparisonLikertScale
,ComparisonChoice
, andComparisonRank
datasetMetricConfigs
— required — (Array<map>
)Use to specify the metrics, task, and prompt dataset to be used in your model evaluation job.
taskType
— required — (String
)The task type you want the model to carry out.
Possible values include:"Summarization"
"Classification"
"QuestionAndAnswer"
"Generation"
"Custom"
dataset
— required — (map
)Specifies the prompt dataset.
name
— required — (String
)Used to specify supported built-in prompt datasets. Valid values are
Builtin.Bold
,Builtin.BoolQ
,Builtin.NaturalQuestions
,Builtin.Gigaword
,Builtin.RealToxicityPrompts
,Builtin.TriviaQA
,Builtin.T-Rex
,Builtin.WomensEcommerceClothingReviews
andBuiltin.Wikitext2
.datasetLocation
— (map
)For custom prompt datasets, you must specify the location in Amazon S3 where the prompt dataset is saved.
s3Uri
— (String
)The S3 URI of the S3 bucket specified in the job.
metricNames
— required — (Array<String>
)The names of the metrics used. For automated model evaluation jobs valid values are
"Builtin.Accuracy"
,"Builtin.Robustness"
, and"Builtin.Toxicity"
. In human-based model evaluation jobs the array of strings must match thename
parameter specified inHumanEvaluationCustomMetric
.
inferenceConfig
— (map
)Specify 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.
models
— (Array<map>
)Used to specify the models.
bedrockModel
— (map
)Defines the Amazon Bedrock model and inference parameters you want used.
modelIdentifier
— required — (String
)The ARN of the Amazon Bedrock model specified.
inferenceParams
— required — (String
)Each Amazon Bedrock support different inference parameters that change how the model behaves during inference.
outputDataConfig
— (map
)An object that defines where the results of model evaluation job will be saved in Amazon S3.
s3Uri
— required — (String
)The Amazon S3 URI where the results of model evaluation job are saved.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The ARN of the model evaluation job.
-
(AWS.Response)
—
Returns:
createGuardrail(params = {}, callback) ⇒ AWS.Request
Creates a guardrail to block topics and to implement safeguards for your generative AI applications.
You can configure the following policies in a guardrail to avoid undesirable and harmful content, filter out denied topics and words, and remove sensitive information for privacy protection.
-
Content filters - Adjust filter strengths to block input prompts or model responses containing harmful content.
-
Denied topics - Define a set of topics that are undesirable in the context of your application. These topics will be blocked if detected in user queries or model responses.
-
Word filters - Configure filters to block undesirable words, phrases, and profanity. Such words can include offensive terms, competitor names etc.
-
Sensitive information filters - Block or mask sensitive information such as personally identifiable information (PII) or custom regex in user inputs and model responses.
In addition to the above policies, you can also configure the messages to be returned to the user if a user input or model response is in violation of the policies defined in the guardrail.
For more information, see Guardrails for Amazon Bedrock in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the createGuardrail operation
var params = {
blockedInputMessaging: 'STRING_VALUE', /* required */
blockedOutputsMessaging: 'STRING_VALUE', /* required */
name: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
contentPolicyConfig: {
filtersConfig: [ /* required */
{
inputStrength: NONE | LOW | MEDIUM | HIGH, /* required */
outputStrength: NONE | LOW | MEDIUM | HIGH, /* required */
type: SEXUAL | VIOLENCE | HATE | INSULTS | MISCONDUCT | PROMPT_ATTACK /* required */
},
/* more items */
]
},
contextualGroundingPolicyConfig: {
filtersConfig: [ /* required */
{
threshold: 'NUMBER_VALUE', /* required */
type: GROUNDING | RELEVANCE /* required */
},
/* more items */
]
},
description: 'STRING_VALUE',
kmsKeyId: 'STRING_VALUE',
sensitiveInformationPolicyConfig: {
piiEntitiesConfig: [
{
action: BLOCK | ANONYMIZE, /* required */
type: ADDRESS | AGE | AWS_ACCESS_KEY | AWS_SECRET_KEY | CA_HEALTH_NUMBER | CA_SOCIAL_INSURANCE_NUMBER | CREDIT_DEBIT_CARD_CVV | CREDIT_DEBIT_CARD_EXPIRY | CREDIT_DEBIT_CARD_NUMBER | DRIVER_ID | EMAIL | INTERNATIONAL_BANK_ACCOUNT_NUMBER | IP_ADDRESS | LICENSE_PLATE | MAC_ADDRESS | NAME | PASSWORD | PHONE | PIN | SWIFT_CODE | UK_NATIONAL_HEALTH_SERVICE_NUMBER | UK_NATIONAL_INSURANCE_NUMBER | UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER | URL | USERNAME | US_BANK_ACCOUNT_NUMBER | US_BANK_ROUTING_NUMBER | US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER | US_PASSPORT_NUMBER | US_SOCIAL_SECURITY_NUMBER | VEHICLE_IDENTIFICATION_NUMBER /* required */
},
/* more items */
],
regexesConfig: [
{
action: BLOCK | ANONYMIZE, /* required */
name: 'STRING_VALUE', /* required */
pattern: 'STRING_VALUE', /* required */
description: 'STRING_VALUE'
},
/* more items */
]
},
tags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
topicPolicyConfig: {
topicsConfig: [ /* required */
{
definition: 'STRING_VALUE', /* required */
name: 'STRING_VALUE', /* required */
type: DENY, /* required */
examples: [
'STRING_VALUE',
/* more items */
]
},
/* more items */
]
},
wordPolicyConfig: {
managedWordListsConfig: [
{
type: PROFANITY /* required */
},
/* more items */
],
wordsConfig: [
{
text: 'STRING_VALUE' /* required */
},
/* more items */
]
}
};
bedrock.createGuardrail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
name
— (String
)The name to give the guardrail.
description
— (String
)A description of the guardrail.
topicPolicyConfig
— (map
)The topic policies to configure for the guardrail.
topicsConfig
— required — (Array<map>
)A list of policies related to topics that the guardrail should deny.
name
— required — (String
)The name of the topic to deny.
definition
— required — (String
)A definition of the topic to deny.
examples
— (Array<String>
)A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
type
— required — (String
)Specifies to deny the topic.
Possible values include:"DENY"
contentPolicyConfig
— (map
)The content filter policies to configure for the guardrail.
filtersConfig
— required — (Array<map>
)Contains the type of the content filter and how strongly it should apply to prompts and model responses.
type
— required — (String
)The harmful category that the content filter is applied to.
Possible values include:"SEXUAL"
"VIOLENCE"
"HATE"
"INSULTS"
"MISCONDUCT"
"PROMPT_ATTACK"
inputStrength
— required — (String
)The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
outputStrength
— required — (String
)The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
wordPolicyConfig
— (map
)The word policy you configure for the guardrail.
wordsConfig
— (Array<map>
)A list of words to configure for the guardrail.
text
— required — (String
)Text of the word configured for the guardrail to block.
managedWordListsConfig
— (Array<map>
)A list of managed words to configure for the guardrail.
type
— required — (String
)The managed word type to configure for the guardrail.
Possible values include:"PROFANITY"
sensitiveInformationPolicyConfig
— (map
)The sensitive information policy to configure for the guardrail.
piiEntitiesConfig
— (Array<map>
)A list of PII entities to configure to the guardrail.
type
— required — (String
)Configure guardrail type when the PII entity is detected.
The following PIIs are used to block or mask sensitive information:
-
General
-
ADDRESS
A physical address, such as "100 Main Street, Anytown, USA" or "Suite #12, Building 123". An address can include information such as the street, building, location, city, state, country, county, zip code, precinct, and neighborhood.
-
AGE
An individual's age, including the quantity and unit of time. For example, in the phrase "I am 40 years old," Guarrails recognizes "40 years" as an age.
-
NAME
An individual's name. This entity type does not include titles, such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this entity type to names that are part of organizations or addresses. For example, guardrails recognizes the "John Doe Organization" as an organization, and it recognizes "Jane Doe Street" as an address.
-
EMAIL
An email address, such as marymajor@email.com.
-
PHONE
A phone number. This entity type also includes fax and pager numbers.
-
USERNAME
A user name that identifies an account, such as a login name, screen name, nick name, or handle.
-
PASSWORD
An alphanumeric string that is used as a password, such as "very20special#pass".
-
DRIVER_ID
The number assigned to a driver's license, which is an official document permitting an individual to operate one or more motorized vehicles on a public road. A driver's license number consists of alphanumeric characters.
-
LICENSE_PLATE
A license plate for a vehicle is issued by the state or country where the vehicle is registered. The format for passenger vehicles is typically five to eight digits, consisting of upper-case letters and numbers. The format varies depending on the location of the issuing state or country.
-
VEHICLE_IDENTIFICATION_NUMBER
A Vehicle Identification Number (VIN) uniquely identifies a vehicle. VIN content and format are defined in the ISO 3779 specification. Each country has specific codes and formats for VINs.
-
-
Finance
-
REDIT_DEBIT_CARD_CVV
A three-digit card verification code (CVV) that is present on VISA, MasterCard, and Discover credit and debit cards. For American Express credit or debit cards, the CVV is a four-digit numeric code.
-
CREDIT_DEBIT_CARD_EXPIRY
The expiration date for a credit or debit card. This number is usually four digits long and is often formatted as month/year or MM/YY. Guardrails recognizes expiration dates such as 01/21, 01/2021, and Jan 2021.
-
CREDIT_DEBIT_CARD_NUMBER
The number for a credit or debit card. These numbers can vary from 13 to 16 digits in length. However, Amazon Comprehend also recognizes credit or debit card numbers when only the last four digits are present.
-
PIN
A four-digit personal identification number (PIN) with which you can access your bank account.
-
INTERNATIONAL_BANK_ACCOUNT_NUMBER
An International Bank Account Number has specific formats in each country. For more information, see www.iban.com/structure.
-
SWIFT_CODE
A SWIFT code is a standard format of Bank Identifier Code (BIC) used to specify a particular bank or branch. Banks use these codes for money transfers such as international wire transfers.
SWIFT codes consist of eight or 11 characters. The 11-digit codes refer to specific branches, while eight-digit codes (or 11-digit codes ending in 'XXX') refer to the head or primary office.
-
-
IT
-
IP_ADDRESS
An IPv4 address, such as 198.51.100.0.
-
MAC_ADDRESS
A media access control (MAC) address is a unique identifier assigned to a network interface controller (NIC).
-
URL
A web address, such as www.example.com.
-
AWS_ACCESS_KEY
A unique identifier that's associated with a secret access key; you use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
-
AWS_SECRET_KEY
A unique identifier that's associated with an access key. You use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
-
-
USA specific
-
US_BANK_ACCOUNT_NUMBER
A US bank account number, which is typically 10 to 12 digits long.
-
US_BANK_ROUTING_NUMBER
A US bank account routing number. These are typically nine digits long,
-
US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER
A US Individual Taxpayer Identification Number (ITIN) is a nine-digit number that starts with a "9" and contain a "7" or "8" as the fourth digit. An ITIN can be formatted with a space or a dash after the third and forth digits.
-
US_PASSPORT_NUMBER
A US passport number. Passport numbers range from six to nine alphanumeric characters.
-
US_SOCIAL_SECURITY_NUMBER
A US Social Security Number (SSN) is a nine-digit number that is issued to US citizens, permanent residents, and temporary working residents.
-
-
Canada specific
-
CA_HEALTH_NUMBER
A Canadian Health Service Number is a 10-digit unique identifier, required for individuals to access healthcare benefits.
-
CA_SOCIAL_INSURANCE_NUMBER
A Canadian Social Insurance Number (SIN) is a nine-digit unique identifier, required for individuals to access government programs and benefits.
The SIN is formatted as three groups of three digits, such as 123-456-789. A SIN can be validated through a simple check-digit process called the Luhn algorithm.
-
-
UK Specific
-
UK_NATIONAL_HEALTH_SERVICE_NUMBER
A UK National Health Service Number is a 10-17 digit number, such as 485 777 3456. The current system formats the 10-digit number with spaces after the third and sixth digits. The final digit is an error-detecting checksum.
-
UK_NATIONAL_INSURANCE_NUMBER
A UK National Insurance Number (NINO) provides individuals with access to National Insurance (social security) benefits. It is also used for some purposes in the UK tax system.
The number is nine digits long and starts with two letters, followed by six numbers and one letter. A NINO can be formatted with a space or a dash after the two letters and after the second, forth, and sixth digits.
-
UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER
A UK Unique Taxpayer Reference (UTR) is a 10-digit number that identifies a taxpayer or a business.
-
-
Custom
-
Regex filter - You can use a regular expressions to define patterns for a guardrail to recognize and act upon such as serial number, booking ID etc..
-
"ADDRESS"
"AGE"
"AWS_ACCESS_KEY"
"AWS_SECRET_KEY"
"CA_HEALTH_NUMBER"
"CA_SOCIAL_INSURANCE_NUMBER"
"CREDIT_DEBIT_CARD_CVV"
"CREDIT_DEBIT_CARD_EXPIRY"
"CREDIT_DEBIT_CARD_NUMBER"
"DRIVER_ID"
"EMAIL"
"INTERNATIONAL_BANK_ACCOUNT_NUMBER"
"IP_ADDRESS"
"LICENSE_PLATE"
"MAC_ADDRESS"
"NAME"
"PASSWORD"
"PHONE"
"PIN"
"SWIFT_CODE"
"UK_NATIONAL_HEALTH_SERVICE_NUMBER"
"UK_NATIONAL_INSURANCE_NUMBER"
"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"
"URL"
"USERNAME"
"US_BANK_ACCOUNT_NUMBER"
"US_BANK_ROUTING_NUMBER"
"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"
"US_PASSPORT_NUMBER"
"US_SOCIAL_SECURITY_NUMBER"
"VEHICLE_IDENTIFICATION_NUMBER"
-
action
— required — (String
)Configure guardrail action when the PII entity is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
regexesConfig
— (Array<map>
)A list of regular expressions to configure to the guardrail.
name
— required — (String
)The name of the regular expression to configure for the guardrail.
description
— (String
)The description of the regular expression to configure for the guardrail.
pattern
— required — (String
)The regular expression pattern to configure for the guardrail.
action
— required — (String
)The guardrail action to configure when matching regular expression is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
contextualGroundingPolicyConfig
— (map
)The contextual grounding policy configuration used to create a guardrail.
filtersConfig
— required — (Array<map>
)The filter configuration details for the guardrails contextual grounding policy.
type
— required — (String
)The filter details for the guardrails contextual grounding filter.
Possible values include:"GROUNDING"
"RELEVANCE"
threshold
— required — (Float
)The threshold details for the guardrails contextual grounding filter.
blockedInputMessaging
— (String
)The message to return when the guardrail blocks a prompt.
blockedOutputsMessaging
— (String
)The message to return when the guardrail blocks a model response.
kmsKeyId
— (String
)The ARN of the KMS key that you use to encrypt the guardrail.
tags
— (Array<map>
)The tags that you want to attach to the guardrail.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:guardrailId
— (String
)The unique identifier of the guardrail that was created.
guardrailArn
— (String
)The ARN of the guardrail.
version
— (String
)The version of the guardrail that was created. This value will always be
DRAFT
.createdAt
— (Date
)The time at which the guardrail was created.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the createGuardrailVersion operation
var params = {
guardrailIdentifier: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
description: 'STRING_VALUE'
};
bedrock.createGuardrailVersion(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
guardrailIdentifier
— (String
)The unique identifier of the guardrail. This can be an ID or the ARN.
description
— (String
)A description of the guardrail version.
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:guardrailId
— (String
)The unique identifier of the guardrail.
version
— (String
)The number of the version of the guardrail.
-
(AWS.Response)
—
Returns:
createModelCopyJob(params = {}, callback) ⇒ AWS.Request
Copies a model to another region so that it can be used there. For more information, see Copy models to be used in other regions in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the createModelCopyJob operation
var params = {
sourceModelArn: 'STRING_VALUE', /* required */
targetModelName: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
modelKmsKeyId: 'STRING_VALUE',
targetModelTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
]
};
bedrock.createModelCopyJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
sourceModelArn
— (String
)The Amazon Resource Name (ARN) of the model to be copied.
targetModelName
— (String
)A name for the copied model.
modelKmsKeyId
— (String
)The ARN of the KMS key that you use to encrypt the model copy.
targetModelTags
— (Array<map>
)Tags to associate with the target model. For more information, see Tag resources in the Amazon Bedrock User Guide.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the model copy job.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the createModelCustomizationJob operation
var params = {
baseModelIdentifier: 'STRING_VALUE', /* required */
customModelName: 'STRING_VALUE', /* required */
hyperParameters: { /* required */
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
jobName: 'STRING_VALUE', /* required */
outputDataConfig: { /* required */
s3Uri: 'STRING_VALUE' /* required */
},
roleArn: 'STRING_VALUE', /* required */
trainingDataConfig: { /* required */
s3Uri: 'STRING_VALUE' /* required */
},
clientRequestToken: 'STRING_VALUE',
customModelKmsKeyId: 'STRING_VALUE',
customModelTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
customizationType: FINE_TUNING | CONTINUED_PRE_TRAINING,
jobTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
validationDataConfig: {
validators: [ /* required */
{
s3Uri: 'STRING_VALUE' /* required */
},
/* more items */
]
},
vpcConfig: {
securityGroupIds: [ /* required */
'STRING_VALUE',
/* more items */
],
subnetIds: [ /* required */
'STRING_VALUE',
/* more items */
]
}
};
bedrock.createModelCustomizationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobName
— (String
)A name for the fine-tuning job.
customModelName
— (String
)A name for the resulting custom model.
roleArn
— (String
)The 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.clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.baseModelIdentifier
— (String
)Name of the base model.
customizationType
— (String
)The customization type.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
customModelKmsKeyId
— (String
)The custom model is encrypted at rest using this key.
jobTags
— (Array<map>
)Tags to attach to the job.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
customModelTags
— (Array<map>
)Tags to attach to the resulting custom model.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
trainingDataConfig
— (map
)Information about the training dataset.
s3Uri
— required — (String
)The S3 URI where the training data is stored.
validationDataConfig
— (map
)Information about the validation dataset.
validators
— required — (Array<map>
)Information about the validators.
s3Uri
— required — (String
)The S3 URI where the validation data is stored.
outputDataConfig
— (map
)S3 location for the output data.
s3Uri
— required — (String
)The S3 URI where the output data is stored.
hyperParameters
— (map<String>
)Parameters related to tuning the model. For details on the format for different models, see Custom model hyperparameters.
vpcConfig
— (map
)VPC configuration (optional). Configuration parameters for the private Virtual Private Cloud (VPC) that contains the resources you are using for this job.
subnetIds
— required — (Array<String>
)VPC configuration subnets.
securityGroupIds
— required — (Array<String>
)VPC configuration security group Ids.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)Amazon Resource Name (ARN) of the fine tuning job
-
(AWS.Response)
—
Returns:
createModelImportJob(params = {}, callback) ⇒ AWS.Request
Creates a model import job to import model that you have customized in other environments, such as Amazon SageMaker. For more information, see Import a customized model
Service Reference:
Examples:
Calling the createModelImportJob operation
var params = {
importedModelName: 'STRING_VALUE', /* required */
jobName: 'STRING_VALUE', /* required */
modelDataSource: { /* required */
s3DataSource: {
s3Uri: 'STRING_VALUE' /* required */
}
},
roleArn: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
importedModelKmsKeyId: 'STRING_VALUE',
importedModelTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
jobTags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
vpcConfig: {
securityGroupIds: [ /* required */
'STRING_VALUE',
/* more items */
],
subnetIds: [ /* required */
'STRING_VALUE',
/* more items */
]
}
};
bedrock.createModelImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobName
— (String
)The name of the import job.
importedModelName
— (String
)The name of the imported model.
roleArn
— (String
)The Amazon Resource Name (ARN) of the model import job.
modelDataSource
— (map
)The data source for the imported model.
s3DataSource
— (map
)The Amazon S3 data source of the imported model.
s3Uri
— required — (String
)The URI of the Amazon S3 data source.
jobTags
— (Array<map>
)Tags to attach to this import job.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
importedModelTags
— (Array<map>
)Tags to attach to the imported model.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
clientRequestToken
— (String
)A 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.
vpcConfig
— (map
)VPC configuration parameters for the private Virtual Private Cloud (VPC) that contains the resources you are using for the import job.
subnetIds
— required — (Array<String>
)VPC configuration subnets.
securityGroupIds
— required — (Array<String>
)VPC configuration security group Ids.
importedModelKmsKeyId
— (String
)The imported model is encrypted at rest using this key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the model import job.
-
(AWS.Response)
—
Returns:
createModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Creates a batch inference job to invoke a model on multiple prompts. Format your data according to Format your inference data and upload it to an Amazon S3 bucket. For more information, see Process multiple prompts with batch inference.
The response returns a jobArn
that you can use to stop or get details about the job.
Service Reference:
Examples:
Calling the createModelInvocationJob operation
var params = {
inputDataConfig: { /* required */
s3InputDataConfig: {
s3Uri: 'STRING_VALUE', /* required */
s3InputFormat: JSONL
}
},
jobName: 'STRING_VALUE', /* required */
modelId: 'STRING_VALUE', /* required */
outputDataConfig: { /* required */
s3OutputDataConfig: {
s3Uri: 'STRING_VALUE', /* required */
s3EncryptionKeyId: 'STRING_VALUE'
}
},
roleArn: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
tags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
],
timeoutDurationInHours: 'NUMBER_VALUE'
};
bedrock.createModelInvocationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobName
— (String
)A name to give the batch inference job.
roleArn
— (String
)The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.modelId
— (String
)The unique identifier of the foundation model to use for the batch inference job.
inputDataConfig
— (map
)Details about the location of the input to the batch inference job.
s3InputDataConfig
— (map
)Contains the configuration of the S3 location of the input data.
s3InputFormat
— (String
)The format of the input data.
Possible values include:"JSONL"
s3Uri
— required — (String
)The S3 location of the input data.
outputDataConfig
— (map
)Details about the location of the output of the batch inference job.
s3OutputDataConfig
— (map
)Contains the configuration of the S3 location of the output data.
s3Uri
— required — (String
)The S3 location of the output data.
s3EncryptionKeyId
— (String
)The unique identifier of the key that encrypts the S3 location of the output data.
timeoutDurationInHours
— (Integer
)The number of hours after which to force the batch inference job to time out.
tags
— (Array<map>
)Any tags to associate with the batch inference job. For more information, see Tagging Amazon Bedrock resources.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the batch inference job.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the createProvisionedModelThroughput operation
var params = {
modelId: 'STRING_VALUE', /* required */
modelUnits: 'NUMBER_VALUE', /* required */
provisionedModelName: 'STRING_VALUE', /* required */
clientRequestToken: 'STRING_VALUE',
commitmentDuration: OneMonth | SixMonths,
tags: [
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
]
};
bedrock.createProvisionedModelThroughput(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
clientRequestToken
— (String
)A 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.
If a token is not provided, the SDK will use a version 4 UUID.modelUnits
— (Integer
)Number 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.
provisionedModelName
— (String
)The name for this Provisioned Throughput.
modelId
— (String
)The 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.
commitmentDuration
— (String
)The 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
Possible values include:"OneMonth"
"SixMonths"
tags
— (Array<map>
)Tags to associate with this Provisioned Throughput.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:provisionedModelArn
— (String
)The Amazon Resource Name (ARN) for this Provisioned Throughput.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the deleteCustomModel operation
var params = {
modelIdentifier: 'STRING_VALUE' /* required */
};
bedrock.deleteCustomModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
modelIdentifier
— (String
)Name of the model to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the deleteGuardrail operation
var params = {
guardrailIdentifier: 'STRING_VALUE', /* required */
guardrailVersion: 'STRING_VALUE'
};
bedrock.deleteGuardrail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
guardrailIdentifier
— (String
)The unique identifier of the guardrail. This can be an ID or the ARN.
guardrailVersion
— (String
)The version of the guardrail.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteImportedModel(params = {}, callback) ⇒ AWS.Request
Deletes a custom model that you imported earlier. For more information, see Import a customized model in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the deleteImportedModel operation
var params = {
modelIdentifier: 'STRING_VALUE' /* required */
};
bedrock.deleteImportedModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
modelIdentifier
— (String
)Name of the imported model to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Delete the invocation logging.
Service Reference:
Examples:
Calling the deleteModelInvocationLoggingConfiguration operation
var params = {
};
bedrock.deleteModelInvocationLoggingConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the deleteProvisionedModelThroughput operation
var params = {
provisionedModelId: 'STRING_VALUE' /* required */
};
bedrock.deleteProvisionedModelThroughput(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
provisionedModelId
— (String
)The Amazon Resource Name (ARN) or name of the Provisioned Throughput.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the getCustomModel operation
var params = {
modelIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getCustomModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
modelIdentifier
— (String
)Name or Amazon Resource Name (ARN) of the custom model.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:modelArn
— (String
)Amazon Resource Name (ARN) associated with this model.
modelName
— (String
)Model name associated with this model.
jobName
— (String
)Job name associated with this model.
jobArn
— (String
)Job Amazon Resource Name (ARN) associated with this model.
baseModelArn
— (String
)Amazon Resource Name (ARN) of the base model.
customizationType
— (String
)The type of model customization.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
modelKmsKeyArn
— (String
)The custom model is encrypted at rest using this key.
hyperParameters
— (map<String>
)Hyperparameter values associated with this model. For details on the format for different models, see Custom model hyperparameters.
trainingDataConfig
— (map
)Contains information about the training dataset.
s3Uri
— required — (String
)The S3 URI where the training data is stored.
validationDataConfig
— (map
)Contains information about the validation dataset.
validators
— required — (Array<map>
)Information about the validators.
s3Uri
— required — (String
)The S3 URI where the validation data is stored.
outputDataConfig
— (map
)Output data configuration associated with this custom model.
s3Uri
— required — (String
)The S3 URI where the output data is stored.
trainingMetrics
— (map
)Contains training metrics from the job creation.
trainingLoss
— (Float
)Loss metric associated with the custom job.
validationMetrics
— (Array<map>
)The validation metrics from the job creation.
validationLoss
— (Float
)The validation loss associated with this validator.
creationTime
— (Date
)Creation time of the model.
-
(AWS.Response)
—
Returns:
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 evaluation.
Service Reference:
Examples:
Calling the getEvaluationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getEvaluationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)The Amazon Resource Name (ARN) of the model evaluation job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobName
— (String
)The name of the model evaluation job.
status
— (String
)The status of the model evaluation job.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"Deleting"
jobArn
— (String
)The Amazon Resource Name (ARN) of the model evaluation job.
jobDescription
— (String
)The description of the model evaluation job.
roleArn
— (String
)The Amazon Resource Name (ARN) of the IAM service role used in the model evaluation job.
customerEncryptionKeyId
— (String
)The Amazon Resource Name (ARN) of the customer managed key specified when the model evaluation job was created.
jobType
— (String
)The type of model evaluation job.
Possible values include:"Human"
"Automated"
evaluationConfig
— (map
)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.
automated
— (map
)Used to specify an automated model evaluation job. See
AutomatedEvaluationConfig
to view the required parameters.datasetMetricConfigs
— required — (Array<map>
)Specifies the required elements for an automatic model evaluation job.
taskType
— required — (String
)The task type you want the model to carry out.
Possible values include:"Summarization"
"Classification"
"QuestionAndAnswer"
"Generation"
"Custom"
dataset
— required — (map
)Specifies the prompt dataset.
name
— required — (String
)Used to specify supported built-in prompt datasets. Valid values are
Builtin.Bold
,Builtin.BoolQ
,Builtin.NaturalQuestions
,Builtin.Gigaword
,Builtin.RealToxicityPrompts
,Builtin.TriviaQA
,Builtin.T-Rex
,Builtin.WomensEcommerceClothingReviews
andBuiltin.Wikitext2
.datasetLocation
— (map
)For custom prompt datasets, you must specify the location in Amazon S3 where the prompt dataset is saved.
s3Uri
— (String
)The S3 URI of the S3 bucket specified in the job.
metricNames
— required — (Array<String>
)The names of the metrics used. For automated model evaluation jobs valid values are
"Builtin.Accuracy"
,"Builtin.Robustness"
, and"Builtin.Toxicity"
. In human-based model evaluation jobs the array of strings must match thename
parameter specified inHumanEvaluationCustomMetric
.
human
— (map
)Used to specify a model evaluation job that uses human workers.See
HumanEvaluationConfig
to view the required parameters.humanWorkflowConfig
— (map
)The parameters of the human workflow.
flowDefinitionArn
— required — (String
)The Amazon Resource Number (ARN) for the flow definition
instructions
— (String
)Instructions for the flow definition
customMetrics
— (Array<map>
)A
HumanEvaluationCustomMetric
object. It contains the names the metrics, how the metrics are to be evaluated, an optional description.name
— required — (String
)The name of the metric. Your human evaluators will see this name in the evaluation UI.
description
— (String
)An optional description of the metric. Use this parameter to provide more details about the metric.
ratingMethod
— required — (String
)Choose how you want your human workers to evaluation your model. Valid values for rating methods are
ThumbsUpDown
,IndividualLikertScale
,ComparisonLikertScale
,ComparisonChoice
, andComparisonRank
datasetMetricConfigs
— required — (Array<map>
)Use to specify the metrics, task, and prompt dataset to be used in your model evaluation job.
taskType
— required — (String
)The task type you want the model to carry out.
Possible values include:"Summarization"
"Classification"
"QuestionAndAnswer"
"Generation"
"Custom"
dataset
— required — (map
)Specifies the prompt dataset.
name
— required — (String
)Used to specify supported built-in prompt datasets. Valid values are
Builtin.Bold
,Builtin.BoolQ
,Builtin.NaturalQuestions
,Builtin.Gigaword
,Builtin.RealToxicityPrompts
,Builtin.TriviaQA
,Builtin.T-Rex
,Builtin.WomensEcommerceClothingReviews
andBuiltin.Wikitext2
.datasetLocation
— (map
)For custom prompt datasets, you must specify the location in Amazon S3 where the prompt dataset is saved.
s3Uri
— (String
)The S3 URI of the S3 bucket specified in the job.
metricNames
— required — (Array<String>
)The names of the metrics used. For automated model evaluation jobs valid values are
"Builtin.Accuracy"
,"Builtin.Robustness"
, and"Builtin.Toxicity"
. In human-based model evaluation jobs the array of strings must match thename
parameter specified inHumanEvaluationCustomMetric
.
inferenceConfig
— (map
)Details about the models you specified in your model evaluation job.
models
— (Array<map>
)Used to specify the models.
bedrockModel
— (map
)Defines the Amazon Bedrock model and inference parameters you want used.
modelIdentifier
— required — (String
)The ARN of the Amazon Bedrock model specified.
inferenceParams
— required — (String
)Each Amazon Bedrock support different inference parameters that change how the model behaves during inference.
outputDataConfig
— (map
)Amazon S3 location for where output data is saved.
s3Uri
— required — (String
)The Amazon S3 URI where the results of model evaluation job are saved.
creationTime
— (Date
)When the model evaluation job was created.
lastModifiedTime
— (Date
)When the model evaluation job was last modified.
failureMessages
— (Array<String>
)An array of strings the specify why the model evaluation job has failed.
-
(AWS.Response)
—
Returns:
getFoundationModel(params = {}, callback) ⇒ AWS.Request
Get details about a Amazon Bedrock foundation model.
Service Reference:
Examples:
Calling the getFoundationModel operation
var params = {
modelIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getFoundationModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
modelIdentifier
— (String
)The model identifier.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:modelDetails
— (map
)Information about the foundation model.
modelArn
— required — (String
)The model Amazon Resource Name (ARN).
modelId
— required — (String
)The model identifier.
modelName
— (String
)The model name.
providerName
— (String
)The model's provider name.
inputModalities
— (Array<String>
)The input modalities that the model supports.
outputModalities
— (Array<String>
)The output modalities that the model supports.
responseStreamingSupported
— (Boolean
)Indicates whether the model supports streaming.
customizationsSupported
— (Array<String>
)The customization that the model supports.
inferenceTypesSupported
— (Array<String>
)The inference types that the model supports.
modelLifecycle
— (map
)Contains details about whether a model version is available or deprecated
status
— required — (String
)Specifies whether a model version is available (
Possible values include:ACTIVE
) or deprecated (LEGACY
."ACTIVE"
"LEGACY"
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the getGuardrail operation
var params = {
guardrailIdentifier: 'STRING_VALUE', /* required */
guardrailVersion: 'STRING_VALUE'
};
bedrock.getGuardrail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
guardrailIdentifier
— (String
)The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.
guardrailVersion
— (String
)The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the
DRAFT
version.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:name
— (String
)The name of the guardrail.
description
— (String
)The description of the guardrail.
guardrailId
— (String
)The unique identifier of the guardrail.
guardrailArn
— (String
)The ARN of the guardrail.
version
— (String
)The version of the guardrail.
status
— (String
)The status of the guardrail.
Possible values include:"CREATING"
"UPDATING"
"VERSIONING"
"READY"
"FAILED"
"DELETING"
topicPolicy
— (map
)The topic policy that was configured for the guardrail.
topics
— required — (Array<map>
)A list of policies related to topics that the guardrail should deny.
name
— required — (String
)The name of the topic to deny.
definition
— required — (String
)A definition of the topic to deny.
examples
— (Array<String>
)A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
type
— (String
)Specifies to deny the topic.
Possible values include:"DENY"
contentPolicy
— (map
)The content policy that was configured for the guardrail.
filters
— (Array<map>
)Contains the type of the content filter and how strongly it should apply to prompts and model responses.
type
— required — (String
)The harmful category that the content filter is applied to.
Possible values include:"SEXUAL"
"VIOLENCE"
"HATE"
"INSULTS"
"MISCONDUCT"
"PROMPT_ATTACK"
inputStrength
— required — (String
)The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
outputStrength
— required — (String
)The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
wordPolicy
— (map
)The word policy that was configured for the guardrail.
words
— (Array<map>
)A list of words configured for the guardrail.
text
— required — (String
)Text of the word configured for the guardrail to block.
managedWordLists
— (Array<map>
)A list of managed words configured for the guardrail.
type
— required — (String
)ManagedWords$type The managed word type that was configured for the guardrail. (For now, we only offer profanity word list)
Possible values include:"PROFANITY"
sensitiveInformationPolicy
— (map
)The sensitive information policy that was configured for the guardrail.
piiEntities
— (Array<map>
)The list of PII entities configured for the guardrail.
type
— required — (String
)The type of PII entity. For exampvle, Social Security Number.
Possible values include:"ADDRESS"
"AGE"
"AWS_ACCESS_KEY"
"AWS_SECRET_KEY"
"CA_HEALTH_NUMBER"
"CA_SOCIAL_INSURANCE_NUMBER"
"CREDIT_DEBIT_CARD_CVV"
"CREDIT_DEBIT_CARD_EXPIRY"
"CREDIT_DEBIT_CARD_NUMBER"
"DRIVER_ID"
"EMAIL"
"INTERNATIONAL_BANK_ACCOUNT_NUMBER"
"IP_ADDRESS"
"LICENSE_PLATE"
"MAC_ADDRESS"
"NAME"
"PASSWORD"
"PHONE"
"PIN"
"SWIFT_CODE"
"UK_NATIONAL_HEALTH_SERVICE_NUMBER"
"UK_NATIONAL_INSURANCE_NUMBER"
"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"
"URL"
"USERNAME"
"US_BANK_ACCOUNT_NUMBER"
"US_BANK_ROUTING_NUMBER"
"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"
"US_PASSPORT_NUMBER"
"US_SOCIAL_SECURITY_NUMBER"
"VEHICLE_IDENTIFICATION_NUMBER"
action
— required — (String
)The configured guardrail action when PII entity is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
regexes
— (Array<map>
)The list of regular expressions configured for the guardrail.
name
— required — (String
)The name of the regular expression for the guardrail.
description
— (String
)The description of the regular expression for the guardrail.
pattern
— required — (String
)The pattern of the regular expression configured for the guardrail.
action
— required — (String
)The action taken when a match to the regular expression is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
contextualGroundingPolicy
— (map
)The contextual grounding policy used in the guardrail.
filters
— required — (Array<map>
)The filter details for the guardrails contextual grounding policy.
type
— required — (String
)The filter type details for the guardrails contextual grounding filter.
Possible values include:"GROUNDING"
"RELEVANCE"
threshold
— required — (Float
)The threshold details for the guardrails contextual grounding filter.
createdAt
— (Date
)The date and time at which the guardrail was created.
updatedAt
— (Date
)The date and time at which the guardrail was updated.
statusReasons
— (Array<String>
)Appears if the
status
isFAILED
. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.failureRecommendations
— (Array<String>
)Appears if the
status
of the guardrail isFAILED
. A list of recommendations to carry out before retrying the request.blockedInputMessaging
— (String
)The message that the guardrail returns when it blocks a prompt.
blockedOutputsMessaging
— (String
)The message that the guardrail returns when it blocks a model response.
kmsKeyArn
— (String
)The ARN of the KMS key that encrypts the guardrail.
-
(AWS.Response)
—
Returns:
getImportedModel(params = {}, callback) ⇒ AWS.Request
Gets properties associated with a customized model you imported.
Service Reference:
Examples:
Calling the getImportedModel operation
var params = {
modelIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getImportedModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
modelIdentifier
— (String
)Name or Amazon Resource Name (ARN) of the imported model.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:modelArn
— (String
)The Amazon Resource Name (ARN) associated with this imported model.
modelName
— (String
)The name of the imported model.
jobName
— (String
)Job name associated with the imported model.
jobArn
— (String
)Job Amazon Resource Name (ARN) associated with the imported model.
modelDataSource
— (map
)The data source for this imported model.
s3DataSource
— (map
)The Amazon S3 data source of the imported model.
s3Uri
— required — (String
)The URI of the Amazon S3 data source.
creationTime
— (Date
)Creation time of the imported model.
modelArchitecture
— (String
)The architecture of the imported model.
modelKmsKeyArn
— (String
)The imported model is encrypted at rest using this key.
-
(AWS.Response)
—
Returns:
getInferenceProfile(params = {}, callback) ⇒ AWS.Request
Gets information about an inference profile. For more information, see the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the getInferenceProfile operation
var params = {
inferenceProfileIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getInferenceProfile(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
inferenceProfileIdentifier
— (String
)The unique identifier of the inference profile.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:inferenceProfileName
— (String
)The name of the inference profile.
models
— (Array<map>
)A list of information about each model in the inference profile.
modelArn
— (String
)The Amazon Resource Name (ARN) of the model.
description
— (String
)The description of the inference profile.
createdAt
— (Date
)The time at which the inference profile was created.
updatedAt
— (Date
)The time at which the inference profile was last updated.
inferenceProfileArn
— (String
)The Amazon Resource Name (ARN) of the inference profile.
inferenceProfileId
— (String
)The unique identifier of the inference profile.
status
— (String
)The status of the inference profile.
Possible values include:ACTIVE
means that the inference profile is available to use."ACTIVE"
type
— (String
)The type of the inference profile.
Possible values include:SYSTEM_DEFINED
means that the inference profile is defined by Amazon Bedrock."SYSTEM_DEFINED"
-
(AWS.Response)
—
Returns:
getModelCopyJob(params = {}, callback) ⇒ AWS.Request
Retrieves information about a model copy job. For more information, see Copy models to be used in other regions in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the getModelCopyJob operation
var params = {
jobArn: 'STRING_VALUE' /* required */
};
bedrock.getModelCopyJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobArn
— (String
)The Amazon Resource Name (ARN) of the model copy job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the model copy job.
status
— (String
)The status of the model copy job.
Possible values include:"InProgress"
"Completed"
"Failed"
creationTime
— (Date
)The time at which the model copy job was created.
targetModelArn
— (String
)The Amazon Resource Name (ARN) of the copied model.
targetModelName
— (String
)The name of the copied model.
sourceAccountId
— (String
)The unique identifier of the account that the model being copied originated from.
sourceModelArn
— (String
)The Amazon Resource Name (ARN) of the original model being copied.
targetModelKmsKeyArn
— (String
)The Amazon Resource Name (ARN) of the KMS key encrypting the copied model.
targetModelTags
— (Array<map>
)The tags associated with the copied model.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
failureMessage
— (String
)An error message for why the model copy job failed.
sourceModelName
— (String
)The name of the original model being copied.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the getModelCustomizationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getModelCustomizationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)Identifier for the customization job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the customization job.
jobName
— (String
)The name of the customization job.
outputModelName
— (String
)The name of the output model.
outputModelArn
— (String
)The Amazon Resource Name (ARN) of the output model.
clientRequestToken
— (String
)The token that you specified in the
CreateCustomizationJob
request.roleArn
— (String
)The Amazon Resource Name (ARN) of the IAM role.
status
— (String
)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.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
failureMessage
— (String
)Information about why the job failed.
creationTime
— (Date
)Time that the resource was created.
lastModifiedTime
— (Date
)Time that the resource was last modified.
endTime
— (Date
)Time that the resource transitioned to terminal state.
baseModelArn
— (String
)Amazon Resource Name (ARN) of the base model.
hyperParameters
— (map<String>
)The hyperparameter values for the job. For details on the format for different models, see Custom model hyperparameters.
trainingDataConfig
— (map
)Contains information about the training dataset.
s3Uri
— required — (String
)The S3 URI where the training data is stored.
validationDataConfig
— (map
)Contains information about the validation dataset.
validators
— required — (Array<map>
)Information about the validators.
s3Uri
— required — (String
)The S3 URI where the validation data is stored.
outputDataConfig
— (map
)Output data configuration
s3Uri
— required — (String
)The S3 URI where the output data is stored.
customizationType
— (String
)The type of model customization.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
outputModelKmsKeyArn
— (String
)The custom model is encrypted at rest using this key.
trainingMetrics
— (map
)Contains training metrics from the job creation.
trainingLoss
— (Float
)Loss metric associated with the custom job.
validationMetrics
— (Array<map>
)The loss metric for each validator that you provided in the createjob request.
validationLoss
— (Float
)The validation loss associated with this validator.
vpcConfig
— (map
)VPC configuration for the custom model job.
subnetIds
— required — (Array<String>
)VPC configuration subnets.
securityGroupIds
— required — (Array<String>
)VPC configuration security group Ids.
-
(AWS.Response)
—
Returns:
getModelImportJob(params = {}, callback) ⇒ AWS.Request
Retrieves the properties associated with import model job, including the status of the job. For more information, see Import a customized model in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the getModelImportJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getModelImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)The identifier of the import job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the import job.
jobName
— (String
)The name of the import job.
importedModelName
— (String
)The name of the imported model.
importedModelArn
— (String
)The Amazon Resource Name (ARN) of the imported model.
roleArn
— (String
)The Amazon Resource Name (ARN) of the IAM role associated with this job.
modelDataSource
— (map
)The data source for the imported model.
s3DataSource
— (map
)The Amazon S3 data source of the imported model.
s3Uri
— required — (String
)The URI of the Amazon S3 data source.
status
— (String
)The status of the job. A successful job transitions from in-progress to completed when the imported model is ready to use. If the job failed, the failure message contains information about why the job failed.
Possible values include:"InProgress"
"Completed"
"Failed"
failureMessage
— (String
)Information about why the import job failed.
creationTime
— (Date
)The time the resource was created.
lastModifiedTime
— (Date
)Time the resource was last modified.
endTime
— (Date
)Time that the resource transitioned to terminal state.
vpcConfig
— (map
)The Virtual Private Cloud (VPC) configuration of the import model job.
subnetIds
— required — (Array<String>
)VPC configuration subnets.
securityGroupIds
— required — (Array<String>
)VPC configuration security group Ids.
importedModelKmsKeyArn
— (String
)The imported model is encrypted at rest using this key.
-
(AWS.Response)
—
Returns:
getModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Gets details about a batch inference job. For more information, see View details about a batch inference job
Service Reference:
Examples:
Calling the getModelInvocationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.getModelInvocationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)The Amazon Resource Name (ARN) of the batch inference job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobArn
— (String
)The Amazon Resource Name (ARN) of the batch inference job.
jobName
— (String
)The name of the batch inference job.
modelId
— (String
)The unique identifier of the foundation model used for model inference.
clientRequestToken
— (String
)A 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.
roleArn
— (String
)The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
status
— (String
)The status of the batch inference job.
Possible values include:"Submitted"
"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"PartiallyCompleted"
"Expired"
"Validating"
"Scheduled"
message
— (String
)If the batch inference job failed, this field contains a message describing why the job failed.
submitTime
— (Date
)The time at which the batch inference job was submitted.
lastModifiedTime
— (Date
)The time at which the batch inference job was last modified.
endTime
— (Date
)The time at which the batch inference job ended.
inputDataConfig
— (map
)Details about the location of the input to the batch inference job.
s3InputDataConfig
— (map
)Contains the configuration of the S3 location of the input data.
s3InputFormat
— (String
)The format of the input data.
Possible values include:"JSONL"
s3Uri
— required — (String
)The S3 location of the input data.
outputDataConfig
— (map
)Details about the location of the output of the batch inference job.
s3OutputDataConfig
— (map
)Contains the configuration of the S3 location of the output data.
s3Uri
— required — (String
)The S3 location of the output data.
s3EncryptionKeyId
— (String
)The unique identifier of the key that encrypts the S3 location of the output data.
timeoutDurationInHours
— (Integer
)The number of hours after which batch inference job was set to time out.
jobExpirationTime
— (Date
)The time at which the batch inference job times or timed out.
-
(AWS.Response)
—
Returns:
getModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Get the current configuration values for model invocation logging.
Service Reference:
Examples:
Calling the getModelInvocationLoggingConfiguration operation
var params = {
};
bedrock.getModelInvocationLoggingConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:loggingConfig
— (map
)The current configuration values.
cloudWatchConfig
— (map
)CloudWatch logging configuration.
logGroupName
— required — (String
)The log group name.
roleArn
— required — (String
)The role Amazon Resource Name (ARN).
largeDataDeliveryS3Config
— (map
)S3 configuration for delivering a large amount of data.
bucketName
— required — (String
)S3 bucket name.
keyPrefix
— (String
)S3 prefix.
s3Config
— (map
)S3 configuration for storing log data.
bucketName
— required — (String
)S3 bucket name.
keyPrefix
— (String
)S3 prefix.
textDataDeliveryEnabled
— (Boolean
)Set to include text data in the log delivery.
imageDataDeliveryEnabled
— (Boolean
)Set to include image data in the log delivery.
embeddingDataDeliveryEnabled
— (Boolean
)Set to include embeddings data in the log delivery.
-
(AWS.Response)
—
Returns:
getProvisionedModelThroughput(params = {}, callback) ⇒ AWS.Request
Returns details for a Provisioned Throughput. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the getProvisionedModelThroughput operation
var params = {
provisionedModelId: 'STRING_VALUE' /* required */
};
bedrock.getProvisionedModelThroughput(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
provisionedModelId
— (String
)The Amazon Resource Name (ARN) or name of the Provisioned Throughput.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:modelUnits
— (Integer
)The number of model units allocated to this Provisioned Throughput.
desiredModelUnits
— (Integer
)The number of model units that was requested for this Provisioned Throughput.
provisionedModelName
— (String
)The name of the Provisioned Throughput.
provisionedModelArn
— (String
)The Amazon Resource Name (ARN) of the Provisioned Throughput.
modelArn
— (String
)The Amazon Resource Name (ARN) of the model associated with this Provisioned Throughput.
desiredModelArn
— (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.foundationModelArn
— (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
— (String
)The status of the Provisioned Throughput.
Possible values include:"Creating"
"InService"
"Updating"
"Failed"
creationTime
— (Date
)The timestamp of the creation time for this Provisioned Throughput.
lastModifiedTime
— (Date
)The timestamp of the last time that this Provisioned Throughput was modified.
failureMessage
— (String
)A failure message for any issues that occurred during creation, updating, or deletion of the Provisioned Throughput.
commitmentDuration
— (String
)Commitment duration of the Provisioned Throughput.
Possible values include:"OneMonth"
"SixMonths"
commitmentExpirationTime
— (Date
)The timestamp for when the commitment term for the Provisioned Throughput expires.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the listCustomModels operation
var params = {
baseModelArnEquals: 'STRING_VALUE',
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
foundationModelArnEquals: 'STRING_VALUE',
isOwned: true || false,
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending
};
bedrock.listCustomModels(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeBefore
— (Date
)Return custom models created before the specified time.
creationTimeAfter
— (Date
)Return custom models created after the specified time.
nameContains
— (String
)Return custom models only if the job name contains these characters.
baseModelArnEquals
— (String
)Return custom models only if the base model Amazon Resource Name (ARN) matches this parameter.
foundationModelArnEquals
— (String
)Return custom models only if the foundation model Amazon Resource Name (ARN) matches this parameter.
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.sortBy
— (String
)The field to sort by in the returned list of models.
Possible values include:"CreationTime"
sortOrder
— (String
)The sort order of the results.
Possible values include:"Ascending"
"Descending"
isOwned
— (Boolean
)Return custom models depending on if the current account owns them (
true
) or if they were shared with the current account (false
).
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.modelSummaries
— (Array<map>
)Model summaries.
modelArn
— required — (String
)The Amazon Resource Name (ARN) of the custom model.
modelName
— required — (String
)The name of the custom model.
creationTime
— required — (Date
)Creation time of the model.
baseModelArn
— required — (String
)The base model Amazon Resource Name (ARN).
baseModelName
— required — (String
)The base model name.
customizationType
— (String
)Specifies whether to carry out continued pre-training of a model or whether to fine-tune it. For more information, see Custom models.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
ownerAccountId
— (String
)The unique identifier of the account that owns the model.
-
(AWS.Response)
—
Returns:
listEvaluationJobs(params = {}, callback) ⇒ AWS.Request
Lists model evaluation jobs.
Service Reference:
Examples:
Calling the listEvaluationJobs operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
statusEquals: InProgress | Completed | Failed | Stopping | Stopped | Deleting
};
bedrock.listEvaluationJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeAfter
— (Date
)A filter that includes model evaluation jobs created after the time specified.
creationTimeBefore
— (Date
)A filter that includes model evaluation jobs created prior to the time specified.
statusEquals
— (String
)Only return jobs where the status condition is met.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"Deleting"
nameContains
— (String
)Query parameter string for model evaluation job names.
maxResults
— (Integer
)The maximum number of results to return.
nextToken
— (String
)Continuation token from the previous response, for Amazon Bedrock to list the next set of results.
sortBy
— (String
)Allows you to sort model evaluation jobs by when they were created.
Possible values include:"CreationTime"
sortOrder
— (String
)How you want the order of jobs sorted.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)Continuation token from the previous response, for Amazon Bedrock to list the next set of results.
jobSummaries
— (Array<map>
)A summary of the model evaluation jobs.
jobArn
— required — (String
)The Amazon Resource Name (ARN) of the model evaluation job.
jobName
— required — (String
)The name of the model evaluation job.
status
— required — (String
)The current status of the model evaluation job.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"Deleting"
creationTime
— required — (Date
)When the model evaluation job was created.
jobType
— required — (String
)The type, either human or automatic, of model evaluation job.
Possible values include:"Human"
"Automated"
evaluationTaskTypes
— required — (Array<String>
)What task type was used in the model evaluation job.
modelIdentifiers
— required — (Array<String>
)The Amazon Resource Names (ARNs) of the model(s) used in the model evaluation job.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the listFoundationModels operation
var params = {
byCustomizationType: FINE_TUNING | CONTINUED_PRE_TRAINING,
byInferenceType: ON_DEMAND | PROVISIONED,
byOutputModality: TEXT | IMAGE | EMBEDDING,
byProvider: 'STRING_VALUE'
};
bedrock.listFoundationModels(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
byProvider
— (String
)Return models belonging to the model provider that you specify.
byCustomizationType
— (String
)Return models that support the customization type that you specify. For more information, see Custom models in the Amazon Bedrock User Guide.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
byOutputModality
— (String
)Return models that support the output modality that you specify.
Possible values include:"TEXT"
"IMAGE"
"EMBEDDING"
byInferenceType
— (String
)Return models that support the inference type that you specify. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
Possible values include:"ON_DEMAND"
"PROVISIONED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:modelSummaries
— (Array<map>
)A list of Amazon Bedrock foundation models.
modelArn
— required — (String
)The Amazon Resource Name (ARN) of the foundation model.
modelId
— required — (String
)The model ID of the foundation model.
modelName
— (String
)The name of the model.
providerName
— (String
)The model's provider name.
inputModalities
— (Array<String>
)The input modalities that the model supports.
outputModalities
— (Array<String>
)The output modalities that the model supports.
responseStreamingSupported
— (Boolean
)Indicates whether the model supports streaming.
customizationsSupported
— (Array<String>
)Whether the model supports fine-tuning or continual pre-training.
inferenceTypesSupported
— (Array<String>
)The inference types that the model supports.
modelLifecycle
— (map
)Contains details about whether a model version is available or deprecated.
status
— required — (String
)Specifies whether a model version is available (
Possible values include:ACTIVE
) or deprecated (LEGACY
."ACTIVE"
"LEGACY"
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the listGuardrails operation
var params = {
guardrailIdentifier: 'STRING_VALUE',
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
bedrock.listGuardrails(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
guardrailIdentifier
— (String
)The unique identifier of the guardrail. This can be an ID or the ARN.
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:guardrails
— (Array<map>
)A list of objects, each of which contains details about a guardrail.
id
— required — (String
)The unique identifier of the guardrail.
arn
— required — (String
)The ARN of the guardrail.
status
— required — (String
)The status of the guardrail.
Possible values include:"CREATING"
"UPDATING"
"VERSIONING"
"READY"
"FAILED"
"DELETING"
name
— required — (String
)The name of the guardrail.
description
— (String
)A description of the guardrail.
version
— required — (String
)The version of the guardrail.
createdAt
— required — (Date
)The date and time at which the guardrail was created.
updatedAt
— required — (Date
)The date and time at which the guardrail was last updated.
nextToken
— (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.
-
(AWS.Response)
—
Returns:
listImportedModels(params = {}, callback) ⇒ AWS.Request
Returns a list of models you've imported. You can filter the results to return based on one or more criteria. For more information, see Import a customized model in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the listImportedModels operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending
};
bedrock.listImportedModels(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeBefore
— (Date
)Return imported models that created before the specified time.
creationTimeAfter
— (Date
)Return imported models that were created after the specified time.
nameContains
— (String
)Return imported models only if the model name contains these characters.
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.sortBy
— (String
)The field to sort by in the returned list of imported models.
Possible values include:"CreationTime"
sortOrder
— (String
)Specifies whetehr to sort the results in ascending or descending order.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.modelSummaries
— (Array<map>
)Model summaries.
modelArn
— required — (String
)The Amazon Resource Name (ARN) of the imported model.
modelName
— required — (String
)Name of the imported model.
creationTime
— required — (Date
)Creation time of the imported model.
-
(AWS.Response)
—
Returns:
listInferenceProfiles(params = {}, callback) ⇒ AWS.Request
Returns a list of inference profiles that you can use.
Service Reference:
Examples:
Calling the listInferenceProfiles operation
var params = {
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
bedrock.listInferenceProfiles(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:inferenceProfileSummaries
— (Array<map>
)A list of information about each inference profile that you can use.
inferenceProfileName
— required — (String
)The name of the inference profile.
models
— required — (Array<map>
)A list of information about each model in the inference profile.
modelArn
— (String
)The Amazon Resource Name (ARN) of the model.
description
— (String
)The description of the inference profile.
createdAt
— (Date
)The time at which the inference profile was created.
updatedAt
— (Date
)The time at which the inference profile was last updated.
inferenceProfileArn
— required — (String
)The Amazon Resource Name (ARN) of the inference profile.
inferenceProfileId
— required — (String
)The unique identifier of the inference profile.
status
— required — (String
)The status of the inference profile.
Possible values include:ACTIVE
means that the inference profile is available to use."ACTIVE"
type
— required — (String
)The type of the inference profile.
Possible values include:SYSTEM_DEFINED
means that the inference profile is defined by Amazon Bedrock."SYSTEM_DEFINED"
nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.
-
(AWS.Response)
—
Returns:
listModelCopyJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of model copy jobs that you have submitted. You can filter the jobs to return based on one or more criteria. For more information, see Copy models to be used in other regions in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the listModelCopyJobs operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
sourceAccountEquals: 'STRING_VALUE',
sourceModelArnEquals: 'STRING_VALUE',
statusEquals: InProgress | Completed | Failed,
targetModelNameContains: 'STRING_VALUE'
};
bedrock.listModelCopyJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeAfter
— (Date
)Filters for model copy jobs created after the specified time.
creationTimeBefore
— (Date
)Filters for model copy jobs created before the specified time.
statusEquals
— (String
)Filters for model copy jobs whose status matches the value that you specify.
Possible values include:"InProgress"
"Completed"
"Failed"
sourceAccountEquals
— (String
)Filters for model copy jobs in which the account that the source model belongs to is equal to the value that you specify.
sourceModelArnEquals
— (String
)Filters for model copy jobs in which the Amazon Resource Name (ARN) of the source model to is equal to the value that you specify.
targetModelNameContains
— (String
)Filters for model copy jobs in which the name of the copied model contains the string that you specify.
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.sortBy
— (String
)The field to sort by in the returned list of model copy jobs.
Possible values include:"CreationTime"
sortOrder
— (String
)Specifies whether to sort the results in ascending or descending order.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.modelCopyJobSummaries
— (Array<map>
)A list of information about each model copy job.
jobArn
— required — (String
)The Amazon Resoource Name (ARN) of the model copy job.
status
— required — (String
)The status of the model copy job.
Possible values include:"InProgress"
"Completed"
"Failed"
creationTime
— required — (Date
)The time that the model copy job was created.
targetModelArn
— required — (String
)The Amazon Resource Name (ARN) of the copied model.
targetModelName
— (String
)The name of the copied model.
sourceAccountId
— required — (String
)The unique identifier of the account that the model being copied originated from.
sourceModelArn
— required — (String
)The Amazon Resource Name (ARN) of the original model being copied.
targetModelKmsKeyArn
— (String
)The Amazon Resource Name (ARN) of the KMS key used to encrypt the copied model.
targetModelTags
— (Array<map>
)Tags associated with the copied model.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
failureMessage
— (String
)If a model fails to be copied, a message describing why the job failed is included here.
sourceModelName
— (String
)The name of the original model being copied.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the listModelCustomizationJobs operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
statusEquals: InProgress | Completed | Failed | Stopping | Stopped
};
bedrock.listModelCustomizationJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeAfter
— (Date
)Return customization jobs created after the specified time.
creationTimeBefore
— (Date
)Return customization jobs created before the specified time.
statusEquals
— (String
)Return customization jobs with the specified status.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
nameContains
— (String
)Return customization jobs only if the job name contains these characters.
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.sortBy
— (String
)The field to sort by in the returned list of jobs.
Possible values include:"CreationTime"
sortOrder
— (String
)The sort order of the results.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.modelCustomizationJobSummaries
— (Array<map>
)Job summaries.
jobArn
— required — (String
)Amazon Resource Name (ARN) of the customization job.
baseModelArn
— required — (String
)Amazon Resource Name (ARN) of the base model.
jobName
— required — (String
)Name of the customization job.
status
— required — (String
)Status of the customization job.
Possible values include:"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
lastModifiedTime
— (Date
)Time that the customization job was last modified.
creationTime
— required — (Date
)Creation time of the custom model.
endTime
— (Date
)Time that the customization job ended.
customModelArn
— (String
)Amazon Resource Name (ARN) of the custom model.
customModelName
— (String
)Name of the custom model.
customizationType
— (String
)Specifies whether to carry out continued pre-training of a model or whether to fine-tune it. For more information, see Custom models.
Possible values include:"FINE_TUNING"
"CONTINUED_PRE_TRAINING"
-
(AWS.Response)
—
Returns:
listModelImportJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of import jobs you've submitted. You can filter the results to return based on one or more criteria. For more information, see Import a customized model in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the listModelImportJobs operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
statusEquals: InProgress | Completed | Failed
};
bedrock.listModelImportJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeAfter
— (Date
)Return import jobs that were created after the specified time.
creationTimeBefore
— (Date
)Return import jobs that were created before the specified time.
statusEquals
— (String
)Return imported jobs with the specified status.
Possible values include:"InProgress"
"Completed"
"Failed"
nameContains
— (String
)Return imported jobs only if the job name contains these characters.
maxResults
— (Integer
)The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.sortBy
— (String
)The field to sort by in the returned list of imported jobs.
Possible values include:"CreationTime"
sortOrder
— (String
)Specifies whether to sort the results in ascending or descending order.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.modelImportJobSummaries
— (Array<map>
)Import job summaries.
jobArn
— required — (String
)The Amazon Resource Name (ARN) of the import job.
jobName
— required — (String
)The name of the import job.
status
— required — (String
)The status of the imported job.
Possible values include:"InProgress"
"Completed"
"Failed"
lastModifiedTime
— (Date
)The time when the import job was last modified.
creationTime
— required — (Date
)The time import job was created.
endTime
— (Date
)The time when import job ended.
importedModelArn
— (String
)The Amazon resource Name (ARN) of the imported model.
importedModelName
— (String
)The name of the imported model.
-
(AWS.Response)
—
Returns:
listModelInvocationJobs(params = {}, callback) ⇒ AWS.Request
Lists all batch inference jobs in the account. For more information, see View details about a batch inference job.
Service Reference:
Examples:
Calling the listModelInvocationJobs operation
var params = {
maxResults: 'NUMBER_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
statusEquals: Submitted | InProgress | Completed | Failed | Stopping | Stopped | PartiallyCompleted | Expired | Validating | Scheduled,
submitTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
submitTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
};
bedrock.listModelInvocationJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
submitTimeAfter
— (Date
)Specify a time to filter for batch inference jobs that were submitted after the time you specify.
submitTimeBefore
— (Date
)Specify a time to filter for batch inference jobs that were submitted before the time you specify.
statusEquals
— (String
)Specify a status to filter for batch inference jobs whose statuses match the string you specify.
Possible values include:"Submitted"
"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"PartiallyCompleted"
"Expired"
"Validating"
"Scheduled"
nameContains
— (String
)Specify a string to filter for batch inference jobs whose names contain the string.
maxResults
— (Integer
)The maximum number of results to return. If there are more results than the number that you specify, a
nextToken
value is returned. Use thenextToken
in a request to return the next batch of results.nextToken
— (String
)If there were more results than the value you specified in the
maxResults
field in a previousListModelInvocationJobs
request, the response would have returned anextToken
value. To see the next batch of results, send thenextToken
value in another request.sortBy
— (String
)An attribute by which to sort the results.
Possible values include:"CreationTime"
sortOrder
— (String
)Specifies whether to sort the results by ascending or descending order.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)If there are more results than can fit in the response, a
nextToken
is returned. Use thenextToken
in a request to return the next batch of results.invocationJobSummaries
— (Array<map>
)A list of items, each of which contains a summary about a batch inference job.
jobArn
— required — (String
)The Amazon Resource Name (ARN) of the batch inference job.
jobName
— required — (String
)The name of the batch inference job.
modelId
— required — (String
)The unique identifier of the foundation model used for model inference.
clientRequestToken
— (String
)A 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.
roleArn
— required — (String
)The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
status
— (String
)The status of the batch inference job.
Possible values include:"Submitted"
"InProgress"
"Completed"
"Failed"
"Stopping"
"Stopped"
"PartiallyCompleted"
"Expired"
"Validating"
"Scheduled"
message
— (String
)If the batch inference job failed, this field contains a message describing why the job failed.
submitTime
— required — (Date
)The time at which the batch inference job was submitted.
lastModifiedTime
— (Date
)The time at which the batch inference job was last modified.
endTime
— (Date
)The time at which the batch inference job ended.
inputDataConfig
— required — (map
)Details about the location of the input to the batch inference job.
s3InputDataConfig
— (map
)Contains the configuration of the S3 location of the input data.
s3InputFormat
— (String
)The format of the input data.
Possible values include:"JSONL"
s3Uri
— required — (String
)The S3 location of the input data.
outputDataConfig
— required — (map
)Details about the location of the output of the batch inference job.
s3OutputDataConfig
— (map
)Contains the configuration of the S3 location of the output data.
s3Uri
— required — (String
)The S3 location of the output data.
s3EncryptionKeyId
— (String
)The unique identifier of the key that encrypts the S3 location of the output data.
timeoutDurationInHours
— (Integer
)The number of hours after which the batch inference job was set to time out.
jobExpirationTime
— (Date
)The time at which the batch inference job times or timed out.
-
(AWS.Response)
—
Returns:
listProvisionedModelThroughputs(params = {}, callback) ⇒ AWS.Request
Lists the Provisioned Throughputs in the account. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the listProvisionedModelThroughputs operation
var params = {
creationTimeAfter: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
creationTimeBefore: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
maxResults: 'NUMBER_VALUE',
modelArnEquals: 'STRING_VALUE',
nameContains: 'STRING_VALUE',
nextToken: 'STRING_VALUE',
sortBy: CreationTime,
sortOrder: Ascending | Descending,
statusEquals: Creating | InService | Updating | Failed
};
bedrock.listProvisionedModelThroughputs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
creationTimeAfter
— (Date
)A filter that returns Provisioned Throughputs created after the specified time.
creationTimeBefore
— (Date
)A filter that returns Provisioned Throughputs created before the specified time.
statusEquals
— (String
)A filter that returns Provisioned Throughputs if their statuses matches the value that you specify.
Possible values include:"Creating"
"InService"
"Updating"
"Failed"
modelArnEquals
— (String
)A filter that returns Provisioned Throughputs whose model Amazon Resource Name (ARN) is equal to the value that you specify.
nameContains
— (String
)A filter that returns Provisioned Throughputs if their name contains the expression that you specify.
maxResults
— (Integer
)THe 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.nextToken
— (String
)If 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.sortBy
— (String
)The field by which to sort the returned list of Provisioned Throughputs.
Possible values include:"CreationTime"
sortOrder
— (String
)The sort order of the results.
Possible values include:"Ascending"
"Descending"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (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.provisionedModelSummaries
— (Array<map>
)A list of summaries, one for each Provisioned Throughput in the response.
provisionedModelName
— required — (String
)The name of the Provisioned Throughput.
provisionedModelArn
— required — (String
)The Amazon Resource Name (ARN) of the Provisioned Throughput.
modelArn
— required — (String
)The Amazon Resource Name (ARN) of the model associated with the Provisioned Throughput.
desiredModelArn
— required — (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.foundationModelArn
— required — (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.
modelUnits
— required — (Integer
)The number of model units allocated to the Provisioned Throughput.
desiredModelUnits
— required — (Integer
)The number of model units that was requested to be allocated to the Provisioned Throughput.
status
— required — (String
)The status of the Provisioned Throughput.
Possible values include:"Creating"
"InService"
"Updating"
"Failed"
commitmentDuration
— (String
)The duration for which the Provisioned Throughput was committed.
Possible values include:"OneMonth"
"SixMonths"
commitmentExpirationTime
— (Date
)The timestamp for when the commitment term of the Provisioned Throughput expires.
creationTime
— required — (Date
)The time that the Provisioned Throughput was created.
lastModifiedTime
— required — (Date
)The time that the Provisioned Throughput was last modified.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the listTagsForResource operation
var params = {
resourceARN: 'STRING_VALUE' /* required */
};
bedrock.listTagsForResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceARN
— (String
)The Amazon Resource Name (ARN) of the resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:tags
— (Array<map>
)An array of the tags associated with this resource.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
-
(AWS.Response)
—
Returns:
putModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request
Set the configuration values for model invocation logging.
Service Reference:
Examples:
Calling the putModelInvocationLoggingConfiguration operation
var params = {
loggingConfig: { /* required */
cloudWatchConfig: {
logGroupName: 'STRING_VALUE', /* required */
roleArn: 'STRING_VALUE', /* required */
largeDataDeliveryS3Config: {
bucketName: 'STRING_VALUE', /* required */
keyPrefix: 'STRING_VALUE'
}
},
embeddingDataDeliveryEnabled: true || false,
imageDataDeliveryEnabled: true || false,
s3Config: {
bucketName: 'STRING_VALUE', /* required */
keyPrefix: 'STRING_VALUE'
},
textDataDeliveryEnabled: true || false
}
};
bedrock.putModelInvocationLoggingConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
loggingConfig
— (map
)The logging configuration values to set.
cloudWatchConfig
— (map
)CloudWatch logging configuration.
logGroupName
— required — (String
)The log group name.
roleArn
— required — (String
)The role Amazon Resource Name (ARN).
largeDataDeliveryS3Config
— (map
)S3 configuration for delivering a large amount of data.
bucketName
— required — (String
)S3 bucket name.
keyPrefix
— (String
)S3 prefix.
s3Config
— (map
)S3 configuration for storing log data.
bucketName
— required — (String
)S3 bucket name.
keyPrefix
— (String
)S3 prefix.
textDataDeliveryEnabled
— (Boolean
)Set to include text data in the log delivery.
imageDataDeliveryEnabled
— (Boolean
)Set to include image data in the log delivery.
embeddingDataDeliveryEnabled
— (Boolean
)Set to include embeddings data in the log delivery.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
stopEvaluationJob(params = {}, callback) ⇒ AWS.Request
Stops an in progress model evaluation job.
Service Reference:
Examples:
Calling the stopEvaluationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.stopEvaluationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)The ARN of the model evaluation job you want to stop.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
stopModelCustomizationJob(params = {}, callback) ⇒ AWS.Request
Stops an active model customization job. For more information, see Custom models in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the stopModelCustomizationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.stopModelCustomizationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)Job identifier of the job to stop.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
stopModelInvocationJob(params = {}, callback) ⇒ AWS.Request
Stops a batch inference job. You're only charged for tokens that were already processed. For more information, see Stop a batch inference job.
Service Reference:
Examples:
Calling the stopModelInvocationJob operation
var params = {
jobIdentifier: 'STRING_VALUE' /* required */
};
bedrock.stopModelInvocationJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobIdentifier
— (String
)The Amazon Resource Name (ARN) of the batch inference job to stop.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
Service Reference:
Examples:
Calling the tagResource operation
var params = {
resourceARN: 'STRING_VALUE', /* required */
tags: [ /* required */
{
key: 'STRING_VALUE', /* required */
value: 'STRING_VALUE' /* required */
},
/* more items */
]
};
bedrock.tagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceARN
— (String
)The Amazon Resource Name (ARN) of the resource to tag.
tags
— (Array<map>
)Tags to associate with the resource.
key
— required — (String
)Key for the tag.
value
— required — (String
)Value for the tag.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the untagResource operation
var params = {
resourceARN: 'STRING_VALUE', /* required */
tagKeys: [ /* required */
'STRING_VALUE',
/* more items */
]
};
bedrock.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceARN
— (String
)The Amazon Resource Name (ARN) of the resource to untag.
tagKeys
— (Array<String>
)Tag keys of the tags to remove from the resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the updateGuardrail operation
var params = {
blockedInputMessaging: 'STRING_VALUE', /* required */
blockedOutputsMessaging: 'STRING_VALUE', /* required */
guardrailIdentifier: 'STRING_VALUE', /* required */
name: 'STRING_VALUE', /* required */
contentPolicyConfig: {
filtersConfig: [ /* required */
{
inputStrength: NONE | LOW | MEDIUM | HIGH, /* required */
outputStrength: NONE | LOW | MEDIUM | HIGH, /* required */
type: SEXUAL | VIOLENCE | HATE | INSULTS | MISCONDUCT | PROMPT_ATTACK /* required */
},
/* more items */
]
},
contextualGroundingPolicyConfig: {
filtersConfig: [ /* required */
{
threshold: 'NUMBER_VALUE', /* required */
type: GROUNDING | RELEVANCE /* required */
},
/* more items */
]
},
description: 'STRING_VALUE',
kmsKeyId: 'STRING_VALUE',
sensitiveInformationPolicyConfig: {
piiEntitiesConfig: [
{
action: BLOCK | ANONYMIZE, /* required */
type: ADDRESS | AGE | AWS_ACCESS_KEY | AWS_SECRET_KEY | CA_HEALTH_NUMBER | CA_SOCIAL_INSURANCE_NUMBER | CREDIT_DEBIT_CARD_CVV | CREDIT_DEBIT_CARD_EXPIRY | CREDIT_DEBIT_CARD_NUMBER | DRIVER_ID | EMAIL | INTERNATIONAL_BANK_ACCOUNT_NUMBER | IP_ADDRESS | LICENSE_PLATE | MAC_ADDRESS | NAME | PASSWORD | PHONE | PIN | SWIFT_CODE | UK_NATIONAL_HEALTH_SERVICE_NUMBER | UK_NATIONAL_INSURANCE_NUMBER | UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER | URL | USERNAME | US_BANK_ACCOUNT_NUMBER | US_BANK_ROUTING_NUMBER | US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER | US_PASSPORT_NUMBER | US_SOCIAL_SECURITY_NUMBER | VEHICLE_IDENTIFICATION_NUMBER /* required */
},
/* more items */
],
regexesConfig: [
{
action: BLOCK | ANONYMIZE, /* required */
name: 'STRING_VALUE', /* required */
pattern: 'STRING_VALUE', /* required */
description: 'STRING_VALUE'
},
/* more items */
]
},
topicPolicyConfig: {
topicsConfig: [ /* required */
{
definition: 'STRING_VALUE', /* required */
name: 'STRING_VALUE', /* required */
type: DENY, /* required */
examples: [
'STRING_VALUE',
/* more items */
]
},
/* more items */
]
},
wordPolicyConfig: {
managedWordListsConfig: [
{
type: PROFANITY /* required */
},
/* more items */
],
wordsConfig: [
{
text: 'STRING_VALUE' /* required */
},
/* more items */
]
}
};
bedrock.updateGuardrail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
guardrailIdentifier
— (String
)The unique identifier of the guardrail. This can be an ID or the ARN.
name
— (String
)A name for the guardrail.
description
— (String
)A description of the guardrail.
topicPolicyConfig
— (map
)The topic policy to configure for the guardrail.
topicsConfig
— required — (Array<map>
)A list of policies related to topics that the guardrail should deny.
name
— required — (String
)The name of the topic to deny.
definition
— required — (String
)A definition of the topic to deny.
examples
— (Array<String>
)A list of prompts, each of which is an example of a prompt that can be categorized as belonging to the topic.
type
— required — (String
)Specifies to deny the topic.
Possible values include:"DENY"
contentPolicyConfig
— (map
)The content policy to configure for the guardrail.
filtersConfig
— required — (Array<map>
)Contains the type of the content filter and how strongly it should apply to prompts and model responses.
type
— required — (String
)The harmful category that the content filter is applied to.
Possible values include:"SEXUAL"
"VIOLENCE"
"HATE"
"INSULTS"
"MISCONDUCT"
"PROMPT_ATTACK"
inputStrength
— required — (String
)The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
outputStrength
— required — (String
)The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.
Possible values include:"NONE"
"LOW"
"MEDIUM"
"HIGH"
wordPolicyConfig
— (map
)The word policy to configure for the guardrail.
wordsConfig
— (Array<map>
)A list of words to configure for the guardrail.
text
— required — (String
)Text of the word configured for the guardrail to block.
managedWordListsConfig
— (Array<map>
)A list of managed words to configure for the guardrail.
type
— required — (String
)The managed word type to configure for the guardrail.
Possible values include:"PROFANITY"
sensitiveInformationPolicyConfig
— (map
)The sensitive information policy to configure for the guardrail.
piiEntitiesConfig
— (Array<map>
)A list of PII entities to configure to the guardrail.
type
— required — (String
)Configure guardrail type when the PII entity is detected.
The following PIIs are used to block or mask sensitive information:
-
General
-
ADDRESS
A physical address, such as "100 Main Street, Anytown, USA" or "Suite #12, Building 123". An address can include information such as the street, building, location, city, state, country, county, zip code, precinct, and neighborhood.
-
AGE
An individual's age, including the quantity and unit of time. For example, in the phrase "I am 40 years old," Guarrails recognizes "40 years" as an age.
-
NAME
An individual's name. This entity type does not include titles, such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this entity type to names that are part of organizations or addresses. For example, guardrails recognizes the "John Doe Organization" as an organization, and it recognizes "Jane Doe Street" as an address.
-
EMAIL
An email address, such as marymajor@email.com.
-
PHONE
A phone number. This entity type also includes fax and pager numbers.
-
USERNAME
A user name that identifies an account, such as a login name, screen name, nick name, or handle.
-
PASSWORD
An alphanumeric string that is used as a password, such as "very20special#pass".
-
DRIVER_ID
The number assigned to a driver's license, which is an official document permitting an individual to operate one or more motorized vehicles on a public road. A driver's license number consists of alphanumeric characters.
-
LICENSE_PLATE
A license plate for a vehicle is issued by the state or country where the vehicle is registered. The format for passenger vehicles is typically five to eight digits, consisting of upper-case letters and numbers. The format varies depending on the location of the issuing state or country.
-
VEHICLE_IDENTIFICATION_NUMBER
A Vehicle Identification Number (VIN) uniquely identifies a vehicle. VIN content and format are defined in the ISO 3779 specification. Each country has specific codes and formats for VINs.
-
-
Finance
-
REDIT_DEBIT_CARD_CVV
A three-digit card verification code (CVV) that is present on VISA, MasterCard, and Discover credit and debit cards. For American Express credit or debit cards, the CVV is a four-digit numeric code.
-
CREDIT_DEBIT_CARD_EXPIRY
The expiration date for a credit or debit card. This number is usually four digits long and is often formatted as month/year or MM/YY. Guardrails recognizes expiration dates such as 01/21, 01/2021, and Jan 2021.
-
CREDIT_DEBIT_CARD_NUMBER
The number for a credit or debit card. These numbers can vary from 13 to 16 digits in length. However, Amazon Comprehend also recognizes credit or debit card numbers when only the last four digits are present.
-
PIN
A four-digit personal identification number (PIN) with which you can access your bank account.
-
INTERNATIONAL_BANK_ACCOUNT_NUMBER
An International Bank Account Number has specific formats in each country. For more information, see www.iban.com/structure.
-
SWIFT_CODE
A SWIFT code is a standard format of Bank Identifier Code (BIC) used to specify a particular bank or branch. Banks use these codes for money transfers such as international wire transfers.
SWIFT codes consist of eight or 11 characters. The 11-digit codes refer to specific branches, while eight-digit codes (or 11-digit codes ending in 'XXX') refer to the head or primary office.
-
-
IT
-
IP_ADDRESS
An IPv4 address, such as 198.51.100.0.
-
MAC_ADDRESS
A media access control (MAC) address is a unique identifier assigned to a network interface controller (NIC).
-
URL
A web address, such as www.example.com.
-
AWS_ACCESS_KEY
A unique identifier that's associated with a secret access key; you use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
-
AWS_SECRET_KEY
A unique identifier that's associated with an access key. You use the access key ID and secret access key to sign programmatic Amazon Web Services requests cryptographically.
-
-
USA specific
-
US_BANK_ACCOUNT_NUMBER
A US bank account number, which is typically 10 to 12 digits long.
-
US_BANK_ROUTING_NUMBER
A US bank account routing number. These are typically nine digits long,
-
US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER
A US Individual Taxpayer Identification Number (ITIN) is a nine-digit number that starts with a "9" and contain a "7" or "8" as the fourth digit. An ITIN can be formatted with a space or a dash after the third and forth digits.
-
US_PASSPORT_NUMBER
A US passport number. Passport numbers range from six to nine alphanumeric characters.
-
US_SOCIAL_SECURITY_NUMBER
A US Social Security Number (SSN) is a nine-digit number that is issued to US citizens, permanent residents, and temporary working residents.
-
-
Canada specific
-
CA_HEALTH_NUMBER
A Canadian Health Service Number is a 10-digit unique identifier, required for individuals to access healthcare benefits.
-
CA_SOCIAL_INSURANCE_NUMBER
A Canadian Social Insurance Number (SIN) is a nine-digit unique identifier, required for individuals to access government programs and benefits.
The SIN is formatted as three groups of three digits, such as 123-456-789. A SIN can be validated through a simple check-digit process called the Luhn algorithm.
-
-
UK Specific
-
UK_NATIONAL_HEALTH_SERVICE_NUMBER
A UK National Health Service Number is a 10-17 digit number, such as 485 777 3456. The current system formats the 10-digit number with spaces after the third and sixth digits. The final digit is an error-detecting checksum.
-
UK_NATIONAL_INSURANCE_NUMBER
A UK National Insurance Number (NINO) provides individuals with access to National Insurance (social security) benefits. It is also used for some purposes in the UK tax system.
The number is nine digits long and starts with two letters, followed by six numbers and one letter. A NINO can be formatted with a space or a dash after the two letters and after the second, forth, and sixth digits.
-
UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER
A UK Unique Taxpayer Reference (UTR) is a 10-digit number that identifies a taxpayer or a business.
-
-
Custom
-
Regex filter - You can use a regular expressions to define patterns for a guardrail to recognize and act upon such as serial number, booking ID etc..
-
"ADDRESS"
"AGE"
"AWS_ACCESS_KEY"
"AWS_SECRET_KEY"
"CA_HEALTH_NUMBER"
"CA_SOCIAL_INSURANCE_NUMBER"
"CREDIT_DEBIT_CARD_CVV"
"CREDIT_DEBIT_CARD_EXPIRY"
"CREDIT_DEBIT_CARD_NUMBER"
"DRIVER_ID"
"EMAIL"
"INTERNATIONAL_BANK_ACCOUNT_NUMBER"
"IP_ADDRESS"
"LICENSE_PLATE"
"MAC_ADDRESS"
"NAME"
"PASSWORD"
"PHONE"
"PIN"
"SWIFT_CODE"
"UK_NATIONAL_HEALTH_SERVICE_NUMBER"
"UK_NATIONAL_INSURANCE_NUMBER"
"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"
"URL"
"USERNAME"
"US_BANK_ACCOUNT_NUMBER"
"US_BANK_ROUTING_NUMBER"
"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"
"US_PASSPORT_NUMBER"
"US_SOCIAL_SECURITY_NUMBER"
"VEHICLE_IDENTIFICATION_NUMBER"
-
action
— required — (String
)Configure guardrail action when the PII entity is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
regexesConfig
— (Array<map>
)A list of regular expressions to configure to the guardrail.
name
— required — (String
)The name of the regular expression to configure for the guardrail.
description
— (String
)The description of the regular expression to configure for the guardrail.
pattern
— required — (String
)The regular expression pattern to configure for the guardrail.
action
— required — (String
)The guardrail action to configure when matching regular expression is detected.
Possible values include:"BLOCK"
"ANONYMIZE"
contextualGroundingPolicyConfig
— (map
)The contextual grounding policy configuration used to update a guardrail.
filtersConfig
— required — (Array<map>
)The filter configuration details for the guardrails contextual grounding policy.
type
— required — (String
)The filter details for the guardrails contextual grounding filter.
Possible values include:"GROUNDING"
"RELEVANCE"
threshold
— required — (Float
)The threshold details for the guardrails contextual grounding filter.
blockedInputMessaging
— (String
)The message to return when the guardrail blocks a prompt.
blockedOutputsMessaging
— (String
)The message to return when the guardrail blocks a model response.
kmsKeyId
— (String
)The ARN of the KMS key with which to encrypt the guardrail.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:guardrailId
— (String
)The unique identifier of the guardrail
guardrailArn
— (String
)The ARN of the guardrail.
version
— (String
)The version of the guardrail.
updatedAt
— (Date
)The date and time at which the guardrail was updated.
-
(AWS.Response)
—
Returns:
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.
Service Reference:
Examples:
Calling the updateProvisionedModelThroughput operation
var params = {
provisionedModelId: 'STRING_VALUE', /* required */
desiredModelId: 'STRING_VALUE',
desiredProvisionedModelName: 'STRING_VALUE'
};
bedrock.updateProvisionedModelThroughput(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
provisionedModelId
— (String
)The Amazon Resource Name (ARN) or name of the Provisioned Throughput to update.
desiredProvisionedModelName
— (String
)The new name for this Provisioned Throughput.
desiredModelId
— (String
)The 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.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
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.
Parameters:
-
state
(String)
—
the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.
-
params
(map)
(defaults to: {})
—
a list of parameters for the given state. See each waiter resource state for required parameters.
Callback (callback):
-
function(err, data) { ... }
Callback containing error and data information. See the respective resource state for the expected error or data information.
If the waiter times out its requests, it will return a
ResourceNotReady
error.
Returns: