We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.Bedrock

Inherits:
AWS.Service show all
Identifier:
bedrock
API Version:
2023-04-20
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

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

Sending a Request Using Bedrock

var bedrock = new AWS.Bedrock();
bedrock.createEvaluationJob(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the Bedrock object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var bedrock = new AWS.Bedrock({apiVersion: '2023-04-20'});

You can also set the API version globally in AWS.config.apiVersions using the bedrock service identifier:

AWS.config.apiVersions = {
  bedrock: '2023-04-20',
  // other service API versions
};

var bedrock = new AWS.Bedrock();

Version:

  • 2023-04-20

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

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.
  • 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 to true.

  • 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

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createEvaluationJob(params = {}, callback) ⇒ AWS.Request

API operation for creating and managing Amazon Bedrock automatic model evaluation jobs and model evaluation jobs that use human workers. To learn more about the requirements for creating a model evaluation job see, Model evaluations.

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 the iam: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.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (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.

        • datasetMetricConfigsrequired — (Array<map>)

          Specifies the required elements for an automatic model evaluation job.

          • taskTyperequired — (String)

            The task type you want the model to carry out.

            Possible values include:
            • "Summarization"
            • "Classification"
            • "QuestionAndAnswer"
            • "Generation"
            • "Custom"
          • datasetrequired — (map)

            Specifies the prompt dataset.

            • namerequired — (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 and Builtin.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.

          • metricNamesrequired — (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 the name parameter specified in HumanEvaluationCustomMetric.

      • 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.

          • flowDefinitionArnrequired — (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.

          • namerequired — (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.

          • ratingMethodrequired — (String)

            Choose how you want your human workers to evaluation your model. Valid values for rating methods are ThumbsUpDown, IndividualLikertScale,ComparisonLikertScale, ComparisonChoice, and ComparisonRank

        • datasetMetricConfigsrequired — (Array<map>)

          Use to specify the metrics, task, and prompt dataset to be used in your model evaluation job.

          • taskTyperequired — (String)

            The task type you want the model to carry out.

            Possible values include:
            • "Summarization"
            • "Classification"
            • "QuestionAndAnswer"
            • "Generation"
            • "Custom"
          • datasetrequired — (map)

            Specifies the prompt dataset.

            • namerequired — (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 and Builtin.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.

          • metricNamesrequired — (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 the name parameter specified in HumanEvaluationCustomMetric.

    • 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.

          • modelIdentifierrequired — (String)

            The ARN of the Amazon Bedrock model specified.

          • inferenceParamsrequired — (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.

      • s3Urirequired — (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. The data object has the following properties:

      • jobArn — (String)

        The ARN of the model evaluation job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createGuardrail(params = {}, callback) ⇒ AWS.Request

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

  • Specify a name and optional description.

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

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

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

    • Specify DENY in the type field.

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

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

    • Specify the category in the type field.

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

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

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

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 */
    ]
  },
  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.

      • topicsConfigrequired — (Array<map>)

        A list of policies related to topics that the guardrail should deny.

        • namerequired — (String)

          The name of the topic to deny.

        • definitionrequired — (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.

        • typerequired — (String)

          Specifies to deny the topic.

          Possible values include:
          • "DENY"
    • contentPolicyConfig — (map)

      The content filter policies to configure for the guardrail.

      • filtersConfigrequired — (Array<map>)

        Contains the type of the content filter and how strongly it should apply to prompts and model responses.

        • typerequired — (String)

          The harmful category that the content filter is applied to.

          Possible values include:
          • "SEXUAL"
          • "VIOLENCE"
          • "HATE"
          • "INSULTS"
          • "MISCONDUCT"
          • "PROMPT_ATTACK"
        • inputStrengthrequired — (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"
        • outputStrengthrequired — (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.

        • textrequired — (String)

          Text of the word configured for the guardrail to block.

      • managedWordListsConfig — (Array<map>)

        A list of managed words to configure for the guardrail.

        • typerequired — (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.

        • typerequired — (String)

          Configure guardrail type when the PII entity is detected.

          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"
        • actionrequired — (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.

        • namerequired — (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.

        • patternrequired — (String)

          The regular expression pattern to configure for the guardrail.

        • actionrequired — (String)

          The guardrail action to configure when matching regular expression is detected.

          Possible values include:
          • "BLOCK"
          • "ANONYMIZE"
    • 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.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (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. The data object has the following properties:

      • guardrailId — (String)

        The unique identifier of the guardrail that was created.

      • guardrailArn — (String)

        The ARN of the guardrail that was created.

      • version — (String)

        The version of the guardrail that was created. This value should be 1.

      • createdAt — (Date)

        The time at which the guardrail was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

    • 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. The data object has the following properties:

      • guardrailId — (String)

        The unique identifier of the guardrail.

      • version — (String)

        The number of the version of the guardrail.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (String)

        Value for the tag.

    • customModelTags — (Array<map>)

      Tags to attach to the resulting custom model.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (String)

        Value for the tag.

    • trainingDataConfig — (map)

      Information about the training dataset.

      • s3Urirequired — (String)

        The S3 URI where the training data is stored.

    • validationDataConfig — (map)

      Information about the validation dataset.

      • validatorsrequired — (Array<map>)

        Information about the validators.

        • s3Urirequired — (String)

          The S3 URI where the validation data is stored.

    • outputDataConfig — (map)

      S3 location for the output data.

      • s3Urirequired — (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.

      • subnetIdsrequired — (Array<String>)

        VPC configuration subnets.

      • securityGroupIdsrequired — (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. The data object has the following properties:

      • jobArn — (String)

        Amazon Resource Name (ARN) of the fine tuning job

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

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.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (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. The data object has the following properties:

      • provisionedModelArn — (String)

        The Amazon Resource Name (ARN) for this Provisioned Throughput.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 the guardrailVersion 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.

    • 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request

Delete the invocation logging.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

        • s3Urirequired — (String)

          The S3 URI where the training data is stored.

      • validationDataConfig — (map)

        Contains information about the validation dataset.

        • validatorsrequired — (Array<map>)

          Information about the validators.

          • s3Urirequired — (String)

            The S3 URI where the validation data is stored.

      • outputDataConfig — (map)

        Output data configuration associated with this custom model.

        • s3Urirequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getEvaluationJob(params = {}, callback) ⇒ AWS.Request

Retrieves the properties associated with a model evaluation job, including the status of the job. For more information, see Model evaluations.

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. The data 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"
      • 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.

          • datasetMetricConfigsrequired — (Array<map>)

            Specifies the required elements for an automatic model evaluation job.

            • taskTyperequired — (String)

              The task type you want the model to carry out.

              Possible values include:
              • "Summarization"
              • "Classification"
              • "QuestionAndAnswer"
              • "Generation"
              • "Custom"
            • datasetrequired — (map)

              Specifies the prompt dataset.

              • namerequired — (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 and Builtin.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.

            • metricNamesrequired — (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 the name parameter specified in HumanEvaluationCustomMetric.

        • 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.

            • flowDefinitionArnrequired — (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.

            • namerequired — (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.

            • ratingMethodrequired — (String)

              Choose how you want your human workers to evaluation your model. Valid values for rating methods are ThumbsUpDown, IndividualLikertScale,ComparisonLikertScale, ComparisonChoice, and ComparisonRank

          • datasetMetricConfigsrequired — (Array<map>)

            Use to specify the metrics, task, and prompt dataset to be used in your model evaluation job.

            • taskTyperequired — (String)

              The task type you want the model to carry out.

              Possible values include:
              • "Summarization"
              • "Classification"
              • "QuestionAndAnswer"
              • "Generation"
              • "Custom"
            • datasetrequired — (map)

              Specifies the prompt dataset.

              • namerequired — (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 and Builtin.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.

            • metricNamesrequired — (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 the name parameter specified in HumanEvaluationCustomMetric.

      • 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.

            • modelIdentifierrequired — (String)

              The ARN of the Amazon Bedrock model specified.

            • inferenceParamsrequired — (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.

        • s3Urirequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • modelDetails — (map)

        Information about the foundation model.

        • modelArnrequired — (String)

          The model Amazon Resource Name (ARN).

        • modelIdrequired — (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

          • statusrequired — (String)

            Specifies whether a model version is available (ACTIVE) or deprecated (LEGACY.

            Possible values include:
            • "ACTIVE"
            • "LEGACY"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

    • 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. The data 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 that was created.

      • 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.

        • topicsrequired — (Array<map>)

          A list of policies related to topics that the guardrail should deny.

          • namerequired — (String)

            The name of the topic to deny.

          • definitionrequired — (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.

          • typerequired — (String)

            The harmful category that the content filter is applied to.

            Possible values include:
            • "SEXUAL"
            • "VIOLENCE"
            • "HATE"
            • "INSULTS"
            • "MISCONDUCT"
            • "PROMPT_ATTACK"
          • inputStrengthrequired — (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"
          • outputStrengthrequired — (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.

          • textrequired — (String)

            Text of the word configured for the guardrail to block.

        • managedWordLists — (Array<map>)

          A list of managed words configured for the guardrail.

          • typerequired — (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.

          • typerequired — (String)

            The type of PII entity. For example, 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"
          • actionrequired — (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.

          • namerequired — (String)

            The name of the regular expression for the guardrail.

          • description — (String)

            The description of the regular expression for the guardrail.

          • patternrequired — (String)

            The pattern of the regular expression configured for the guardrail.

          • actionrequired — (String)

            The action taken when a match to the regular expression is detected.

            Possible values include:
            • "BLOCK"
            • "ANONYMIZE"
      • 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 is FAILED. 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 is FAILED. 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

        • s3Urirequired — (String)

          The S3 URI where the training data is stored.

      • validationDataConfig — (map)

        Contains information about the validation dataset.

        • validatorsrequired — (Array<map>)

          Information about the validators.

          • s3Urirequired — (String)

            The S3 URI where the validation data is stored.

      • outputDataConfig — (map)

        Output data configuration

        • s3Urirequired — (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.

        • subnetIdsrequired — (Array<String>)

          VPC configuration subnets.

        • securityGroupIdsrequired — (Array<String>)

          VPC configuration security group Ids.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request

Get the current configuration values for model invocation logging.

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. The data object has the following properties:

      • loggingConfig — (map)

        The current configuration values.

        • cloudWatchConfig — (map)

          CloudWatch logging configuration.

          • logGroupNamerequired — (String)

            The log group name.

          • roleArnrequired — (String)

            The role Amazon Resource Name (ARN).

          • largeDataDeliveryS3Config — (map)

            S3 configuration for delivering a large amount of data.

            • bucketNamerequired — (String)

              S3 bucket name.

            • keyPrefix — (String)

              S3 prefix.

        • s3Config — (map)

          S3 configuration for storing log data.

          • bucketNamerequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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',
  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)

      Maximum number of results to return in the response.

    • nextToken — (String)

      Continuation token from the previous response, for Amazon Bedrock to list the next set 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"

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. The data object has the following properties:

      • nextToken — (String)

        Continuation token for the next request to list the next set of results.

      • modelSummaries — (Array<map>)

        Model summaries.

        • modelArnrequired — (String)

          The Amazon Resource Name (ARN) of the custom model.

        • modelNamerequired — (String)

          The name of the custom model.

        • creationTimerequired — (Date)

          Creation time of the model.

        • baseModelArnrequired — (String)

          The base model Amazon Resource Name (ARN).

        • baseModelNamerequired — (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"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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
};
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"
    • 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. The data 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.

        • jobArnrequired — (String)

          The Amazon Resource Name (ARN) of the model evaluation job.

        • jobNamerequired — (String)

          The name of the model evaluation job.

        • statusrequired — (String)

          The current status of the model evaluation job.

          Possible values include:
          • "InProgress"
          • "Completed"
          • "Failed"
          • "Stopping"
          • "Stopped"
        • creationTimerequired — (Date)

          When the model evaluation job was created.

        • jobTyperequired — (String)

          The type, either human or automatic, of model evaluation job.

          Possible values include:
          • "Human"
          • "Automated"
        • evaluationTaskTypesrequired — (Array<String>)

          What task type was used in the model evaluation job.

        • modelIdentifiersrequired — (Array<String>)

          The Amazon Resource Names (ARNs) of the model(s) used in the model evaluation job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • modelSummaries — (Array<map>)

        A list of Amazon Bedrock foundation models.

        • modelArnrequired — (String)

          The Amazon Resource Name (ARN) of the foundation model.

        • modelIdrequired — (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.

          • statusrequired — (String)

            Specifies whether a model version is available (ACTIVE) or deprecated (LEGACY.

            Possible values include:
            • "ACTIVE"
            • "LEGACY"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

    • 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 another ListGuardrails 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. The data object has the following properties:

      • guardrails — (Array<map>)

        A list of objects, each of which contains details about a guardrail.

        • idrequired — (String)

          The unique identifier of the guardrail.

        • arnrequired — (String)

          The ARN of the guardrail.

        • statusrequired — (String)

          The status of the guardrail.

          Possible values include:
          • "CREATING"
          • "UPDATING"
          • "VERSIONING"
          • "READY"
          • "FAILED"
          • "DELETING"
        • namerequired — (String)

          The name of the guardrail.

        • description — (String)

          A description of the guardrail.

        • versionrequired — (String)

          The version of the guardrail.

        • createdAtrequired — (Date)

          The date and time at which the guardrail was created.

        • updatedAtrequired — (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 another ListGuardrails request to see the next batch of results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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)

      Maximum number of results to return in the response.

    • nextToken — (String)

      Continuation token from the previous response, for Amazon Bedrock to list the next set 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. The data object has the following properties:

      • nextToken — (String)

        Page continuation token to use in the next request.

      • modelCustomizationJobSummaries — (Array<map>)

        Job summaries.

        • jobArnrequired — (String)

          Amazon Resource Name (ARN) of the customization job.

        • baseModelArnrequired — (String)

          Amazon Resource Name (ARN) of the base model.

        • jobNamerequired — (String)

          Name of the customization job.

        • statusrequired — (String)

          Status of the customization job.

          Possible values include:
          • "InProgress"
          • "Completed"
          • "Failed"
          • "Stopping"
          • "Stopped"
        • lastModifiedTime — (Date)

          Time that the customization job was last modified.

        • creationTimerequired — (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"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 the nextToken value in another list request.

    • nextToken — (String)

      If there are more results than the number you specified in the maxResults field, the response returns a nextToken value. To see the next batch of results, specify the nextToken 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. The data 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 the nextToken field in another list request.

      • provisionedModelSummaries — (Array<map>)

        A list of summaries, one for each Provisioned Throughput in the response.

        • provisionedModelNamerequired — (String)

          The name of the Provisioned Throughput.

        • provisionedModelArnrequired — (String)

          The Amazon Resource Name (ARN) of the Provisioned Throughput.

        • modelArnrequired — (String)

          The Amazon Resource Name (ARN) of the model associated with the Provisioned Throughput.

        • desiredModelArnrequired — (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.

        • foundationModelArnrequired — (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.

        • modelUnitsrequired — (Integer)

          The number of model units allocated to the Provisioned Throughput.

        • desiredModelUnitsrequired — (Integer)

          The number of model units that was requested to be allocated to the Provisioned Throughput.

        • statusrequired — (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.

        • creationTimerequired — (Date)

          The time that the Provisioned Throughput was created.

        • lastModifiedTimerequired — (Date)

          The time that the Provisioned Throughput was last modified.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • tags — (Array<map>)

        An array of the tags associated with this resource.

        • keyrequired — (String)

          Key for the tag.

        • valuerequired — (String)

          Value for the tag.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putModelInvocationLoggingConfiguration(params = {}, callback) ⇒ AWS.Request

Set the configuration values for model invocation logging.

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.

        • logGroupNamerequired — (String)

          The log group name.

        • roleArnrequired — (String)

          The role Amazon Resource Name (ARN).

        • largeDataDeliveryS3Config — (map)

          S3 configuration for delivering a large amount of data.

          • bucketNamerequired — (String)

            S3 bucket name.

          • keyPrefix — (String)

            S3 prefix.

      • s3Config — (map)

        S3 configuration for storing log data.

        • bucketNamerequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

      • keyrequired — (String)

        Key for the tag.

      • valuerequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateGuardrail(params = {}, callback) ⇒ AWS.Request

Updates a guardrail with the values you specify.

  • Specify a name and optional description.

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

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

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

    • Specify DENY in the type field.

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

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

    • Specify the category in the type field.

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

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

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

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 */
    ]
  },
  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

    • name — (String)

      A name for the guardrail.

    • description — (String)

      A description of the guardrail.

    • topicPolicyConfig — (map)

      The topic policy to configure for the guardrail.

      • topicsConfigrequired — (Array<map>)

        A list of policies related to topics that the guardrail should deny.

        • namerequired — (String)

          The name of the topic to deny.

        • definitionrequired — (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.

        • typerequired — (String)

          Specifies to deny the topic.

          Possible values include:
          • "DENY"
    • contentPolicyConfig — (map)

      The content policy to configure for the guardrail.

      • filtersConfigrequired — (Array<map>)

        Contains the type of the content filter and how strongly it should apply to prompts and model responses.

        • typerequired — (String)

          The harmful category that the content filter is applied to.

          Possible values include:
          • "SEXUAL"
          • "VIOLENCE"
          • "HATE"
          • "INSULTS"
          • "MISCONDUCT"
          • "PROMPT_ATTACK"
        • inputStrengthrequired — (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"
        • outputStrengthrequired — (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.

        • textrequired — (String)

          Text of the word configured for the guardrail to block.

      • managedWordListsConfig — (Array<map>)

        A list of managed words to configure for the guardrail.

        • typerequired — (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.

        • typerequired — (String)

          Configure guardrail type when the PII entity is detected.

          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"
        • actionrequired — (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.

        • namerequired — (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.

        • patternrequired — (String)

          The regular expression pattern to configure for the guardrail.

        • actionrequired — (String)

          The guardrail action to configure when matching regular expression is detected.

          Possible values include:
          • "BLOCK"
          • "ANONYMIZE"
    • 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. The data object has the following properties:

      • guardrailId — (String)

        The unique identifier of the guardrail

      • guardrailArn — (String)

        The ARN of the guardrail that was created.

      • version — (String)

        The version of the guardrail.

      • updatedAt — (Date)

        The date and time at which the guardrail was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.