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

Inherits:
AWS.Service show all
Identifier:
bedrockagent
API Version:
2023-06-05
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 and managing Amazon Bedrock agents.

Sending a Request Using BedrockAgent

var bedrockagent = new AWS.BedrockAgent();
bedrockagent.associateAgentKnowledgeBase(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 BedrockAgent object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var bedrockagent = new AWS.BedrockAgent({apiVersion: '2023-06-05'});

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

AWS.config.apiVersions = {
  bedrockagent: '2023-06-05',
  // other service API versions
};

var bedrockagent = new AWS.BedrockAgent();

Version:

  • 2023-06-05

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.BedrockAgent(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a BedrockAgent object

var bedrockagent = new AWS.BedrockAgent({apiVersion: '2023-06-05'});

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.BedrockAgent.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.BedrockAgent.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.BedrockAgent.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

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

Associates a knowledge base with an agent. If a knowledge base is associated and its indexState is set to Enabled, the agent queries the knowledge base for information to augment its response to the user.

Service Reference:

Examples:

Calling the associateAgentKnowledgeBase operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE', /* required */
  knowledgeBaseState: ENABLED | DISABLED
};
bedrockagent.associateAgentKnowledgeBase(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: {})
    • agentId — (String)

      The unique identifier of the agent with which you want to associate the knowledge base.

    • agentVersion — (String)

      The version of the agent with which you want to associate the knowledge base.

    • description — (String)

      A description of what the agent should use the knowledge base for.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base to associate with the agent.

    • knowledgeBaseState — (String)

      Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

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:

      • agentKnowledgeBase — (map)

        Contains details about the knowledge base that has been associated with the agent.

        • agentIdrequired — (String)

          The unique identifier of the agent with which the knowledge base is associated.

        • agentVersionrequired — (String)

          The version of the agent with which the knowledge base is associated.

        • createdAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was created.

        • descriptionrequired — (String)

          The description of the association between the agent and the knowledge base.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the association between the agent and the knowledge base.

        • knowledgeBaseStaterequired — (String)

          Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • updatedAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers.

  • Specify the following fields for security purposes.

    • agentResourceRoleArn – The Amazon Resource Name (ARN) of the role with permissions to invoke API operations on an agent.

    • (Optional) customerEncryptionKeyArn – The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent.

    • (Optional) idleSessionTTLinSeconds – Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequent InvokeAgent request begins a new session.

  • To enable your agent to retain conversational context across multiple sessions, include a memoryConfiguration object. For more information, see Configure memory.

  • To override the default prompt behavior for agent orchestration and to use advanced prompts, include a promptOverrideConfiguration object. For more information, see Advanced prompts.

  • If you agent fails to be created, the response returns a list of failureReasons alongside a list of recommendedActions for you to troubleshoot.

Service Reference:

Examples:

Calling the createAgent operation

var params = {
  agentName: 'STRING_VALUE', /* required */
  agentResourceRoleArn: 'STRING_VALUE',
  clientToken: 'STRING_VALUE',
  customerEncryptionKeyArn: 'STRING_VALUE',
  description: 'STRING_VALUE',
  foundationModel: 'STRING_VALUE',
  guardrailConfiguration: {
    guardrailIdentifier: 'STRING_VALUE',
    guardrailVersion: 'STRING_VALUE'
  },
  idleSessionTTLInSeconds: 'NUMBER_VALUE',
  instruction: 'STRING_VALUE',
  memoryConfiguration: {
    enabledMemoryTypes: [ /* required */
      SESSION_SUMMARY,
      /* more items */
    ],
    storageDays: 'NUMBER_VALUE'
  },
  promptOverrideConfiguration: {
    promptConfigurations: [ /* required */
      {
        basePromptTemplate: 'STRING_VALUE',
        inferenceConfiguration: {
          maximumLength: 'NUMBER_VALUE',
          stopSequences: [
            'STRING_VALUE',
            /* more items */
          ],
          temperature: 'NUMBER_VALUE',
          topK: 'NUMBER_VALUE',
          topP: 'NUMBER_VALUE'
        },
        parserMode: DEFAULT | OVERRIDDEN,
        promptCreationMode: DEFAULT | OVERRIDDEN,
        promptState: ENABLED | DISABLED,
        promptType: PRE_PROCESSING | ORCHESTRATION | POST_PROCESSING | KNOWLEDGE_BASE_RESPONSE_GENERATION
      },
      /* more items */
    ],
    overrideLambda: 'STRING_VALUE'
  },
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createAgent(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: {})
    • agentName — (String)

      A name for the agent that you create.

    • agentResourceRoleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

    • clientToken — (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.
    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.

    • description — (String)

      A description of the agent.

    • foundationModel — (String)

      The foundation model to be used for orchestration by the agent you create.

    • guardrailConfiguration — (map)

      The unique Guardrail configuration assigned to the agent when it is created.

      • guardrailIdentifier — (String)

        The unique identifier of the guardrail.

      • guardrailVersion — (String)

        The version of the guardrail.

    • idleSessionTTLInSeconds — (Integer)

      The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

      A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

    • instruction — (String)

      Instructions that tell the agent what it should do and how it should interact with users.

    • memoryConfiguration — (map)

      Contains the details of the memory configured for the agent.

      • enabledMemoryTypesrequired — (Array<String>)

        The type of memory that is stored.

      • storageDays — (Integer)

        The number of days the agent is configured to retain the conversational context.

    • promptOverrideConfiguration — (map)

      Contains configurations to override prompts in different parts of an agent sequence. For more information, see Advanced prompts.

      • overrideLambda — (String)

        The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

      • promptConfigurationsrequired — (Array<map>)

        Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

        • basePromptTemplate — (String)

          Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

        • inferenceConfiguration — (map)

          Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

          • maximumLength — (Integer)

            The maximum number of tokens to allow in the generated response.

          • stopSequences — (Array<String>)

            A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

          • temperature — (Float)

            The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

          • topK — (Integer)

            While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

          • topP — (Float)

            While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

        • parserMode — (String)

          Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

          Possible values include:
          • "DEFAULT"
          • "OVERRIDDEN"
        • promptCreationMode — (String)

          Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

          Possible values include:
          • "DEFAULT"
          • "OVERRIDDEN"
        • promptState — (String)

          Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

          • PRE_PROCESSINGENABLED

          • ORCHESTRATIONENABLED

          • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

          • POST_PROCESSINGDISABLED

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • promptType — (String)

          The step in the agent sequence that this prompt configuration applies to.

          Possible values include:
          • "PRE_PROCESSING"
          • "ORCHESTRATION"
          • "POST_PROCESSING"
          • "KNOWLEDGE_BASE_RESPONSE_GENERATION"
    • tags — (map<String>)

      Any tags that you want to attach to the agent.

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:

      • agent — (map)

        Contains details about the agent created.

        • agentArnrequired — (String)

          The Amazon Resource Name (ARN) of the agent.

        • agentIdrequired — (String)

          The unique identifier of the agent.

        • agentNamerequired — (String)

          The name of the agent.

        • agentResourceRoleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

        • agentStatusrequired — (String)

          The status of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent is being created.

          • PREPARING – The agent is being prepared.

          • PREPARED – The agent is prepared and ready to be invoked.

          • NOT_PREPARED – The agent has been created but not yet prepared.

          • FAILED – The agent API operation failed.

          • UPDATING – The agent is being updated.

          • DELETING – The agent is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • agentVersionrequired — (String)

          The version of the agent.

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

        • createdAtrequired — (Date)

          The time at which the agent was created.

        • customerEncryptionKeyArn — (String)

          The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.

        • description — (String)

          The description of the agent.

        • failureReasons — (Array<String>)

          Contains reasons that the agent-related API that you invoked failed.

        • foundationModel — (String)

          The foundation model used for orchestration by the agent.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • idleSessionTTLInSecondsrequired — (Integer)

          The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

        • instruction — (String)

          Instructions that tell the agent what it should do and how it should interact with users.

        • memoryConfiguration — (map)

          Contains memory configuration for the agent.

          • enabledMemoryTypesrequired — (Array<String>)

            The type of memory that is stored.

          • storageDays — (Integer)

            The number of days the agent is configured to retain the conversational context.

        • preparedAt — (Date)

          The time at which the agent was last prepared.

        • promptOverrideConfiguration — (map)

          Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see Advanced prompts.

          • overrideLambda — (String)

            The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

          • promptConfigurationsrequired — (Array<map>)

            Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

            • basePromptTemplate — (String)

              Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

            • inferenceConfiguration — (map)

              Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

              • maximumLength — (Integer)

                The maximum number of tokens to allow in the generated response.

              • stopSequences — (Array<String>)

                A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

              • temperature — (Float)

                The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

              • topK — (Integer)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

              • topP — (Float)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

            • parserMode — (String)

              Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptCreationMode — (String)

              Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptState — (String)

              Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

              • PRE_PROCESSINGENABLED

              • ORCHESTRATIONENABLED

              • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

              • POST_PROCESSINGDISABLED

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • promptType — (String)

              The step in the agent sequence that this prompt configuration applies to.

              Possible values include:
              • "PRE_PROCESSING"
              • "ORCHESTRATION"
              • "POST_PROCESSING"
              • "KNOWLEDGE_BASE_RESPONSE_GENERATION"
        • recommendedActions — (Array<String>)

          Contains recommended actions to take for the agent-related API that you invoked to succeed.

        • updatedAtrequired — (Date)

          The time at which the agent was last updated.

Returns:

  • (AWS.Request)

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

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

Creates an action group for an agent. An action group represents the actions that an agent can carry out for the customer by defining the APIs that an agent can call and the logic for calling them.

To allow your agent to request the user for additional information when trying to complete a task, add an action group with the parentActionGroupSignature field set to AMAZON.UserInput.

To allow your agent to generate, run, and troubleshoot code when trying to complete a task, add an action group with the parentActionGroupSignature field set to AMAZON.CodeInterpreter.

You must leave the description, apiSchema, and actionGroupExecutor fields blank for this action group. During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

Service Reference:

Examples:

Calling the createAgentActionGroup operation

var params = {
  actionGroupName: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  actionGroupExecutor: {
    customControl: RETURN_CONTROL,
    lambda: 'STRING_VALUE'
  },
  actionGroupState: ENABLED | DISABLED,
  apiSchema: {
    payload: 'STRING_VALUE',
    s3: {
      s3BucketName: 'STRING_VALUE',
      s3ObjectKey: 'STRING_VALUE'
    }
  },
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE',
  functionSchema: {
    functions: [
      {
        name: 'STRING_VALUE', /* required */
        description: 'STRING_VALUE',
        parameters: {
          '<Name>': {
            type: string | number | integer | boolean | array, /* required */
            description: 'STRING_VALUE',
            required: true || false
          },
          /* '<Name>': ... */
        }
      },
      /* more items */
    ]
  },
  parentActionGroupSignature: AMAZON.UserInput | AMAZON.CodeInterpreter
};
bedrockagent.createAgentActionGroup(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: {})
    • actionGroupExecutor — (map)

      The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.

      • customControl — (String)

        To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL.

        Possible values include:
        • "RETURN_CONTROL"
      • lambda — (String)

        The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

    • actionGroupName — (String)

      The name to give the action group.

    • actionGroupState — (String)

      Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • agentId — (String)

      The unique identifier of the agent for which to create the action group.

    • agentVersion — (String)

      The version of the agent for which to create the action group.

    • apiSchema — (map)

      Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.

      • payload — (String)

        The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

      • s3 — (map)

        Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

        • s3BucketName — (String)

          The name of the S3 bucket.

        • s3ObjectKey — (String)

          The S3 object key for the S3 resource.

    • clientToken — (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.
    • description — (String)

      A description of the action group.

    • functionSchema — (map)

      Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.

      • functions — (Array<map>)

        A list of functions that each define an action in the action group.

        • description — (String)

          A description of the function and its purpose.

        • namerequired — (String)

          A name for the function.

        • parameters — (map<map>)

          The parameters that the agent elicits from the user to fulfill the function.

          • description — (String)

            A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

          • required — (Boolean)

            Whether the parameter is required for the agent to complete the function for action group invocation.

          • typerequired — (String)

            The data type of the parameter.

            Possible values include:
            • "string"
            • "number"
            • "integer"
            • "boolean"
            • "array"
    • parentActionGroupSignature — (String)

      To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput. You must leave the description, apiSchema, and actionGroupExecutor fields blank for this action group.

      To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to AMAZON.CodeInterpreter. You must leave the description, apiSchema, and actionGroupExecutor fields blank for this action group.

      During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

      Possible values include:
      • "AMAZON.UserInput"
      • "AMAZON.CodeInterpreter"

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:

      • agentActionGroup — (map)

        Contains details about the action group that was created.

        • actionGroupExecutor — (map)

          The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.

          • customControl — (String)

            To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL.

            Possible values include:
            • "RETURN_CONTROL"
          • lambda — (String)

            The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

        • actionGroupIdrequired — (String)

          The unique identifier of the action group.

        • actionGroupNamerequired — (String)

          The name of the action group.

        • actionGroupStaterequired — (String)

          Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • agentIdrequired — (String)

          The unique identifier of the agent to which the action group belongs.

        • agentVersionrequired — (String)

          The version of the agent to which the action group belongs.

        • apiSchema — (map)

          Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.

          • payload — (String)

            The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

          • s3 — (map)

            Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

            • s3BucketName — (String)

              The name of the S3 bucket.

            • s3ObjectKey — (String)

              The S3 object key for the S3 resource.

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

        • createdAtrequired — (Date)

          The time at which the action group was created.

        • description — (String)

          The description of the action group.

        • functionSchema — (map)

          Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.

          • functions — (Array<map>)

            A list of functions that each define an action in the action group.

            • description — (String)

              A description of the function and its purpose.

            • namerequired — (String)

              A name for the function.

            • parameters — (map<map>)

              The parameters that the agent elicits from the user to fulfill the function.

              • description — (String)

                A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

              • required — (Boolean)

                Whether the parameter is required for the agent to complete the function for action group invocation.

              • typerequired — (String)

                The data type of the parameter.

                Possible values include:
                • "string"
                • "number"
                • "integer"
                • "boolean"
                • "array"
        • parentActionSignature — (String)

          If this field is set as AMAZON.UserInput, the agent can request the user for additional information when trying to complete a task. The description, apiSchema, and actionGroupExecutor fields must be blank for this action group.

          During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

          Possible values include:
          • "AMAZON.UserInput"
          • "AMAZON.CodeInterpreter"
        • updatedAtrequired — (Date)

          The time at which the action group was last updated.

Returns:

  • (AWS.Request)

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

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

Creates an alias of an agent that can be used to deploy the agent.

Service Reference:

Examples:

Calling the createAgentAlias operation

var params = {
  agentAliasName: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE',
  routingConfiguration: [
    {
      agentVersion: 'STRING_VALUE',
      provisionedThroughput: 'STRING_VALUE'
    },
    /* more items */
  ],
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createAgentAlias(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: {})
    • agentAliasName — (String)

      The name of the alias.

    • agentId — (String)

      The unique identifier of the agent.

    • clientToken — (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.
    • description — (String)

      A description of the alias of the agent.

    • routingConfiguration — (Array<map>)

      Contains details about the routing configuration of the alias.

      • agentVersion — (String)

        The version of the agent with which the alias is associated.

      • provisionedThroughput — (String)

        Information on the Provisioned Throughput assigned to an agent alias.

    • tags — (map<String>)

      Any tags that you want to attach to the alias of the agent.

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:

      • agentAlias — (map)

        Contains details about the alias that was created.

        • agentAliasArnrequired — (String)

          The Amazon Resource Name (ARN) of the alias of the agent.

        • agentAliasHistoryEvents — (Array<map>)

          Contains details about the history of the alias.

          • endDate — (Date)

            The date that the alias stopped being associated to the version in the routingConfiguration object

          • routingConfiguration — (Array<map>)

            Contains details about the version of the agent with which the alias is associated.

            • agentVersion — (String)

              The version of the agent with which the alias is associated.

            • provisionedThroughput — (String)

              Information on the Provisioned Throughput assigned to an agent alias.

          • startDate — (Date)

            The date that the alias began being associated to the version in the routingConfiguration object.

        • agentAliasIdrequired — (String)

          The unique identifier of the alias of the agent.

        • agentAliasNamerequired — (String)

          The name of the alias of the agent.

        • agentAliasStatusrequired — (String)

          The status of the alias of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent alias is being created.

          • PREPARED – The agent alias is finished being created or updated and is ready to be invoked.

          • FAILED – The agent alias API operation failed.

          • UPDATING – The agent alias is being updated.

          • DELETING – The agent alias is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARED"
          • "FAILED"
          • "UPDATING"
          • "DELETING"
        • agentIdrequired — (String)

          The unique identifier of the agent.

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

        • createdAtrequired — (Date)

          The time at which the alias of the agent was created.

        • description — (String)

          The description of the alias of the agent.

        • failureReasons — (Array<String>)

          Information on the failure of Provisioned Throughput assigned to an agent alias.

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersion — (String)

            The version of the agent with which the alias is associated.

          • provisionedThroughput — (String)

            Information on the Provisioned Throughput assigned to an agent alias.

        • updatedAtrequired — (Date)

          The time at which the alias was last updated.

Returns:

  • (AWS.Request)

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

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

Creates a data source connector for a knowledge base.

You can't change the chunkingConfiguration after you create the data source connector.

Service Reference:

Examples:

Calling the createDataSource operation

var params = {
  dataSourceConfiguration: { /* required */
    type: S3 | WEB | CONFLUENCE | SALESFORCE | SHAREPOINT, /* required */
    confluenceConfiguration: {
      sourceConfiguration: { /* required */
        authType: BASIC | OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        hostType: SAAS, /* required */
        hostUrl: 'STRING_VALUE' /* required */
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    s3Configuration: {
      bucketArn: 'STRING_VALUE', /* required */
      bucketOwnerAccountId: 'STRING_VALUE',
      inclusionPrefixes: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    salesforceConfiguration: {
      sourceConfiguration: { /* required */
        authType: OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        hostUrl: 'STRING_VALUE' /* required */
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    sharePointConfiguration: {
      sourceConfiguration: { /* required */
        authType: OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        domain: 'STRING_VALUE', /* required */
        hostType: ONLINE, /* required */
        siteUrls: [ /* required */
          'STRING_VALUE',
          /* more items */
        ],
        tenantId: 'STRING_VALUE'
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    webConfiguration: {
      sourceConfiguration: { /* required */
        urlConfiguration: { /* required */
          seedUrls: [
            {
              url: 'STRING_VALUE'
            },
            /* more items */
          ]
        }
      },
      crawlerConfiguration: {
        crawlerLimits: {
          rateLimit: 'NUMBER_VALUE'
        },
        exclusionFilters: [
          'STRING_VALUE',
          /* more items */
        ],
        inclusionFilters: [
          'STRING_VALUE',
          /* more items */
        ],
        scope: HOST_ONLY | SUBDOMAINS
      }
    }
  },
  knowledgeBaseId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  dataDeletionPolicy: RETAIN | DELETE,
  description: 'STRING_VALUE',
  serverSideEncryptionConfiguration: {
    kmsKeyArn: 'STRING_VALUE'
  },
  vectorIngestionConfiguration: {
    chunkingConfiguration: {
      chunkingStrategy: FIXED_SIZE | NONE | HIERARCHICAL | SEMANTIC, /* required */
      fixedSizeChunkingConfiguration: {
        maxTokens: 'NUMBER_VALUE', /* required */
        overlapPercentage: 'NUMBER_VALUE' /* required */
      },
      hierarchicalChunkingConfiguration: {
        levelConfigurations: [ /* required */
          {
            maxTokens: 'NUMBER_VALUE' /* required */
          },
          /* more items */
        ],
        overlapTokens: 'NUMBER_VALUE' /* required */
      },
      semanticChunkingConfiguration: {
        breakpointPercentileThreshold: 'NUMBER_VALUE', /* required */
        bufferSize: 'NUMBER_VALUE', /* required */
        maxTokens: 'NUMBER_VALUE' /* required */
      }
    },
    customTransformationConfiguration: {
      intermediateStorage: { /* required */
        s3Location: { /* required */
          uri: 'STRING_VALUE' /* required */
        }
      },
      transformations: [ /* required */
        {
          stepToApply: POST_CHUNKING, /* required */
          transformationFunction: { /* required */
            transformationLambdaConfiguration: { /* required */
              lambdaArn: 'STRING_VALUE' /* required */
            }
          }
        },
        /* more items */
      ]
    },
    parsingConfiguration: {
      parsingStrategy: BEDROCK_FOUNDATION_MODEL, /* required */
      bedrockFoundationModelConfiguration: {
        modelArn: 'STRING_VALUE', /* required */
        parsingPrompt: {
          parsingPromptText: 'STRING_VALUE' /* required */
        }
      }
    }
  }
};
bedrockagent.createDataSource(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: {})
    • clientToken — (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.
    • dataDeletionPolicy — (String)

      The data deletion policy for the data source.

      You can set the data deletion policy to:

      • DELETE: Deletes all underlying data belonging to the data source from the vector store upon deletion of a knowledge base or data source resource. Note that the vector store itself is not deleted, only the underlying data. This flag is ignored if an Amazon Web Services account is deleted.

      • RETAIN: Retains all underlying data in your vector store upon deletion of a knowledge base or data source resource.

      Possible values include:
      • "RETAIN"
      • "DELETE"
    • dataSourceConfiguration — (map)

      The connection configuration for the data source.

      • confluenceConfiguration — (map)

        The configuration information to connect to Confluence as your data source.

        Note: Confluence data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the Confluence content. For example, configuring specific types of Confluence content.

          • filterConfiguration — (map)

            The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your Confluence data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your Confluence instance.

            Possible values include:
            • "BASIC"
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

          • hostTyperequired — (String)

            The supported host type, whether online/cloud or server/on-premises.

            Possible values include:
            • "SAAS"
          • hostUrlrequired — (String)

            The Confluence host URL or instance URL.

      • s3Configuration — (map)

        The configuration information to connect to Amazon S3 as your data source.

        • bucketArnrequired — (String)

          The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

        • bucketOwnerAccountId — (String)

          The account ID for the owner of the S3 bucket.

        • inclusionPrefixes — (Array<String>)

          A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

      • salesforceConfiguration — (map)

        The configuration information to connect to Salesforce as your data source.

        Note: Salesforce data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

          • filterConfiguration — (map)

            The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your Salesforce data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your Salesforce instance.

            Possible values include:
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

          • hostUrlrequired — (String)

            The Salesforce host URL or instance URL.

      • sharePointConfiguration — (map)

        The configuration information to connect to SharePoint as your data source.

        Note: SharePoint data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

          • filterConfiguration — (map)

            The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your SharePoint data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your SharePoint site/sites.

            Possible values include:
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

          • domainrequired — (String)

            The domain of your SharePoint instance or site URL/URLs.

          • hostTyperequired — (String)

            The supported host type, whether online/cloud or server/on-premises.

            Possible values include:
            • "ONLINE"
          • siteUrlsrequired — (Array<String>)

            A list of one or more SharePoint site URLs.

          • tenantId — (String)

            The identifier of your Microsoft 365 tenant.

      • typerequired — (String)

        The type of data source.

        Possible values include:
        • "S3"
        • "WEB"
        • "CONFLUENCE"
        • "SALESFORCE"
        • "SHAREPOINT"
      • webConfiguration — (map)

        The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

        Note: Crawling web URLs as your data source is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The Web Crawler configuration details for the web data source.

          • crawlerLimits — (map)

            The configuration of crawl limits for the web URLs.

            • rateLimit — (Integer)

              The max rate at which pages are crawled, up to 300 per minute per host.

          • exclusionFilters — (Array<String>)

            A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

          • inclusionFilters — (Array<String>)

            A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

          • scope — (String)

            The scope of what is crawled for your URLs.

            You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

            Possible values include:
            • "HOST_ONLY"
            • "SUBDOMAINS"
        • sourceConfigurationrequired — (map)

          The source configuration details for the web data source.

          • urlConfigurationrequired — (map)

            The configuration of the URL/URLs.

            • seedUrls — (Array<map>)

              One or more seed or starting point URLs.

              • url — (String)

                A seed or starting point URL.

    • description — (String)

      A description of the data source.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base to which to add the data source.

    • name — (String)

      The name of the data source.

    • serverSideEncryptionConfiguration — (map)

      Contains details about the server-side encryption for the data source.

      • kmsKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

    • vectorIngestionConfiguration — (map)

      Contains details about how to ingest the documents in the data source.

      • chunkingConfiguration — (map)

        Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

        • chunkingStrategyrequired — (String)

          Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

          • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

          • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

          • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

          • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          Possible values include:
          • "FIXED_SIZE"
          • "NONE"
          • "HIERARCHICAL"
          • "SEMANTIC"
        • fixedSizeChunkingConfiguration — (map)

          Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

          • maxTokensrequired — (Integer)

            The maximum number of tokens to include in a chunk.

          • overlapPercentagerequired — (Integer)

            The percentage of overlap between adjacent chunks of a data source.

        • hierarchicalChunkingConfiguration — (map)

          Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

          • levelConfigurationsrequired — (Array<map>)

            Token settings for each layer.

            • maxTokensrequired — (Integer)

              The maximum number of tokens that a chunk can contain in this layer.

          • overlapTokensrequired — (Integer)

            The number of tokens to repeat across chunks in the same layer.

        • semanticChunkingConfiguration — (map)

          Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

          • breakpointPercentileThresholdrequired — (Integer)

            The dissimilarity threshold for splitting chunks.

          • bufferSizerequired — (Integer)

            The buffer size.

          • maxTokensrequired — (Integer)

            The maximum number of tokens that a chunk can contain.

      • customTransformationConfiguration — (map)

        A custom document transformer for parsed data source documents.

        • intermediateStoragerequired — (map)

          An S3 bucket path for input and output objects.

          • s3Locationrequired — (map)

            An S3 bucket path.

            • urirequired — (String)

              The location's URI. For example, s3://my-bucket/chunk-processor/.

        • transformationsrequired — (Array<map>)

          A Lambda function that processes documents.

          • stepToApplyrequired — (String)

            When the service applies the transformation.

            Possible values include:
            • "POST_CHUNKING"
          • transformationFunctionrequired — (map)

            A Lambda function that processes documents.

            • transformationLambdaConfigurationrequired — (map)

              The Lambda function.

              • lambdaArnrequired — (String)

                The function's ARN identifier.

      • parsingConfiguration — (map)

        A custom parser for data source documents.

        • bedrockFoundationModelConfiguration — (map)

          Settings for a foundation model used to parse documents for a data source.

          • modelArnrequired — (String)

            The model's ARN.

          • parsingPrompt — (map)

            Instructions for interpreting the contents of a document.

            • parsingPromptTextrequired — (String)

              Instructions for interpreting the contents of a document.

        • parsingStrategyrequired — (String)

          The parsing strategy for the data source.

          Possible values include:
          • "BEDROCK_FOUNDATION_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:

      • dataSource — (map)

        Contains details about the data source.

        • createdAtrequired — (Date)

          The time at which the data source was created.

        • dataDeletionPolicy — (String)

          The data deletion policy for the data source.

          Possible values include:
          • "RETAIN"
          • "DELETE"
        • dataSourceConfigurationrequired — (map)

          The connection configuration for the data source.

          • confluenceConfiguration — (map)

            The configuration information to connect to Confluence as your data source.

            Note: Confluence data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Confluence content. For example, configuring specific types of Confluence content.

              • filterConfiguration — (map)

                The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Confluence data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Confluence instance.

                Possible values include:
                • "BASIC"
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "SAAS"
              • hostUrlrequired — (String)

                The Confluence host URL or instance URL.

          • s3Configuration — (map)

            The configuration information to connect to Amazon S3 as your data source.

            • bucketArnrequired — (String)

              The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

          • salesforceConfiguration — (map)

            The configuration information to connect to Salesforce as your data source.

            Note: Salesforce data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

              • filterConfiguration — (map)

                The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Salesforce data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Salesforce instance.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

              • hostUrlrequired — (String)

                The Salesforce host URL or instance URL.

          • sharePointConfiguration — (map)

            The configuration information to connect to SharePoint as your data source.

            Note: SharePoint data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

              • filterConfiguration — (map)

                The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your SharePoint data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your SharePoint site/sites.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

              • domainrequired — (String)

                The domain of your SharePoint instance or site URL/URLs.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "ONLINE"
              • siteUrlsrequired — (Array<String>)

                A list of one or more SharePoint site URLs.

              • tenantId — (String)

                The identifier of your Microsoft 365 tenant.

          • typerequired — (String)

            The type of data source.

            Possible values include:
            • "S3"
            • "WEB"
            • "CONFLUENCE"
            • "SALESFORCE"
            • "SHAREPOINT"
          • webConfiguration — (map)

            The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

            Note: Crawling web URLs as your data source is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The Web Crawler configuration details for the web data source.

              • crawlerLimits — (map)

                The configuration of crawl limits for the web URLs.

                • rateLimit — (Integer)

                  The max rate at which pages are crawled, up to 300 per minute per host.

              • exclusionFilters — (Array<String>)

                A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • inclusionFilters — (Array<String>)

                A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • scope — (String)

                The scope of what is crawled for your URLs.

                You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

                Possible values include:
                • "HOST_ONLY"
                • "SUBDOMAINS"
            • sourceConfigurationrequired — (map)

              The source configuration details for the web data source.

              • urlConfigurationrequired — (map)

                The configuration of the URL/URLs.

                • seedUrls — (Array<map>)

                  One or more seed or starting point URLs.

                  • url — (String)

                    A seed or starting point URL.

        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The detailed reasons on the failure to delete a data source.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source belongs.

        • namerequired — (String)

          The name of the data source.

        • serverSideEncryptionConfiguration — (map)

          Contains details about the configuration of the server-side encryption.

          • kmsKeyArn — (String)

            The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

        • statusrequired — (String)

          The status of the data source. The following statuses are possible:

          • Available – The data source has been created and is ready for ingestion into the knowledge base.

          • Deleting – The data source is being deleted.

          Possible values include:
          • "AVAILABLE"
          • "DELETING"
          • "DELETE_UNSUCCESSFUL"
        • updatedAtrequired — (Date)

          The time at which the data source was last updated.

        • vectorIngestionConfiguration — (map)

          Contains details about how to ingest the documents in the data source.

          • chunkingConfiguration — (map)

            Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

            • chunkingStrategyrequired — (String)

              Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

              • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

              • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

              • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

              Possible values include:
              • "FIXED_SIZE"
              • "NONE"
              • "HIERARCHICAL"
              • "SEMANTIC"
            • fixedSizeChunkingConfiguration — (map)

              Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

              • maxTokensrequired — (Integer)

                The maximum number of tokens to include in a chunk.

              • overlapPercentagerequired — (Integer)

                The percentage of overlap between adjacent chunks of a data source.

            • hierarchicalChunkingConfiguration — (map)

              Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • levelConfigurationsrequired — (Array<map>)

                Token settings for each layer.

                • maxTokensrequired — (Integer)

                  The maximum number of tokens that a chunk can contain in this layer.

              • overlapTokensrequired — (Integer)

                The number of tokens to repeat across chunks in the same layer.

            • semanticChunkingConfiguration — (map)

              Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

              • breakpointPercentileThresholdrequired — (Integer)

                The dissimilarity threshold for splitting chunks.

              • bufferSizerequired — (Integer)

                The buffer size.

              • maxTokensrequired — (Integer)

                The maximum number of tokens that a chunk can contain.

          • customTransformationConfiguration — (map)

            A custom document transformer for parsed data source documents.

            • intermediateStoragerequired — (map)

              An S3 bucket path for input and output objects.

              • s3Locationrequired — (map)

                An S3 bucket path.

                • urirequired — (String)

                  The location's URI. For example, s3://my-bucket/chunk-processor/.

            • transformationsrequired — (Array<map>)

              A Lambda function that processes documents.

              • stepToApplyrequired — (String)

                When the service applies the transformation.

                Possible values include:
                • "POST_CHUNKING"
              • transformationFunctionrequired — (map)

                A Lambda function that processes documents.

                • transformationLambdaConfigurationrequired — (map)

                  The Lambda function.

                  • lambdaArnrequired — (String)

                    The function's ARN identifier.

          • parsingConfiguration — (map)

            A custom parser for data source documents.

            • bedrockFoundationModelConfiguration — (map)

              Settings for a foundation model used to parse documents for a data source.

              • modelArnrequired — (String)

                The model's ARN.

              • parsingPrompt — (map)

                Instructions for interpreting the contents of a document.

                • parsingPromptTextrequired — (String)

                  Instructions for interpreting the contents of a document.

            • parsingStrategyrequired — (String)

              The parsing strategy for the data source.

              Possible values include:
              • "BEDROCK_FOUNDATION_MODEL"

Returns:

  • (AWS.Request)

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

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

Creates a prompt flow that you can use to send an input through various steps to yield an output. Configure nodes, each of which corresponds to a step of the flow, and create connections between the nodes to create paths to different outputs. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the createFlow operation

var params = {
  executionRoleArn: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  customerEncryptionKeyArn: 'STRING_VALUE',
  definition: {
    connections: [
      {
        name: 'STRING_VALUE', /* required */
        source: 'STRING_VALUE', /* required */
        target: 'STRING_VALUE', /* required */
        type: Data | Conditional, /* required */
        configuration: {
          conditional: {
            condition: 'STRING_VALUE' /* required */
          },
          data: {
            sourceOutput: 'STRING_VALUE', /* required */
            targetInput: 'STRING_VALUE' /* required */
          }
        }
      },
      /* more items */
    ],
    nodes: [
      {
        name: 'STRING_VALUE', /* required */
        type: Input | Output | KnowledgeBase | Condition | Lex | Prompt | LambdaFunction | Storage | Agent | Retrieval | Iterator | Collector, /* required */
        configuration: {
          agent: {
            agentAliasArn: 'STRING_VALUE' /* required */
          },
          collector: {
          },
          condition: {
            conditions: [ /* required */
              {
                name: 'STRING_VALUE', /* required */
                expression: 'STRING_VALUE'
              },
              /* more items */
            ]
          },
          input: {
          },
          iterator: {
          },
          knowledgeBase: {
            knowledgeBaseId: 'STRING_VALUE', /* required */
            modelId: 'STRING_VALUE'
          },
          lambdaFunction: {
            lambdaArn: 'STRING_VALUE' /* required */
          },
          lex: {
            botAliasArn: 'STRING_VALUE', /* required */
            localeId: 'STRING_VALUE' /* required */
          },
          output: {
          },
          prompt: {
            sourceConfiguration: { /* required */
              inline: {
                modelId: 'STRING_VALUE', /* required */
                templateConfiguration: { /* required */
                  text: {
                    text: 'STRING_VALUE', /* required */
                    inputVariables: [
                      {
                        name: 'STRING_VALUE'
                      },
                      /* more items */
                    ]
                  }
                },
                templateType: TEXT, /* required */
                inferenceConfiguration: {
                  text: {
                    maxTokens: 'NUMBER_VALUE',
                    stopSequences: [
                      'STRING_VALUE',
                      /* more items */
                    ],
                    temperature: 'NUMBER_VALUE',
                    topK: 'NUMBER_VALUE',
                    topP: 'NUMBER_VALUE'
                  }
                }
              },
              resource: {
                promptArn: 'STRING_VALUE' /* required */
              }
            }
          },
          retrieval: {
            serviceConfiguration: { /* required */
              s3: {
                bucketName: 'STRING_VALUE' /* required */
              }
            }
          },
          storage: {
            serviceConfiguration: { /* required */
              s3: {
                bucketName: 'STRING_VALUE' /* required */
              }
            }
          }
        },
        inputs: [
          {
            expression: 'STRING_VALUE', /* required */
            name: 'STRING_VALUE', /* required */
            type: String | Number | Boolean | Object | Array /* required */
          },
          /* more items */
        ],
        outputs: [
          {
            name: 'STRING_VALUE', /* required */
            type: String | Number | Boolean | Object | Array /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createFlow(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: {})
    • clientToken — (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.
    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.

    • definition — (map)

      A definition of the nodes and connections between nodes in the flow.

      • connections — (Array<map>)

        An array of connection definitions in the flow.

        • configuration — (map)

          The configuration of the connection.

          • conditional — (map)

            The configuration of a connection originating from a Condition node.

            • conditionrequired — (String)

              The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

          • data — (map)

            The configuration of a connection originating from a node that isn't a Condition node.

            • sourceOutputrequired — (String)

              The name of the output in the source node that the connection begins from.

            • targetInputrequired — (String)

              The name of the input in the target node that the connection ends at.

        • namerequired — (String)

          A name for the connection that you can reference.

        • sourcerequired — (String)

          The node that the connection starts at.

        • targetrequired — (String)

          The node that the connection ends at.

        • typerequired — (String)

          Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

          Possible values include:
          • "Data"
          • "Conditional"
      • nodes — (Array<map>)

        An array of node definitions in the flow.

        • configuration — (map)

          Contains configurations for the node.

          • agent — (map)

            Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

            • agentAliasArnrequired — (String)

              The Amazon Resource Name (ARN) of the alias of the agent to invoke.

          • collector — (map)

            Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

          • condition — (map)

            Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

            • conditionsrequired — (Array<map>)

              An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

              • expression — (String)

                Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

              • namerequired — (String)

                A name for the condition that you can reference.

          • input — (map)

            Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

          • iterator — (map)

            Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

            The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

          • knowledgeBase — (map)

            Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

            • knowledgeBaseIdrequired — (String)

              The unique identifier of the knowledge base to query.

            • modelId — (String)

              The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

          • lambdaFunction — (map)

            Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

            • lambdaArnrequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to invoke.

          • lex — (map)

            Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

            • botAliasArnrequired — (String)

              The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

            • localeIdrequired — (String)

              The Region to invoke the Amazon Lex bot in.

          • output — (map)

            Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

          • prompt — (map)

            Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

            • sourceConfigurationrequired — (map)

              Specifies whether the prompt is from Prompt management or defined inline.

              • inline — (map)

                Contains configurations for a prompt that is defined inline

                • inferenceConfiguration — (map)

                  Contains inference configurations for the prompt.

                  • text — (map)

                    Contains inference configurations for a text prompt.

                    • maxTokens — (Integer)

                      The maximum number of tokens to return in the response.

                    • stopSequences — (Array<String>)

                      A list of strings that define sequences after which the model will stop generating.

                    • temperature — (Float)

                      Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                    • topK — (Integer)

                      The number of most-likely candidates that the model considers for the next token during generation.

                    • topP — (Float)

                      The percentage of most-likely candidates that the model considers for the next token.

                • modelIdrequired — (String)

                  The unique identifier of the model to run inference with.

                • templateConfigurationrequired — (map)

                  Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                  • text — (map)

                    Contains configurations for the text in a message for a prompt.

                    • inputVariables — (Array<map>)

                      An array of the variables in the prompt template.

                      • name — (String)

                        The name of the variable.

                    • textrequired — (String)

                      The message for the prompt.

                • templateTyperequired — (String)

                  The type of prompt template.

                  Possible values include:
                  • "TEXT"
              • resource — (map)

                Contains configurations for a prompt from Prompt management.

                • promptArnrequired — (String)

                  The Amazon Resource Name (ARN) of the prompt from Prompt management.

          • retrieval — (map)

            Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

            • serviceConfigurationrequired — (map)

              Contains configurations for the service to use for retrieving data to return as the output from the node.

              • s3 — (map)

                Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                • bucketNamerequired — (String)

                  The name of the Amazon S3 bucket from which to retrieve data.

          • storage — (map)

            Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

            • serviceConfigurationrequired — (map)

              Contains configurations for the service to use for storing the input into the node.

              • s3 — (map)

                Contains configurations for the Amazon S3 location in which to store the input into the node.

                • bucketNamerequired — (String)

                  The name of the Amazon S3 bucket in which to store the input into the node.

        • inputs — (Array<map>)

          An array of objects, each of which contains information about an input into the node.

          • expressionrequired — (String)

            An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

          • namerequired — (String)

            A name for the input that you can reference.

          • typerequired — (String)

            The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

            Possible values include:
            • "String"
            • "Number"
            • "Boolean"
            • "Object"
            • "Array"
        • namerequired — (String)

          A name for the node.

        • outputs — (Array<map>)

          A list of objects, each of which contains information about an output from the node.

          • namerequired — (String)

            A name for the output that you can reference.

          • typerequired — (String)

            The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

            Possible values include:
            • "String"
            • "Number"
            • "Boolean"
            • "Object"
            • "Array"
        • typerequired — (String)

          The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

          Possible values include:
          • "Input"
          • "Output"
          • "KnowledgeBase"
          • "Condition"
          • "Lex"
          • "Prompt"
          • "LambdaFunction"
          • "Storage"
          • "Agent"
          • "Retrieval"
          • "Iterator"
          • "Collector"
    • description — (String)

      A description for the flow.

    • executionRoleArn — (String)

      The Amazon Resource Name (ARN) of the service role with permissions to create and manage a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

    • name — (String)

      A name for the flow.

    • tags — (map<String>)

      Any tags that you want to attach to the flow. For more information, see Tagging resources in Amazon Bedrock.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.

      • definition — (map)

        A definition of the nodes and connections between nodes in the flow.

        • connections — (Array<map>)

          An array of connection definitions in the flow.

          • configuration — (map)

            The configuration of the connection.

            • conditional — (map)

              The configuration of a connection originating from a Condition node.

              • conditionrequired — (String)

                The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

            • data — (map)

              The configuration of a connection originating from a node that isn't a Condition node.

              • sourceOutputrequired — (String)

                The name of the output in the source node that the connection begins from.

              • targetInputrequired — (String)

                The name of the input in the target node that the connection ends at.

          • namerequired — (String)

            A name for the connection that you can reference.

          • sourcerequired — (String)

            The node that the connection starts at.

          • targetrequired — (String)

            The node that the connection ends at.

          • typerequired — (String)

            Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

            Possible values include:
            • "Data"
            • "Conditional"
        • nodes — (Array<map>)

          An array of node definitions in the flow.

          • configuration — (map)

            Contains configurations for the node.

            • agent — (map)

              Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

              • agentAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the alias of the agent to invoke.

            • collector — (map)

              Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

            • condition — (map)

              Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

              • conditionsrequired — (Array<map>)

                An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

                • expression — (String)

                  Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

                • namerequired — (String)

                  A name for the condition that you can reference.

            • input — (map)

              Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

            • iterator — (map)

              Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

              The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

            • knowledgeBase — (map)

              Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

              • knowledgeBaseIdrequired — (String)

                The unique identifier of the knowledge base to query.

              • modelId — (String)

                The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

            • lambdaFunction — (map)

              Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

              • lambdaArnrequired — (String)

                The Amazon Resource Name (ARN) of the Lambda function to invoke.

            • lex — (map)

              Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

              • botAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

              • localeIdrequired — (String)

                The Region to invoke the Amazon Lex bot in.

            • output — (map)

              Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

            • prompt — (map)

              Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

              • sourceConfigurationrequired — (map)

                Specifies whether the prompt is from Prompt management or defined inline.

                • inline — (map)

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration — (map)

                    Contains inference configurations for the prompt.

                    • text — (map)

                      Contains inference configurations for a text prompt.

                      • maxTokens — (Integer)

                        The maximum number of tokens to return in the response.

                      • stopSequences — (Array<String>)

                        A list of strings that define sequences after which the model will stop generating.

                      • temperature — (Float)

                        Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                      • topK — (Integer)

                        The number of most-likely candidates that the model considers for the next token during generation.

                      • topP — (Float)

                        The percentage of most-likely candidates that the model considers for the next token.

                  • modelIdrequired — (String)

                    The unique identifier of the model to run inference with.

                  • templateConfigurationrequired — (map)

                    Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                    • text — (map)

                      Contains configurations for the text in a message for a prompt.

                      • inputVariables — (Array<map>)

                        An array of the variables in the prompt template.

                        • name — (String)

                          The name of the variable.

                      • textrequired — (String)

                        The message for the prompt.

                  • templateTyperequired — (String)

                    The type of prompt template.

                    Possible values include:
                    • "TEXT"
                • resource — (map)

                  Contains configurations for a prompt from Prompt management.

                  • promptArnrequired — (String)

                    The Amazon Resource Name (ARN) of the prompt from Prompt management.

            • retrieval — (map)

              Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for retrieving data to return as the output from the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket from which to retrieve data.

            • storage — (map)

              Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for storing the input into the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location in which to store the input into the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket in which to store the input into the node.

          • inputs — (Array<map>)

            An array of objects, each of which contains information about an input into the node.

            • expressionrequired — (String)

              An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

            • namerequired — (String)

              A name for the input that you can reference.

            • typerequired — (String)

              The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • namerequired — (String)

            A name for the node.

          • outputs — (Array<map>)

            A list of objects, each of which contains information about an output from the node.

            • namerequired — (String)

              A name for the output that you can reference.

            • typerequired — (String)

              The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • typerequired — (String)

            The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

            Possible values include:
            • "Input"
            • "Output"
            • "KnowledgeBase"
            • "Condition"
            • "Lex"
            • "Prompt"
            • "LambdaFunction"
            • "Storage"
            • "Agent"
            • "Retrieval"
            • "Iterator"
            • "Collector"
      • description — (String)

        The description of the flow.

      • executionRoleArn — (String)

        The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

      • id — (String)

        The unique identifier of the flow.

      • name — (String)

        The name of the flow.

      • status — (String)

        The status of the flow. When you submit this request, the status will be NotPrepared. If creation fails, the status becomes Failed.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"
      • updatedAt — (Date)

        The time at which the flow was last updated.

      • version — (String)

        The version of the flow. When you create a flow, the version created is the DRAFT version.

Returns:

  • (AWS.Request)

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

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

Creates an alias of a flow for deployment. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the createFlowAlias operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  routingConfiguration: [ /* required */
    {
      flowVersion: 'STRING_VALUE'
    },
    /* more items */
  ],
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createFlowAlias(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: {})
    • clientToken — (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.
    • description — (String)

      A description for the alias.

    • flowIdentifier — (String)

      The unique identifier of the flow for which to create an alias.

    • name — (String)

      A name for the alias.

    • routingConfiguration — (Array<map>)

      Contains information about the version to which to map the alias.

      • flowVersion — (String)

        The version that the alias maps to.

    • tags — (map<String>)

      Any tags that you want to attach to the alias of the flow. For more information, see Tagging resources in Amazon Bedrock.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the alias.

      • createdAt — (Date)

        The time at which the alias was created.

      • description — (String)

        The description of the alias.

      • flowId — (String)

        The unique identifier of the flow that the alias belongs to.

      • id — (String)

        The unique identifier of the alias.

      • name — (String)

        The name of the alias.

      • routingConfiguration — (Array<map>)

        Contains information about the version that the alias is mapped to.

        • flowVersion — (String)

          The version that the alias maps to.

      • updatedAt — (Date)

        The time at which the alias of the flow was last updated.

Returns:

  • (AWS.Request)

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

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

Creates a version of the flow that you can deploy. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the createFlowVersion operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE'
};
bedrockagent.createFlowVersion(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: {})
    • clientToken — (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.
    • description — (String)

      A description of the version of the flow.

    • flowIdentifier — (String)

      The unique identifier of the flow that you want to create a version of.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • customerEncryptionKeyArn — (String)

        The KMS key that the flow is encrypted with.

      • definition — (map)

        A definition of the nodes and connections in the flow.

        • connections — (Array<map>)

          An array of connection definitions in the flow.

          • configuration — (map)

            The configuration of the connection.

            • conditional — (map)

              The configuration of a connection originating from a Condition node.

              • conditionrequired — (String)

                The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

            • data — (map)

              The configuration of a connection originating from a node that isn't a Condition node.

              • sourceOutputrequired — (String)

                The name of the output in the source node that the connection begins from.

              • targetInputrequired — (String)

                The name of the input in the target node that the connection ends at.

          • namerequired — (String)

            A name for the connection that you can reference.

          • sourcerequired — (String)

            The node that the connection starts at.

          • targetrequired — (String)

            The node that the connection ends at.

          • typerequired — (String)

            Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

            Possible values include:
            • "Data"
            • "Conditional"
        • nodes — (Array<map>)

          An array of node definitions in the flow.

          • configuration — (map)

            Contains configurations for the node.

            • agent — (map)

              Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

              • agentAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the alias of the agent to invoke.

            • collector — (map)

              Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

            • condition — (map)

              Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

              • conditionsrequired — (Array<map>)

                An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

                • expression — (String)

                  Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

                • namerequired — (String)

                  A name for the condition that you can reference.

            • input — (map)

              Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

            • iterator — (map)

              Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

              The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

            • knowledgeBase — (map)

              Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

              • knowledgeBaseIdrequired — (String)

                The unique identifier of the knowledge base to query.

              • modelId — (String)

                The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

            • lambdaFunction — (map)

              Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

              • lambdaArnrequired — (String)

                The Amazon Resource Name (ARN) of the Lambda function to invoke.

            • lex — (map)

              Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

              • botAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

              • localeIdrequired — (String)

                The Region to invoke the Amazon Lex bot in.

            • output — (map)

              Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

            • prompt — (map)

              Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

              • sourceConfigurationrequired — (map)

                Specifies whether the prompt is from Prompt management or defined inline.

                • inline — (map)

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration — (map)

                    Contains inference configurations for the prompt.

                    • text — (map)

                      Contains inference configurations for a text prompt.

                      • maxTokens — (Integer)

                        The maximum number of tokens to return in the response.

                      • stopSequences — (Array<String>)

                        A list of strings that define sequences after which the model will stop generating.

                      • temperature — (Float)

                        Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                      • topK — (Integer)

                        The number of most-likely candidates that the model considers for the next token during generation.

                      • topP — (Float)

                        The percentage of most-likely candidates that the model considers for the next token.

                  • modelIdrequired — (String)

                    The unique identifier of the model to run inference with.

                  • templateConfigurationrequired — (map)

                    Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                    • text — (map)

                      Contains configurations for the text in a message for a prompt.

                      • inputVariables — (Array<map>)

                        An array of the variables in the prompt template.

                        • name — (String)

                          The name of the variable.

                      • textrequired — (String)

                        The message for the prompt.

                  • templateTyperequired — (String)

                    The type of prompt template.

                    Possible values include:
                    • "TEXT"
                • resource — (map)

                  Contains configurations for a prompt from Prompt management.

                  • promptArnrequired — (String)

                    The Amazon Resource Name (ARN) of the prompt from Prompt management.

            • retrieval — (map)

              Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for retrieving data to return as the output from the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket from which to retrieve data.

            • storage — (map)

              Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for storing the input into the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location in which to store the input into the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket in which to store the input into the node.

          • inputs — (Array<map>)

            An array of objects, each of which contains information about an input into the node.

            • expressionrequired — (String)

              An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

            • namerequired — (String)

              A name for the input that you can reference.

            • typerequired — (String)

              The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • namerequired — (String)

            A name for the node.

          • outputs — (Array<map>)

            A list of objects, each of which contains information about an output from the node.

            • namerequired — (String)

              A name for the output that you can reference.

            • typerequired — (String)

              The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • typerequired — (String)

            The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

            Possible values include:
            • "Input"
            • "Output"
            • "KnowledgeBase"
            • "Condition"
            • "Lex"
            • "Prompt"
            • "LambdaFunction"
            • "Storage"
            • "Agent"
            • "Retrieval"
            • "Iterator"
            • "Collector"
      • description — (String)

        The description of the flow version.

      • executionRoleArn — (String)

        The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

      • id — (String)

        The unique identifier of the flow.

      • name — (String)

        The name of the flow version.

      • status — (String)

        The status of the flow.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"
      • version — (String)

        The version of the flow that was created. Versions are numbered incrementally, starting from 1.

Returns:

  • (AWS.Request)

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

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

Creates a knowledge base that contains data sources from which information can be queried and used by LLMs. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see Set up your data for ingestion.

Note: If you prefer to let Amazon Bedrock create and manage a vector store for you in Amazon OpenSearch Service, use the console. For more information, see Create a knowledge base.
  • Provide the name and an optional description.

  • Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the roleArn field.

  • Provide the embedding model to use in the embeddingModelArn field in the knowledgeBaseConfiguration object.

  • Provide the configuration for your vector store in the storageConfiguration object.

Service Reference:

Examples:

Calling the createKnowledgeBase operation

var params = {
  knowledgeBaseConfiguration: { /* required */
    type: VECTOR, /* required */
    vectorKnowledgeBaseConfiguration: {
      embeddingModelArn: 'STRING_VALUE', /* required */
      embeddingModelConfiguration: {
        bedrockEmbeddingModelConfiguration: {
          dimensions: 'NUMBER_VALUE'
        }
      }
    }
  },
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  storageConfiguration: { /* required */
    type: OPENSEARCH_SERVERLESS | PINECONE | REDIS_ENTERPRISE_CLOUD | RDS | MONGO_DB_ATLAS, /* required */
    mongoDbAtlasConfiguration: {
      collectionName: 'STRING_VALUE', /* required */
      credentialsSecretArn: 'STRING_VALUE', /* required */
      databaseName: 'STRING_VALUE', /* required */
      endpoint: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE', /* required */
      endpointServiceName: 'STRING_VALUE'
    },
    opensearchServerlessConfiguration: {
      collectionArn: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE' /* required */
    },
    pineconeConfiguration: {
      connectionString: 'STRING_VALUE', /* required */
      credentialsSecretArn: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE' /* required */
      },
      namespace: 'STRING_VALUE'
    },
    rdsConfiguration: {
      credentialsSecretArn: 'STRING_VALUE', /* required */
      databaseName: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        primaryKeyField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      resourceArn: 'STRING_VALUE', /* required */
      tableName: 'STRING_VALUE' /* required */
    },
    redisEnterpriseCloudConfiguration: {
      credentialsSecretArn: 'STRING_VALUE', /* required */
      endpoint: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE' /* required */
    }
  },
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createKnowledgeBase(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: {})
    • clientToken — (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.
    • description — (String)

      A description of the knowledge base.

    • knowledgeBaseConfiguration — (map)

      Contains details about the embeddings model used for the knowledge base.

      • typerequired — (String)

        The type of data that the data source is converted into for the knowledge base.

        Possible values include:
        • "VECTOR"
      • vectorKnowledgeBaseConfiguration — (map)

        Contains details about the embeddings model that'sused to convert the data source.

        • embeddingModelArnrequired — (String)

          The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

        • embeddingModelConfiguration — (map)

          The embeddings model configuration details for the vector model used in Knowledge Base.

          • bedrockEmbeddingModelConfiguration — (map)

            The vector configuration details on the Bedrock embeddings model.

            • dimensions — (Integer)

              The dimensions details for the vector configuration used on the Bedrock embeddings model.

    • name — (String)

      A name for the knowledge base.

    • roleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

    • storageConfiguration — (map)

      Contains details about the configuration of the vector database used for the knowledge base.

      • mongoDbAtlasConfiguration — (map)

        Contains the storage configuration of the knowledge base in MongoDB Atlas.

        • collectionNamerequired — (String)

          The collection name of the knowledge base in MongoDB Atlas.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

        • databaseNamerequired — (String)

          The database name in your MongoDB Atlas cluster for your knowledge base.

        • endpointrequired — (String)

          The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

        • endpointServiceName — (String)

          The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the MongoDB Atlas vector search index.

      • opensearchServerlessConfiguration — (map)

        Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

        • collectionArnrequired — (String)

          The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the vector store.

      • pineconeConfiguration — (map)

        Contains the storage configuration of the knowledge base in Pinecone.

        • connectionStringrequired — (String)

          The endpoint URL for your index management page.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

        • namespace — (String)

          The namespace to be used to write new data to your database.

      • rdsConfiguration — (map)

        Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

        • databaseNamerequired — (String)

          The name of your Amazon RDS database.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • primaryKeyFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the ID for each entry.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • resourceArnrequired — (String)

          The Amazon Resource Name (ARN) of the vector store.

        • tableNamerequired — (String)

          The name of the table in the database.

      • redisEnterpriseCloudConfiguration — (map)

        Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

        • endpointrequired — (String)

          The endpoint URL of the Redis Enterprise Cloud database.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the vector index.

      • typerequired — (String)

        The vector store service in which the knowledge base is stored.

        Possible values include:
        • "OPENSEARCH_SERVERLESS"
        • "PINECONE"
        • "REDIS_ENTERPRISE_CLOUD"
        • "RDS"
        • "MONGO_DB_ATLAS"
    • tags — (map<String>)

      Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.

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:

      • knowledgeBase — (map)

        Contains details about the knowledge base.

        • createdAtrequired — (Date)

          The time at which the knowledge base was created.

        • description — (String)

          The description of the knowledge base.

        • failureReasons — (Array<String>)

          A list of reasons that the API operation on the knowledge base failed.

        • knowledgeBaseArnrequired — (String)

          The Amazon Resource Name (ARN) of the knowledge base.

        • knowledgeBaseConfigurationrequired — (map)

          Contains details about the embeddings configuration of the knowledge base.

          • typerequired — (String)

            The type of data that the data source is converted into for the knowledge base.

            Possible values include:
            • "VECTOR"
          • vectorKnowledgeBaseConfiguration — (map)

            Contains details about the embeddings model that'sused to convert the data source.

            • embeddingModelArnrequired — (String)

              The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

            • embeddingModelConfiguration — (map)

              The embeddings model configuration details for the vector model used in Knowledge Base.

              • bedrockEmbeddingModelConfiguration — (map)

                The vector configuration details on the Bedrock embeddings model.

                • dimensions — (Integer)

                  The dimensions details for the vector configuration used on the Bedrock embeddings model.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base.

        • namerequired — (String)

          The name of the knowledge base.

        • roleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

        • statusrequired — (String)

          The status of the knowledge base. The following statuses are possible:

          • CREATING – The knowledge base is being created.

          • ACTIVE – The knowledge base is ready to be queried.

          • DELETING – The knowledge base is being deleted.

          • UPDATING – The knowledge base is being updated.

          • FAILED – The knowledge base API operation failed.

          Possible values include:
          • "CREATING"
          • "ACTIVE"
          • "DELETING"
          • "UPDATING"
          • "FAILED"
          • "DELETE_UNSUCCESSFUL"
        • storageConfigurationrequired — (map)

          Contains details about the storage configuration of the knowledge base.

          • mongoDbAtlasConfiguration — (map)

            Contains the storage configuration of the knowledge base in MongoDB Atlas.

            • collectionNamerequired — (String)

              The collection name of the knowledge base in MongoDB Atlas.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

            • databaseNamerequired — (String)

              The database name in your MongoDB Atlas cluster for your knowledge base.

            • endpointrequired — (String)

              The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

            • endpointServiceName — (String)

              The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the MongoDB Atlas vector search index.

          • opensearchServerlessConfiguration — (map)

            Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

            • collectionArnrequired — (String)

              The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector store.

          • pineconeConfiguration — (map)

            Contains the storage configuration of the knowledge base in Pinecone.

            • connectionStringrequired — (String)

              The endpoint URL for your index management page.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • namespace — (String)

              The namespace to be used to write new data to your database.

          • rdsConfiguration — (map)

            Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

            • databaseNamerequired — (String)

              The name of your Amazon RDS database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • primaryKeyFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the ID for each entry.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • resourceArnrequired — (String)

              The Amazon Resource Name (ARN) of the vector store.

            • tableNamerequired — (String)

              The name of the table in the database.

          • redisEnterpriseCloudConfiguration — (map)

            Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

            • endpointrequired — (String)

              The endpoint URL of the Redis Enterprise Cloud database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector index.

          • typerequired — (String)

            The vector store service in which the knowledge base is stored.

            Possible values include:
            • "OPENSEARCH_SERVERLESS"
            • "PINECONE"
            • "REDIS_ENTERPRISE_CLOUD"
            • "RDS"
            • "MONGO_DB_ATLAS"
        • updatedAtrequired — (Date)

          The time at which the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Creates a prompt in your prompt library that you can add to a flow. For more information, see Prompt management in Amazon Bedrock, Create a prompt using Prompt management and Prompt flows in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the createPrompt operation

var params = {
  name: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  customerEncryptionKeyArn: 'STRING_VALUE',
  defaultVariant: 'STRING_VALUE',
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  },
  variants: [
    {
      name: 'STRING_VALUE', /* required */
      templateType: TEXT, /* required */
      inferenceConfiguration: {
        text: {
          maxTokens: 'NUMBER_VALUE',
          stopSequences: [
            'STRING_VALUE',
            /* more items */
          ],
          temperature: 'NUMBER_VALUE',
          topK: 'NUMBER_VALUE',
          topP: 'NUMBER_VALUE'
        }
      },
      modelId: 'STRING_VALUE',
      templateConfiguration: {
        text: {
          text: 'STRING_VALUE', /* required */
          inputVariables: [
            {
              name: 'STRING_VALUE'
            },
            /* more items */
          ]
        }
      }
    },
    /* more items */
  ]
};
bedrockagent.createPrompt(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: {})
    • clientToken — (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.
    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.

    • defaultVariant — (String)

      The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

    • description — (String)

      A description for the prompt.

    • name — (String)

      A name for the prompt.

    • tags — (map<String>)

      Any tags that you want to attach to the prompt. For more information, see Tagging resources in Amazon Bedrock.

    • variants — (Array<map>)

      A list of objects, each containing details about a variant of the prompt.

      • inferenceConfiguration — (map)

        Contains inference configurations for the prompt variant.

        • text — (map)

          Contains inference configurations for a text prompt.

          • maxTokens — (Integer)

            The maximum number of tokens to return in the response.

          • stopSequences — (Array<String>)

            A list of strings that define sequences after which the model will stop generating.

          • temperature — (Float)

            Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

          • topK — (Integer)

            The number of most-likely candidates that the model considers for the next token during generation.

          • topP — (Float)

            The percentage of most-likely candidates that the model considers for the next token.

      • modelId — (String)

        The unique identifier of the model with which to run inference on the prompt.

      • namerequired — (String)

        The name of the prompt variant.

      • templateConfiguration — (map)

        Contains configurations for the prompt template.

        • text — (map)

          Contains configurations for the text in a message for a prompt.

          • inputVariables — (Array<map>)

            An array of the variables in the prompt template.

            • name — (String)

              The name of the variable.

          • textrequired — (String)

            The message for the prompt.

      • templateTyperequired — (String)

        The type of prompt template to use.

        Possible values include:
        • "TEXT"

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the prompt.

      • createdAt — (Date)

        The time at which the prompt was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that you encrypted the prompt with.

      • defaultVariant — (String)

        The name of the default variant for your prompt.

      • description — (String)

        The description of the prompt.

      • id — (String)

        The unique identifier of the prompt.

      • name — (String)

        The name of the prompt.

      • updatedAt — (Date)

        The time at which the prompt was last updated.

      • variants — (Array<map>)

        A list of objects, each containing details about a variant of the prompt.

        • inferenceConfiguration — (map)

          Contains inference configurations for the prompt variant.

          • text — (map)

            Contains inference configurations for a text prompt.

            • maxTokens — (Integer)

              The maximum number of tokens to return in the response.

            • stopSequences — (Array<String>)

              A list of strings that define sequences after which the model will stop generating.

            • temperature — (Float)

              Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

            • topK — (Integer)

              The number of most-likely candidates that the model considers for the next token during generation.

            • topP — (Float)

              The percentage of most-likely candidates that the model considers for the next token.

        • modelId — (String)

          The unique identifier of the model with which to run inference on the prompt.

        • namerequired — (String)

          The name of the prompt variant.

        • templateConfiguration — (map)

          Contains configurations for the prompt template.

          • text — (map)

            Contains configurations for the text in a message for a prompt.

            • inputVariables — (Array<map>)

              An array of the variables in the prompt template.

              • name — (String)

                The name of the variable.

            • textrequired — (String)

              The message for the prompt.

        • templateTyperequired — (String)

          The type of prompt template to use.

          Possible values include:
          • "TEXT"
      • version — (String)

        The version of the prompt. When you create a prompt, the version created is the DRAFT version.

Returns:

  • (AWS.Request)

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

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

Creates a static snapshot of your prompt that can be deployed to production. For more information, see Deploy prompts using Prompt management by creating versions in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the createPromptVersion operation

var params = {
  promptIdentifier: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.createPromptVersion(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: {})
    • clientToken — (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.
    • description — (String)

      A description for the version of the prompt.

    • promptIdentifier — (String)

      The unique identifier of the prompt that you want to create a version of.

    • tags — (map<String>)

      Any tags that you want to attach to the version of the prompt. For more information, see Tagging resources in Amazon Bedrock.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the version of the prompt.

      • createdAt — (Date)

        The time at which the prompt was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key to encrypt the version of the prompt.

      • defaultVariant — (String)

        The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

      • description — (String)

        A description for the prompt version.

      • id — (String)

        The unique identifier of the prompt.

      • name — (String)

        The name of the prompt version.

      • updatedAt — (Date)

        The time at which the prompt was last updated.

      • variants — (Array<map>)

        A list of objects, each containing details about a variant of the prompt.

        • inferenceConfiguration — (map)

          Contains inference configurations for the prompt variant.

          • text — (map)

            Contains inference configurations for a text prompt.

            • maxTokens — (Integer)

              The maximum number of tokens to return in the response.

            • stopSequences — (Array<String>)

              A list of strings that define sequences after which the model will stop generating.

            • temperature — (Float)

              Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

            • topK — (Integer)

              The number of most-likely candidates that the model considers for the next token during generation.

            • topP — (Float)

              The percentage of most-likely candidates that the model considers for the next token.

        • modelId — (String)

          The unique identifier of the model with which to run inference on the prompt.

        • namerequired — (String)

          The name of the prompt variant.

        • templateConfiguration — (map)

          Contains configurations for the prompt template.

          • text — (map)

            Contains configurations for the text in a message for a prompt.

            • inputVariables — (Array<map>)

              An array of the variables in the prompt template.

              • name — (String)

                The name of the variable.

            • textrequired — (String)

              The message for the prompt.

        • templateTyperequired — (String)

          The type of prompt template to use.

          Possible values include:
          • "TEXT"
      • version — (String)

        The version of the prompt that was created. Versions are numbered incrementally, starting from 1.

Returns:

  • (AWS.Request)

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

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

Deletes an agent.

Service Reference:

Examples:

Calling the deleteAgent operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  skipResourceInUseCheck: true || false
};
bedrockagent.deleteAgent(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: {})
    • agentId — (String)

      The unique identifier of the agent to delete.

    • skipResourceInUseCheck — (Boolean)

      By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

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:

      • agentId — (String)

        The unique identifier of the agent that was deleted.

      • agentStatus — (String)

        The status of the agent.

        Possible values include:
        • "CREATING"
        • "PREPARING"
        • "PREPARED"
        • "NOT_PREPARED"
        • "DELETING"
        • "FAILED"
        • "VERSIONING"
        • "UPDATING"

Returns:

  • (AWS.Request)

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

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

Deletes an action group in an agent.

Service Reference:

Examples:

Calling the deleteAgentActionGroup operation

var params = {
  actionGroupId: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  skipResourceInUseCheck: true || false
};
bedrockagent.deleteAgentActionGroup(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: {})
    • actionGroupId — (String)

      The unique identifier of the action group to delete.

    • agentId — (String)

      The unique identifier of the agent that the action group belongs to.

    • agentVersion — (String)

      The version of the agent that the action group belongs to.

    • skipResourceInUseCheck — (Boolean)

      By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

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.

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

Deletes an alias of an agent.

Service Reference:

Examples:

Calling the deleteAgentAlias operation

var params = {
  agentAliasId: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE' /* required */
};
bedrockagent.deleteAgentAlias(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: {})
    • agentAliasId — (String)

      The unique identifier of the alias to delete.

    • agentId — (String)

      The unique identifier of the agent that the alias belongs 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:

      • agentAliasId — (String)

        The unique identifier of the alias that was deleted.

      • agentAliasStatus — (String)

        The status of the alias.

        Possible values include:
        • "CREATING"
        • "PREPARED"
        • "FAILED"
        • "UPDATING"
        • "DELETING"
      • agentId — (String)

        The unique identifier of the agent that the alias belongs to.

Returns:

  • (AWS.Request)

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

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

Deletes a version of an agent.

Service Reference:

Examples:

Calling the deleteAgentVersion operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  skipResourceInUseCheck: true || false
};
bedrockagent.deleteAgentVersion(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: {})
    • agentId — (String)

      The unique identifier of the agent that the version belongs to.

    • agentVersion — (String)

      The version of the agent to delete.

    • skipResourceInUseCheck — (Boolean)

      By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

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:

      • agentId — (String)

        The unique identifier of the agent that the version belongs to.

      • agentStatus — (String)

        The status of the agent version.

        Possible values include:
        • "CREATING"
        • "PREPARING"
        • "PREPARED"
        • "NOT_PREPARED"
        • "DELETING"
        • "FAILED"
        • "VERSIONING"
        • "UPDATING"
      • agentVersion — (String)

        The version that was deleted.

Returns:

  • (AWS.Request)

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

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

Deletes a data source from a knowledge base.

Service Reference:

Examples:

Calling the deleteDataSource operation

var params = {
  dataSourceId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.deleteDataSource(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: {})
    • dataSourceId — (String)

      The unique identifier of the data source to delete.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base from which to delete the data source.

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:

      • dataSourceId — (String)

        The unique identifier of the data source that was deleted.

      • knowledgeBaseId — (String)

        The unique identifier of the knowledge base to which the data source that was deleted belonged.

      • status — (String)

        The status of the data source.

        Possible values include:
        • "AVAILABLE"
        • "DELETING"
        • "DELETE_UNSUCCESSFUL"

Returns:

  • (AWS.Request)

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

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

Deletes a flow.

Service Reference:

Examples:

Calling the deleteFlow operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  skipResourceInUseCheck: true || false
};
bedrockagent.deleteFlow(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow.

    • skipResourceInUseCheck — (Boolean)

      By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

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:

      • id — (String)

        The unique identifier of the flow.

Returns:

  • (AWS.Request)

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

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

Deletes an alias of a flow.

Service Reference:

Examples:

Calling the deleteFlowAlias operation

var params = {
  aliasIdentifier: 'STRING_VALUE', /* required */
  flowIdentifier: 'STRING_VALUE' /* required */
};
bedrockagent.deleteFlowAlias(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: {})
    • aliasIdentifier — (String)

      The unique identifier of the alias to be deleted.

    • flowIdentifier — (String)

      The unique identifier of the flow that the alias belongs 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:

      • flowId — (String)

        The unique identifier of the flow that the alias belongs to.

      • id — (String)

        The unique identifier of the flow.

Returns:

  • (AWS.Request)

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

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

Deletes a version of a flow.

Service Reference:

Examples:

Calling the deleteFlowVersion operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  flowVersion: 'STRING_VALUE', /* required */
  skipResourceInUseCheck: true || false
};
bedrockagent.deleteFlowVersion(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow whose version that you want to delete

    • flowVersion — (String)

      The version of the flow that you want to delete.

    • skipResourceInUseCheck — (Boolean)

      By default, this value is false and deletion is stopped if the resource is in use. If you set it to true, the resource will be deleted even if the resource is in use.

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:

      • id — (String)

        The unique identifier of the flow.

      • version — (String)

        The version of the flow being deleted.

Returns:

  • (AWS.Request)

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

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

Deletes a knowledge base. Before deleting a knowledge base, you should disassociate the knowledge base from any agents that it is associated with by making a DisassociateAgentKnowledgeBase request.

Service Reference:

Examples:

Calling the deleteKnowledgeBase operation

var params = {
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.deleteKnowledgeBase(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: {})
    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base 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. The data object has the following properties:

      • knowledgeBaseId — (String)

        The unique identifier of the knowledge base that was deleted.

      • status — (String)

        The status of the knowledge base and whether it has been successfully deleted.

        Possible values include:
        • "CREATING"
        • "ACTIVE"
        • "DELETING"
        • "UPDATING"
        • "FAILED"
        • "DELETE_UNSUCCESSFUL"

Returns:

  • (AWS.Request)

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

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

Deletes a prompt or a prompt version from the Prompt management tool. For more information, see Delete prompts from the Prompt management tool and Delete a version of a prompt from the Prompt management tool in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the deletePrompt operation

var params = {
  promptIdentifier: 'STRING_VALUE', /* required */
  promptVersion: 'STRING_VALUE'
};
bedrockagent.deletePrompt(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: {})
    • promptIdentifier — (String)

      The unique identifier of the prompt.

    • promptVersion — (String)

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

      • id — (String)

        The unique identifier of the prompt that was deleted.

      • version — (String)

        The version of the prompt that was deleted.

Returns:

  • (AWS.Request)

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

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

Disassociates a knowledge base from an agent.

Service Reference:

Examples:

Calling the disassociateAgentKnowledgeBase operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.disassociateAgentKnowledgeBase(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: {})
    • agentId — (String)

      The unique identifier of the agent from which to disassociate the knowledge base.

    • agentVersion — (String)

      The version of the agent from which to disassociate the knowledge base.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base to disassociate.

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.

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

Gets information about an agent.

Service Reference:

Examples:

Calling the getAgent operation

var params = {
  agentId: 'STRING_VALUE' /* required */
};
bedrockagent.getAgent(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: {})
    • agentId — (String)

      The unique identifier of the agent.

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:

      • agent — (map)

        Contains details about the agent.

        • agentArnrequired — (String)

          The Amazon Resource Name (ARN) of the agent.

        • agentIdrequired — (String)

          The unique identifier of the agent.

        • agentNamerequired — (String)

          The name of the agent.

        • agentResourceRoleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

        • agentStatusrequired — (String)

          The status of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent is being created.

          • PREPARING – The agent is being prepared.

          • PREPARED – The agent is prepared and ready to be invoked.

          • NOT_PREPARED – The agent has been created but not yet prepared.

          • FAILED – The agent API operation failed.

          • UPDATING – The agent is being updated.

          • DELETING – The agent is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • agentVersionrequired — (String)

          The version of the agent.

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

        • createdAtrequired — (Date)

          The time at which the agent was created.

        • customerEncryptionKeyArn — (String)

          The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.

        • description — (String)

          The description of the agent.

        • failureReasons — (Array<String>)

          Contains reasons that the agent-related API that you invoked failed.

        • foundationModel — (String)

          The foundation model used for orchestration by the agent.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • idleSessionTTLInSecondsrequired — (Integer)

          The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

        • instruction — (String)

          Instructions that tell the agent what it should do and how it should interact with users.

        • memoryConfiguration — (map)

          Contains memory configuration for the agent.

          • enabledMemoryTypesrequired — (Array<String>)

            The type of memory that is stored.

          • storageDays — (Integer)

            The number of days the agent is configured to retain the conversational context.

        • preparedAt — (Date)

          The time at which the agent was last prepared.

        • promptOverrideConfiguration — (map)

          Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see Advanced prompts.

          • overrideLambda — (String)

            The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

          • promptConfigurationsrequired — (Array<map>)

            Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

            • basePromptTemplate — (String)

              Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

            • inferenceConfiguration — (map)

              Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

              • maximumLength — (Integer)

                The maximum number of tokens to allow in the generated response.

              • stopSequences — (Array<String>)

                A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

              • temperature — (Float)

                The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

              • topK — (Integer)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

              • topP — (Float)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

            • parserMode — (String)

              Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptCreationMode — (String)

              Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptState — (String)

              Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

              • PRE_PROCESSINGENABLED

              • ORCHESTRATIONENABLED

              • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

              • POST_PROCESSINGDISABLED

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • promptType — (String)

              The step in the agent sequence that this prompt configuration applies to.

              Possible values include:
              • "PRE_PROCESSING"
              • "ORCHESTRATION"
              • "POST_PROCESSING"
              • "KNOWLEDGE_BASE_RESPONSE_GENERATION"
        • recommendedActions — (Array<String>)

          Contains recommended actions to take for the agent-related API that you invoked to succeed.

        • updatedAtrequired — (Date)

          The time at which the agent was last updated.

Returns:

  • (AWS.Request)

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

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

Gets information about an action group for an agent.

Service Reference:

Examples:

Calling the getAgentActionGroup operation

var params = {
  actionGroupId: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE' /* required */
};
bedrockagent.getAgentActionGroup(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: {})
    • actionGroupId — (String)

      The unique identifier of the action group for which to get information.

    • agentId — (String)

      The unique identifier of the agent that the action group belongs to.

    • agentVersion — (String)

      The version of the agent that the action group belongs 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:

      • agentActionGroup — (map)

        Contains details about the action group.

        • actionGroupExecutor — (map)

          The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.

          • customControl — (String)

            To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL.

            Possible values include:
            • "RETURN_CONTROL"
          • lambda — (String)

            The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

        • actionGroupIdrequired — (String)

          The unique identifier of the action group.

        • actionGroupNamerequired — (String)

          The name of the action group.

        • actionGroupStaterequired — (String)

          Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • agentIdrequired — (String)

          The unique identifier of the agent to which the action group belongs.

        • agentVersionrequired — (String)

          The version of the agent to which the action group belongs.

        • apiSchema — (map)

          Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.

          • payload — (String)

            The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

          • s3 — (map)

            Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

            • s3BucketName — (String)

              The name of the S3 bucket.

            • s3ObjectKey — (String)

              The S3 object key for the S3 resource.

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

        • createdAtrequired — (Date)

          The time at which the action group was created.

        • description — (String)

          The description of the action group.

        • functionSchema — (map)

          Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.

          • functions — (Array<map>)

            A list of functions that each define an action in the action group.

            • description — (String)

              A description of the function and its purpose.

            • namerequired — (String)

              A name for the function.

            • parameters — (map<map>)

              The parameters that the agent elicits from the user to fulfill the function.

              • description — (String)

                A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

              • required — (Boolean)

                Whether the parameter is required for the agent to complete the function for action group invocation.

              • typerequired — (String)

                The data type of the parameter.

                Possible values include:
                • "string"
                • "number"
                • "integer"
                • "boolean"
                • "array"
        • parentActionSignature — (String)

          If this field is set as AMAZON.UserInput, the agent can request the user for additional information when trying to complete a task. The description, apiSchema, and actionGroupExecutor fields must be blank for this action group.

          During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

          Possible values include:
          • "AMAZON.UserInput"
          • "AMAZON.CodeInterpreter"
        • updatedAtrequired — (Date)

          The time at which the action group was last updated.

Returns:

  • (AWS.Request)

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

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

Gets information about an alias of an agent.

Service Reference:

Examples:

Calling the getAgentAlias operation

var params = {
  agentAliasId: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE' /* required */
};
bedrockagent.getAgentAlias(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: {})
    • agentAliasId — (String)

      The unique identifier of the alias for which to get information.

    • agentId — (String)

      The unique identifier of the agent to which the alias to get information belongs.

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:

      • agentAlias — (map)

        Contains information about the alias.

        • agentAliasArnrequired — (String)

          The Amazon Resource Name (ARN) of the alias of the agent.

        • agentAliasHistoryEvents — (Array<map>)

          Contains details about the history of the alias.

          • endDate — (Date)

            The date that the alias stopped being associated to the version in the routingConfiguration object

          • routingConfiguration — (Array<map>)

            Contains details about the version of the agent with which the alias is associated.

            • agentVersion — (String)

              The version of the agent with which the alias is associated.

            • provisionedThroughput — (String)

              Information on the Provisioned Throughput assigned to an agent alias.

          • startDate — (Date)

            The date that the alias began being associated to the version in the routingConfiguration object.

        • agentAliasIdrequired — (String)

          The unique identifier of the alias of the agent.

        • agentAliasNamerequired — (String)

          The name of the alias of the agent.

        • agentAliasStatusrequired — (String)

          The status of the alias of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent alias is being created.

          • PREPARED – The agent alias is finished being created or updated and is ready to be invoked.

          • FAILED – The agent alias API operation failed.

          • UPDATING – The agent alias is being updated.

          • DELETING – The agent alias is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARED"
          • "FAILED"
          • "UPDATING"
          • "DELETING"
        • agentIdrequired — (String)

          The unique identifier of the agent.

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

        • createdAtrequired — (Date)

          The time at which the alias of the agent was created.

        • description — (String)

          The description of the alias of the agent.

        • failureReasons — (Array<String>)

          Information on the failure of Provisioned Throughput assigned to an agent alias.

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersion — (String)

            The version of the agent with which the alias is associated.

          • provisionedThroughput — (String)

            Information on the Provisioned Throughput assigned to an agent alias.

        • updatedAtrequired — (Date)

          The time at which the alias was last updated.

Returns:

  • (AWS.Request)

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

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

Gets information about a knowledge base associated with an agent.

Service Reference:

Examples:

Calling the getAgentKnowledgeBase operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.getAgentKnowledgeBase(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: {})
    • agentId — (String)

      The unique identifier of the agent with which the knowledge base is associated.

    • agentVersion — (String)

      The version of the agent with which the knowledge base is associated.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base associated with the agent.

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:

      • agentKnowledgeBase — (map)

        Contains details about a knowledge base attached to an agent.

        • agentIdrequired — (String)

          The unique identifier of the agent with which the knowledge base is associated.

        • agentVersionrequired — (String)

          The version of the agent with which the knowledge base is associated.

        • createdAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was created.

        • descriptionrequired — (String)

          The description of the association between the agent and the knowledge base.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the association between the agent and the knowledge base.

        • knowledgeBaseStaterequired — (String)

          Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • updatedAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Gets details about a version of an agent.

Service Reference:

Examples:

Calling the getAgentVersion operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE' /* required */
};
bedrockagent.getAgentVersion(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: {})
    • agentId — (String)

      The unique identifier of the agent.

    • agentVersion — (String)

      The version of the agent.

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:

      • agentVersion — (map)

        Contains details about the version of the agent.

        • agentArnrequired — (String)

          The Amazon Resource Name (ARN) of the agent that the version belongs to.

        • agentIdrequired — (String)

          The unique identifier of the agent that the version belongs to.

        • agentNamerequired — (String)

          The name of the agent that the version belongs to.

        • agentResourceRoleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

        • agentStatusrequired — (String)

          The status of the agent that the version belongs to.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • createdAtrequired — (Date)

          The time at which the version was created.

        • customerEncryptionKeyArn — (String)

          The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.

        • description — (String)

          The description of the version.

        • failureReasons — (Array<String>)

          A list of reasons that the API operation on the version failed.

        • foundationModel — (String)

          The foundation model that the version invokes.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • idleSessionTTLInSecondsrequired — (Integer)

          The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

        • instruction — (String)

          The instructions provided to the agent.

        • memoryConfiguration — (map)

          Contains details of the memory configuration on the version of the agent.

          • enabledMemoryTypesrequired — (Array<String>)

            The type of memory that is stored.

          • storageDays — (Integer)

            The number of days the agent is configured to retain the conversational context.

        • promptOverrideConfiguration — (map)

          Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see Advanced prompts.

          • overrideLambda — (String)

            The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

          • promptConfigurationsrequired — (Array<map>)

            Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

            • basePromptTemplate — (String)

              Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

            • inferenceConfiguration — (map)

              Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

              • maximumLength — (Integer)

                The maximum number of tokens to allow in the generated response.

              • stopSequences — (Array<String>)

                A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

              • temperature — (Float)

                The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

              • topK — (Integer)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

              • topP — (Float)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

            • parserMode — (String)

              Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptCreationMode — (String)

              Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptState — (String)

              Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

              • PRE_PROCESSINGENABLED

              • ORCHESTRATIONENABLED

              • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

              • POST_PROCESSINGDISABLED

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • promptType — (String)

              The step in the agent sequence that this prompt configuration applies to.

              Possible values include:
              • "PRE_PROCESSING"
              • "ORCHESTRATION"
              • "POST_PROCESSING"
              • "KNOWLEDGE_BASE_RESPONSE_GENERATION"
        • recommendedActions — (Array<String>)

          A list of recommended actions to take for the failed API operation on the version to succeed.

        • updatedAtrequired — (Date)

          The time at which the version was last updated.

        • versionrequired — (String)

          The version number.

Returns:

  • (AWS.Request)

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

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

Gets information about a data source.

Service Reference:

Examples:

Calling the getDataSource operation

var params = {
  dataSourceId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.getDataSource(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: {})
    • dataSourceId — (String)

      The unique identifier of the data source.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base that the data source was added 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:

      • dataSource — (map)

        Contains details about the data source.

        • createdAtrequired — (Date)

          The time at which the data source was created.

        • dataDeletionPolicy — (String)

          The data deletion policy for the data source.

          Possible values include:
          • "RETAIN"
          • "DELETE"
        • dataSourceConfigurationrequired — (map)

          The connection configuration for the data source.

          • confluenceConfiguration — (map)

            The configuration information to connect to Confluence as your data source.

            Note: Confluence data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Confluence content. For example, configuring specific types of Confluence content.

              • filterConfiguration — (map)

                The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Confluence data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Confluence instance.

                Possible values include:
                • "BASIC"
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "SAAS"
              • hostUrlrequired — (String)

                The Confluence host URL or instance URL.

          • s3Configuration — (map)

            The configuration information to connect to Amazon S3 as your data source.

            • bucketArnrequired — (String)

              The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

          • salesforceConfiguration — (map)

            The configuration information to connect to Salesforce as your data source.

            Note: Salesforce data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

              • filterConfiguration — (map)

                The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Salesforce data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Salesforce instance.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

              • hostUrlrequired — (String)

                The Salesforce host URL or instance URL.

          • sharePointConfiguration — (map)

            The configuration information to connect to SharePoint as your data source.

            Note: SharePoint data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

              • filterConfiguration — (map)

                The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your SharePoint data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your SharePoint site/sites.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

              • domainrequired — (String)

                The domain of your SharePoint instance or site URL/URLs.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "ONLINE"
              • siteUrlsrequired — (Array<String>)

                A list of one or more SharePoint site URLs.

              • tenantId — (String)

                The identifier of your Microsoft 365 tenant.

          • typerequired — (String)

            The type of data source.

            Possible values include:
            • "S3"
            • "WEB"
            • "CONFLUENCE"
            • "SALESFORCE"
            • "SHAREPOINT"
          • webConfiguration — (map)

            The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

            Note: Crawling web URLs as your data source is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The Web Crawler configuration details for the web data source.

              • crawlerLimits — (map)

                The configuration of crawl limits for the web URLs.

                • rateLimit — (Integer)

                  The max rate at which pages are crawled, up to 300 per minute per host.

              • exclusionFilters — (Array<String>)

                A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • inclusionFilters — (Array<String>)

                A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • scope — (String)

                The scope of what is crawled for your URLs.

                You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

                Possible values include:
                • "HOST_ONLY"
                • "SUBDOMAINS"
            • sourceConfigurationrequired — (map)

              The source configuration details for the web data source.

              • urlConfigurationrequired — (map)

                The configuration of the URL/URLs.

                • seedUrls — (Array<map>)

                  One or more seed or starting point URLs.

                  • url — (String)

                    A seed or starting point URL.

        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The detailed reasons on the failure to delete a data source.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source belongs.

        • namerequired — (String)

          The name of the data source.

        • serverSideEncryptionConfiguration — (map)

          Contains details about the configuration of the server-side encryption.

          • kmsKeyArn — (String)

            The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

        • statusrequired — (String)

          The status of the data source. The following statuses are possible:

          • Available – The data source has been created and is ready for ingestion into the knowledge base.

          • Deleting – The data source is being deleted.

          Possible values include:
          • "AVAILABLE"
          • "DELETING"
          • "DELETE_UNSUCCESSFUL"
        • updatedAtrequired — (Date)

          The time at which the data source was last updated.

        • vectorIngestionConfiguration — (map)

          Contains details about how to ingest the documents in the data source.

          • chunkingConfiguration — (map)

            Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

            • chunkingStrategyrequired — (String)

              Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

              • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

              • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

              • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

              Possible values include:
              • "FIXED_SIZE"
              • "NONE"
              • "HIERARCHICAL"
              • "SEMANTIC"
            • fixedSizeChunkingConfiguration — (map)

              Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

              • maxTokensrequired — (Integer)

                The maximum number of tokens to include in a chunk.

              • overlapPercentagerequired — (Integer)

                The percentage of overlap between adjacent chunks of a data source.

            • hierarchicalChunkingConfiguration — (map)

              Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • levelConfigurationsrequired — (Array<map>)

                Token settings for each layer.

                • maxTokensrequired — (Integer)

                  The maximum number of tokens that a chunk can contain in this layer.

              • overlapTokensrequired — (Integer)

                The number of tokens to repeat across chunks in the same layer.

            • semanticChunkingConfiguration — (map)

              Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

              • breakpointPercentileThresholdrequired — (Integer)

                The dissimilarity threshold for splitting chunks.

              • bufferSizerequired — (Integer)

                The buffer size.

              • maxTokensrequired — (Integer)

                The maximum number of tokens that a chunk can contain.

          • customTransformationConfiguration — (map)

            A custom document transformer for parsed data source documents.

            • intermediateStoragerequired — (map)

              An S3 bucket path for input and output objects.

              • s3Locationrequired — (map)

                An S3 bucket path.

                • urirequired — (String)

                  The location's URI. For example, s3://my-bucket/chunk-processor/.

            • transformationsrequired — (Array<map>)

              A Lambda function that processes documents.

              • stepToApplyrequired — (String)

                When the service applies the transformation.

                Possible values include:
                • "POST_CHUNKING"
              • transformationFunctionrequired — (map)

                A Lambda function that processes documents.

                • transformationLambdaConfigurationrequired — (map)

                  The Lambda function.

                  • lambdaArnrequired — (String)

                    The function's ARN identifier.

          • parsingConfiguration — (map)

            A custom parser for data source documents.

            • bedrockFoundationModelConfiguration — (map)

              Settings for a foundation model used to parse documents for a data source.

              • modelArnrequired — (String)

                The model's ARN.

              • parsingPrompt — (map)

                Instructions for interpreting the contents of a document.

                • parsingPromptTextrequired — (String)

                  Instructions for interpreting the contents of a document.

            • parsingStrategyrequired — (String)

              The parsing strategy for the data source.

              Possible values include:
              • "BEDROCK_FOUNDATION_MODEL"

Returns:

  • (AWS.Request)

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

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

Retrieves information about a flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the getFlow operation

var params = {
  flowIdentifier: 'STRING_VALUE' /* required */
};
bedrockagent.getFlow(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that the flow is encrypted with.

      • definition — (map)

        The definition of the nodes and connections between the nodes in the flow.

        • connections — (Array<map>)

          An array of connection definitions in the flow.

          • configuration — (map)

            The configuration of the connection.

            • conditional — (map)

              The configuration of a connection originating from a Condition node.

              • conditionrequired — (String)

                The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

            • data — (map)

              The configuration of a connection originating from a node that isn't a Condition node.

              • sourceOutputrequired — (String)

                The name of the output in the source node that the connection begins from.

              • targetInputrequired — (String)

                The name of the input in the target node that the connection ends at.

          • namerequired — (String)

            A name for the connection that you can reference.

          • sourcerequired — (String)

            The node that the connection starts at.

          • targetrequired — (String)

            The node that the connection ends at.

          • typerequired — (String)

            Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

            Possible values include:
            • "Data"
            • "Conditional"
        • nodes — (Array<map>)

          An array of node definitions in the flow.

          • configuration — (map)

            Contains configurations for the node.

            • agent — (map)

              Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

              • agentAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the alias of the agent to invoke.

            • collector — (map)

              Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

            • condition — (map)

              Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

              • conditionsrequired — (Array<map>)

                An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

                • expression — (String)

                  Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

                • namerequired — (String)

                  A name for the condition that you can reference.

            • input — (map)

              Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

            • iterator — (map)

              Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

              The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

            • knowledgeBase — (map)

              Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

              • knowledgeBaseIdrequired — (String)

                The unique identifier of the knowledge base to query.

              • modelId — (String)

                The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

            • lambdaFunction — (map)

              Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

              • lambdaArnrequired — (String)

                The Amazon Resource Name (ARN) of the Lambda function to invoke.

            • lex — (map)

              Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

              • botAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

              • localeIdrequired — (String)

                The Region to invoke the Amazon Lex bot in.

            • output — (map)

              Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

            • prompt — (map)

              Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

              • sourceConfigurationrequired — (map)

                Specifies whether the prompt is from Prompt management or defined inline.

                • inline — (map)

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration — (map)

                    Contains inference configurations for the prompt.

                    • text — (map)

                      Contains inference configurations for a text prompt.

                      • maxTokens — (Integer)

                        The maximum number of tokens to return in the response.

                      • stopSequences — (Array<String>)

                        A list of strings that define sequences after which the model will stop generating.

                      • temperature — (Float)

                        Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                      • topK — (Integer)

                        The number of most-likely candidates that the model considers for the next token during generation.

                      • topP — (Float)

                        The percentage of most-likely candidates that the model considers for the next token.

                  • modelIdrequired — (String)

                    The unique identifier of the model to run inference with.

                  • templateConfigurationrequired — (map)

                    Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                    • text — (map)

                      Contains configurations for the text in a message for a prompt.

                      • inputVariables — (Array<map>)

                        An array of the variables in the prompt template.

                        • name — (String)

                          The name of the variable.

                      • textrequired — (String)

                        The message for the prompt.

                  • templateTyperequired — (String)

                    The type of prompt template.

                    Possible values include:
                    • "TEXT"
                • resource — (map)

                  Contains configurations for a prompt from Prompt management.

                  • promptArnrequired — (String)

                    The Amazon Resource Name (ARN) of the prompt from Prompt management.

            • retrieval — (map)

              Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for retrieving data to return as the output from the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket from which to retrieve data.

            • storage — (map)

              Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for storing the input into the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location in which to store the input into the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket in which to store the input into the node.

          • inputs — (Array<map>)

            An array of objects, each of which contains information about an input into the node.

            • expressionrequired — (String)

              An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

            • namerequired — (String)

              A name for the input that you can reference.

            • typerequired — (String)

              The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • namerequired — (String)

            A name for the node.

          • outputs — (Array<map>)

            A list of objects, each of which contains information about an output from the node.

            • namerequired — (String)

              A name for the output that you can reference.

            • typerequired — (String)

              The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • typerequired — (String)

            The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

            Possible values include:
            • "Input"
            • "Output"
            • "KnowledgeBase"
            • "Condition"
            • "Lex"
            • "Prompt"
            • "LambdaFunction"
            • "Storage"
            • "Agent"
            • "Retrieval"
            • "Iterator"
            • "Collector"
      • description — (String)

        The description of the flow.

      • executionRoleArn — (String)

        The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service row for flows in the Amazon Bedrock User Guide.

      • id — (String)

        The unique identifier of the flow.

      • name — (String)

        The name of the flow.

      • status — (String)

        The status of the flow. The following statuses are possible:

        • NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the DRAFT version won't contain the latest changes for testing. Send a PrepareFlow request to package the latest changes into the DRAFT version.

        • Preparing – The flow is being prepared so that the DRAFT version contains the latest changes for testing.

        • Prepared – The flow is prepared and the DRAFT version contains the latest changes for testing.

        • Failed – The last API operation that you invoked on the flow failed. Send a GetFlow request and check the error message in the validations field.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"
      • updatedAt — (Date)

        The time at which the flow was last updated.

      • validations — (Array<map>)

        A list of validation error messages related to the last failed operation on the flow.

        • messagerequired — (String)

          A message describing the validation error.

        • severityrequired — (String)

          The severity of the issue described in the message.

          Possible values include:
          • "Warning"
          • "Error"
      • version — (String)

        The version of the flow for which information was retrieved.

Returns:

  • (AWS.Request)

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

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

Retrieves information about a flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the getFlowAlias operation

var params = {
  aliasIdentifier: 'STRING_VALUE', /* required */
  flowIdentifier: 'STRING_VALUE' /* required */
};
bedrockagent.getFlowAlias(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: {})
    • aliasIdentifier — (String)

      The unique identifier of the alias for which to retrieve information.

    • flowIdentifier — (String)

      The unique identifier of the flow that the alias belongs 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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • description — (String)

        The description of the flow.

      • flowId — (String)

        The unique identifier of the flow that the alias belongs to.

      • id — (String)

        The unique identifier of the alias of the flow.

      • name — (String)

        The name of the flow alias.

      • routingConfiguration — (Array<map>)

        Contains information about the version that the alias is mapped to.

        • flowVersion — (String)

          The version that the alias maps to.

      • updatedAt — (Date)

        The time at which the flow alias was last updated.

Returns:

  • (AWS.Request)

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

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

Retrieves information about a version of a flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the getFlowVersion operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  flowVersion: 'STRING_VALUE' /* required */
};
bedrockagent.getFlowVersion(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow for which to get information.

    • flowVersion — (String)

      The version of the flow for which to get information.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that the version of the flow is encrypted with.

      • definition — (map)

        The definition of the nodes and connections between nodes in the flow.

        • connections — (Array<map>)

          An array of connection definitions in the flow.

          • configuration — (map)

            The configuration of the connection.

            • conditional — (map)

              The configuration of a connection originating from a Condition node.

              • conditionrequired — (String)

                The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

            • data — (map)

              The configuration of a connection originating from a node that isn't a Condition node.

              • sourceOutputrequired — (String)

                The name of the output in the source node that the connection begins from.

              • targetInputrequired — (String)

                The name of the input in the target node that the connection ends at.

          • namerequired — (String)

            A name for the connection that you can reference.

          • sourcerequired — (String)

            The node that the connection starts at.

          • targetrequired — (String)

            The node that the connection ends at.

          • typerequired — (String)

            Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

            Possible values include:
            • "Data"
            • "Conditional"
        • nodes — (Array<map>)

          An array of node definitions in the flow.

          • configuration — (map)

            Contains configurations for the node.

            • agent — (map)

              Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

              • agentAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the alias of the agent to invoke.

            • collector — (map)

              Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

            • condition — (map)

              Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

              • conditionsrequired — (Array<map>)

                An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

                • expression — (String)

                  Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

                • namerequired — (String)

                  A name for the condition that you can reference.

            • input — (map)

              Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

            • iterator — (map)

              Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

              The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

            • knowledgeBase — (map)

              Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

              • knowledgeBaseIdrequired — (String)

                The unique identifier of the knowledge base to query.

              • modelId — (String)

                The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

            • lambdaFunction — (map)

              Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

              • lambdaArnrequired — (String)

                The Amazon Resource Name (ARN) of the Lambda function to invoke.

            • lex — (map)

              Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

              • botAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

              • localeIdrequired — (String)

                The Region to invoke the Amazon Lex bot in.

            • output — (map)

              Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

            • prompt — (map)

              Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

              • sourceConfigurationrequired — (map)

                Specifies whether the prompt is from Prompt management or defined inline.

                • inline — (map)

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration — (map)

                    Contains inference configurations for the prompt.

                    • text — (map)

                      Contains inference configurations for a text prompt.

                      • maxTokens — (Integer)

                        The maximum number of tokens to return in the response.

                      • stopSequences — (Array<String>)

                        A list of strings that define sequences after which the model will stop generating.

                      • temperature — (Float)

                        Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                      • topK — (Integer)

                        The number of most-likely candidates that the model considers for the next token during generation.

                      • topP — (Float)

                        The percentage of most-likely candidates that the model considers for the next token.

                  • modelIdrequired — (String)

                    The unique identifier of the model to run inference with.

                  • templateConfigurationrequired — (map)

                    Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                    • text — (map)

                      Contains configurations for the text in a message for a prompt.

                      • inputVariables — (Array<map>)

                        An array of the variables in the prompt template.

                        • name — (String)

                          The name of the variable.

                      • textrequired — (String)

                        The message for the prompt.

                  • templateTyperequired — (String)

                    The type of prompt template.

                    Possible values include:
                    • "TEXT"
                • resource — (map)

                  Contains configurations for a prompt from Prompt management.

                  • promptArnrequired — (String)

                    The Amazon Resource Name (ARN) of the prompt from Prompt management.

            • retrieval — (map)

              Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for retrieving data to return as the output from the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket from which to retrieve data.

            • storage — (map)

              Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for storing the input into the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location in which to store the input into the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket in which to store the input into the node.

          • inputs — (Array<map>)

            An array of objects, each of which contains information about an input into the node.

            • expressionrequired — (String)

              An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

            • namerequired — (String)

              A name for the input that you can reference.

            • typerequired — (String)

              The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • namerequired — (String)

            A name for the node.

          • outputs — (Array<map>)

            A list of objects, each of which contains information about an output from the node.

            • namerequired — (String)

              A name for the output that you can reference.

            • typerequired — (String)

              The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • typerequired — (String)

            The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

            Possible values include:
            • "Input"
            • "Output"
            • "KnowledgeBase"
            • "Condition"
            • "Lex"
            • "Prompt"
            • "LambdaFunction"
            • "Storage"
            • "Agent"
            • "Retrieval"
            • "Iterator"
            • "Collector"
      • description — (String)

        The description of the flow.

      • executionRoleArn — (String)

        The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

      • id — (String)

        The unique identifier of the flow.

      • name — (String)

        The name of the flow version.

      • status — (String)

        The status of the flow.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"
      • version — (String)

        The version of the flow for which information was retrieved.

Returns:

  • (AWS.Request)

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

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

Gets information about a ingestion job, in which a data source is added to a knowledge base.

Service Reference:

Examples:

Calling the getIngestionJob operation

var params = {
  dataSourceId: 'STRING_VALUE', /* required */
  ingestionJobId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.getIngestionJob(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: {})
    • dataSourceId — (String)

      The unique identifier of the data source in the ingestion job.

    • ingestionJobId — (String)

      The unique identifier of the ingestion job.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base for which the ingestion job applies.

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:

      • ingestionJob — (map)

        Contains details about the ingestion job.

        • dataSourceIdrequired — (String)

          The unique identifier of the ingested data source.

        • description — (String)

          The description of the ingestion job.

        • failureReasons — (Array<String>)

          A list of reasons that the ingestion job failed.

        • ingestionJobIdrequired — (String)

          The unique identifier of the ingestion job.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source is being added.

        • startedAtrequired — (Date)

          The time at which the ingestion job started.

        • statistics — (map)

          Contains statistics about the ingestion job.

          • numberOfDocumentsDeleted — (Integer)

            The number of source documents that was deleted.

          • numberOfDocumentsFailed — (Integer)

            The number of source documents that failed to be ingested.

          • numberOfDocumentsScanned — (Integer)

            The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

          • numberOfMetadataDocumentsModified — (Integer)

            The number of metadata files that were updated or deleted.

          • numberOfMetadataDocumentsScanned — (Integer)

            The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

          • numberOfModifiedDocumentsIndexed — (Integer)

            The number of modified source documents in the data source that were successfully indexed.

          • numberOfNewDocumentsIndexed — (Integer)

            The number of new source documents in the data source that were successfully indexed.

        • statusrequired — (String)

          The status of the ingestion job.

          Possible values include:
          • "STARTING"
          • "IN_PROGRESS"
          • "COMPLETE"
          • "FAILED"
        • updatedAtrequired — (Date)

          The time at which the ingestion job was last updated.

Returns:

  • (AWS.Request)

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

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

Gets information about a knoweldge base.

Service Reference:

Examples:

Calling the getKnowledgeBase operation

var params = {
  knowledgeBaseId: 'STRING_VALUE' /* required */
};
bedrockagent.getKnowledgeBase(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: {})
    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base for which to get information.

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:

      • knowledgeBase — (map)

        Contains details about the knowledge base.

        • createdAtrequired — (Date)

          The time at which the knowledge base was created.

        • description — (String)

          The description of the knowledge base.

        • failureReasons — (Array<String>)

          A list of reasons that the API operation on the knowledge base failed.

        • knowledgeBaseArnrequired — (String)

          The Amazon Resource Name (ARN) of the knowledge base.

        • knowledgeBaseConfigurationrequired — (map)

          Contains details about the embeddings configuration of the knowledge base.

          • typerequired — (String)

            The type of data that the data source is converted into for the knowledge base.

            Possible values include:
            • "VECTOR"
          • vectorKnowledgeBaseConfiguration — (map)

            Contains details about the embeddings model that'sused to convert the data source.

            • embeddingModelArnrequired — (String)

              The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

            • embeddingModelConfiguration — (map)

              The embeddings model configuration details for the vector model used in Knowledge Base.

              • bedrockEmbeddingModelConfiguration — (map)

                The vector configuration details on the Bedrock embeddings model.

                • dimensions — (Integer)

                  The dimensions details for the vector configuration used on the Bedrock embeddings model.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base.

        • namerequired — (String)

          The name of the knowledge base.

        • roleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

        • statusrequired — (String)

          The status of the knowledge base. The following statuses are possible:

          • CREATING – The knowledge base is being created.

          • ACTIVE – The knowledge base is ready to be queried.

          • DELETING – The knowledge base is being deleted.

          • UPDATING – The knowledge base is being updated.

          • FAILED – The knowledge base API operation failed.

          Possible values include:
          • "CREATING"
          • "ACTIVE"
          • "DELETING"
          • "UPDATING"
          • "FAILED"
          • "DELETE_UNSUCCESSFUL"
        • storageConfigurationrequired — (map)

          Contains details about the storage configuration of the knowledge base.

          • mongoDbAtlasConfiguration — (map)

            Contains the storage configuration of the knowledge base in MongoDB Atlas.

            • collectionNamerequired — (String)

              The collection name of the knowledge base in MongoDB Atlas.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

            • databaseNamerequired — (String)

              The database name in your MongoDB Atlas cluster for your knowledge base.

            • endpointrequired — (String)

              The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

            • endpointServiceName — (String)

              The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the MongoDB Atlas vector search index.

          • opensearchServerlessConfiguration — (map)

            Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

            • collectionArnrequired — (String)

              The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector store.

          • pineconeConfiguration — (map)

            Contains the storage configuration of the knowledge base in Pinecone.

            • connectionStringrequired — (String)

              The endpoint URL for your index management page.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • namespace — (String)

              The namespace to be used to write new data to your database.

          • rdsConfiguration — (map)

            Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

            • databaseNamerequired — (String)

              The name of your Amazon RDS database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • primaryKeyFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the ID for each entry.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • resourceArnrequired — (String)

              The Amazon Resource Name (ARN) of the vector store.

            • tableNamerequired — (String)

              The name of the table in the database.

          • redisEnterpriseCloudConfiguration — (map)

            Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

            • endpointrequired — (String)

              The endpoint URL of the Redis Enterprise Cloud database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector index.

          • typerequired — (String)

            The vector store service in which the knowledge base is stored.

            Possible values include:
            • "OPENSEARCH_SERVERLESS"
            • "PINECONE"
            • "REDIS_ENTERPRISE_CLOUD"
            • "RDS"
            • "MONGO_DB_ATLAS"
        • updatedAtrequired — (Date)

          The time at which the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Retrieves information about a prompt or a version of it. For more information, see View information about prompts using Prompt management and View information about a version of your prompt in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the getPrompt operation

var params = {
  promptIdentifier: 'STRING_VALUE', /* required */
  promptVersion: 'STRING_VALUE'
};
bedrockagent.getPrompt(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: {})
    • promptIdentifier — (String)

      The unique identifier of the prompt.

    • promptVersion — (String)

      The version of the prompt about which you want to retrieve information.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the prompt.

      • createdAt — (Date)

        The time at which the prompt was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with.

      • defaultVariant — (String)

        The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

      • description — (String)

        The descriptino of the prompt.

      • id — (String)

        The unique identifier of the prompt.

      • name — (String)

        The name of the prompt.

      • updatedAt — (Date)

        The time at which the prompt was last updated.

      • variants — (Array<map>)

        A list of objects, each containing details about a variant of the prompt.

        • inferenceConfiguration — (map)

          Contains inference configurations for the prompt variant.

          • text — (map)

            Contains inference configurations for a text prompt.

            • maxTokens — (Integer)

              The maximum number of tokens to return in the response.

            • stopSequences — (Array<String>)

              A list of strings that define sequences after which the model will stop generating.

            • temperature — (Float)

              Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

            • topK — (Integer)

              The number of most-likely candidates that the model considers for the next token during generation.

            • topP — (Float)

              The percentage of most-likely candidates that the model considers for the next token.

        • modelId — (String)

          The unique identifier of the model with which to run inference on the prompt.

        • namerequired — (String)

          The name of the prompt variant.

        • templateConfiguration — (map)

          Contains configurations for the prompt template.

          • text — (map)

            Contains configurations for the text in a message for a prompt.

            • inputVariables — (Array<map>)

              An array of the variables in the prompt template.

              • name — (String)

                The name of the variable.

            • textrequired — (String)

              The message for the prompt.

        • templateTyperequired — (String)

          The type of prompt template to use.

          Possible values include:
          • "TEXT"
      • version — (String)

        The version of the prompt.

Returns:

  • (AWS.Request)

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

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

Lists the action groups for an agent and information about each one.

Service Reference:

Examples:

Calling the listAgentActionGroups operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listAgentActionGroups(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: {})
    • agentId — (String)

      The unique identifier of the agent.

    • agentVersion — (String)

      The version of the agent.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • actionGroupSummaries — (Array<map>)

        A list of objects, each of which contains information about an action group.

        • actionGroupIdrequired — (String)

          The unique identifier of the action group.

        • actionGroupNamerequired — (String)

          The name of the action group.

        • actionGroupStaterequired — (String)

          Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • description — (String)

          The description of the action group.

        • updatedAtrequired — (Date)

          The time at which the action group was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the aliases of an agent and information about each one.

Service Reference:

Examples:

Calling the listAgentAliases operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listAgentAliases(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: {})
    • agentId — (String)

      The unique identifier of the agent.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • agentAliasSummaries — (Array<map>)

        A list of objects, each of which contains information about an alias of the agent.

        • agentAliasIdrequired — (String)

          Contains details about

        • agentAliasNamerequired — (String)

          The name of the alias.

        • agentAliasStatusrequired — (String)

          The status of the alias.

          Possible values include:
          • "CREATING"
          • "PREPARED"
          • "FAILED"
          • "UPDATING"
          • "DELETING"
        • createdAtrequired — (Date)

          The time at which the alias of the agent was created.

        • description — (String)

          The description of the alias.

        • routingConfiguration — (Array<map>)

          Contains details about the version of the agent with which the alias is associated.

          • agentVersion — (String)

            The version of the agent with which the alias is associated.

          • provisionedThroughput — (String)

            Information on the Provisioned Throughput assigned to an agent alias.

        • updatedAtrequired — (Date)

          The time at which the alias was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists knowledge bases associated with an agent and information about each one.

Service Reference:

Examples:

Calling the listAgentKnowledgeBases operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listAgentKnowledgeBases(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: {})
    • agentId — (String)

      The unique identifier of the agent for which to return information about knowledge bases associated with it.

    • agentVersion — (String)

      The version of the agent for which to return information about knowledge bases associated with it.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • agentKnowledgeBaseSummaries — (Array<map>)

        A list of objects, each of which contains information about a knowledge base associated with the agent.

        • description — (String)

          The description of the knowledge base associated with an agent.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base associated with an agent.

        • knowledgeBaseStaterequired — (String)

          Specifies whether the agent uses the knowledge base or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • updatedAtrequired — (Date)

          The time at which the knowledge base associated with an agent was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the agents belonging to an account and information about each agent.

Service Reference:

Examples:

Calling the listAgents operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listAgents(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • agentSummaries — (Array<map>)

        A list of objects, each of which contains information about an agent.

        • agentIdrequired — (String)

          The unique identifier of the agent.

        • agentNamerequired — (String)

          The name of the agent.

        • agentStatusrequired — (String)

          The status of the agent.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • description — (String)

          The description of the agent.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • latestAgentVersion — (String)

          The latest version of the agent.

        • updatedAtrequired — (Date)

          The time at which the agent was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the versions of an agent and information about each version.

Service Reference:

Examples:

Calling the listAgentVersions operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listAgentVersions(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: {})
    • agentId — (String)

      The unique identifier of the agent.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • agentVersionSummaries — (Array<map>)

        A list of objects, each of which contains information about a version of the agent.

        • agentNamerequired — (String)

          The name of the agent to which the version belongs.

        • agentStatusrequired — (String)

          The status of the agent to which the version belongs.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • agentVersionrequired — (String)

          The version of the agent.

        • createdAtrequired — (Date)

          The time at which the version was created.

        • description — (String)

          The description of the version of the agent.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • updatedAtrequired — (Date)

          The time at which the version was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the data sources in a knowledge base and information about each one.

Service Reference:

Examples:

Calling the listDataSources operation

var params = {
  knowledgeBaseId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listDataSources(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: {})
    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base for which to return a list of information.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataSourceSummaries — (Array<map>)

        A list of objects, each of which contains information about a data source.

        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source belongs.

        • namerequired — (String)

          The name of the data source.

        • statusrequired — (String)

          The status of the data source.

          Possible values include:
          • "AVAILABLE"
          • "DELETING"
          • "DELETE_UNSUCCESSFUL"
        • updatedAtrequired — (Date)

          The time at which the data source was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Returns a list of aliases for a flow.

Service Reference:

Examples:

Calling the listFlowAliases operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listFlowAliases(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow for which aliases are being returned.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • flowAliasSummaries — (Array<map>)

        A list, each member of which contains information about a flow alias.

        • arnrequired — (String)

          The Amazon Resource Name (ARN) of the flow alias.

        • createdAtrequired — (Date)

          The time at which the alias was created.

        • description — (String)

          A description of the alias.

        • flowIdrequired — (String)

          The unique identifier of the flow.

        • idrequired — (String)

          The unique identifier of the alias of the flow.

        • namerequired — (String)

          The name of the alias.

        • routingConfigurationrequired — (Array<map>)

          A list of configurations about the versions that the alias maps to. Currently, you can only specify one.

          • flowVersion — (String)

            The version that the alias maps to.

        • updatedAtrequired — (Date)

          The time at which the alias was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Returns a list of flows and information about each flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the listFlows operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listFlows(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • flowSummaries — (Array<map>)

        A list, each member of which contains information about a flow.

        • arnrequired — (String)

          The Amazon Resource Name (ARN) of the flow.

        • createdAtrequired — (Date)

          The time at which the flow was created.

        • description — (String)

          A description of the flow.

        • idrequired — (String)

          The unique identifier of the flow.

        • namerequired — (String)

          The name of the flow.

        • statusrequired — (String)

          The status of the flow. The following statuses are possible:

          • NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the DRAFT version won't contain the latest changes for testing. Send a PrepareFlow request to package the latest changes into the DRAFT version.

          • Preparing – The flow is being prepared so that the DRAFT version contains the latest changes for testing.

          • Prepared – The flow is prepared and the DRAFT version contains the latest changes for testing.

          • Failed – The last API operation that you invoked on the flow failed. Send a GetFlow request and check the error message in the validations field.

          Possible values include:
          • "Failed"
          • "Prepared"
          • "Preparing"
          • "NotPrepared"
        • updatedAtrequired — (Date)

          The time at which the flow was last updated.

        • versionrequired — (String)

          The latest version of the flow.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Returns a list of information about each flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the listFlowVersions operation

var params = {
  flowIdentifier: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listFlowVersions(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • flowVersionSummaries — (Array<map>)

        A list, each member of which contains information about a flow.

        • arnrequired — (String)

          The Amazon Resource Name (ARN) of the flow that the version belongs to.

        • createdAtrequired — (Date)

          The time at the flow version was created.

        • idrequired — (String)

          The unique identifier of the flow.

        • statusrequired — (String)

          The status of the flow.

          Possible values include:
          • "Failed"
          • "Prepared"
          • "Preparing"
          • "NotPrepared"
        • versionrequired — (String)

          The version of the flow.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the ingestion jobs for a data source and information about each of them.

Service Reference:

Examples:

Calling the listIngestionJobs operation

var params = {
  dataSourceId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE', /* required */
  filters: [
    {
      attribute: STATUS, /* required */
      operator: EQ, /* required */
      values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  sortBy: {
    attribute: STATUS | STARTED_AT, /* required */
    order: ASCENDING | DESCENDING /* required */
  }
};
bedrockagent.listIngestionJobs(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: {})
    • dataSourceId — (String)

      The unique identifier of the data source for which to return ingestion jobs.

    • filters — (Array<map>)

      Contains a definition of a filter for which to filter the results.

      • attributerequired — (String)

        The attribute by which to filter the results.

        Possible values include:
        • "STATUS"
      • operatorrequired — (String)

        The operation to carry out between the attribute and the values.

        Possible values include:
        • "EQ"
      • valuesrequired — (Array<String>)

        A list of values for the attribute.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base for which to return ingestion jobs.

    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

    • sortBy — (map)

      Contains details about how to sort the results.

      • attributerequired — (String)

        The attribute by which to sort the results.

        Possible values include:
        • "STATUS"
        • "STARTED_AT"
      • orderrequired — (String)

        The order by which to sort 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:

      • ingestionJobSummaries — (Array<map>)

        A list of objects, each of which contains information about an ingestion job.

        • dataSourceIdrequired — (String)

          The unique identifier of the data source in the ingestion job.

        • description — (String)

          The description of the ingestion job.

        • ingestionJobIdrequired — (String)

          The unique identifier of the ingestion job.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source is added.

        • startedAtrequired — (Date)

          The time at which the ingestion job was started.

        • statistics — (map)

          Contains statistics for the ingestion job.

          • numberOfDocumentsDeleted — (Integer)

            The number of source documents that was deleted.

          • numberOfDocumentsFailed — (Integer)

            The number of source documents that failed to be ingested.

          • numberOfDocumentsScanned — (Integer)

            The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

          • numberOfMetadataDocumentsModified — (Integer)

            The number of metadata files that were updated or deleted.

          • numberOfMetadataDocumentsScanned — (Integer)

            The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

          • numberOfModifiedDocumentsIndexed — (Integer)

            The number of modified source documents in the data source that were successfully indexed.

          • numberOfNewDocumentsIndexed — (Integer)

            The number of new source documents in the data source that were successfully indexed.

        • statusrequired — (String)

          The status of the ingestion job.

          Possible values include:
          • "STARTING"
          • "IN_PROGRESS"
          • "COMPLETE"
          • "FAILED"
        • updatedAtrequired — (Date)

          The time at which the ingestion job was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Lists the knowledge bases in an account and information about each of them.

Service Reference:

Examples:

Calling the listKnowledgeBases operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
bedrockagent.listKnowledgeBases(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • knowledgeBaseSummaries — (Array<map>)

        A list of objects, each of which contains information about a knowledge base.

        • description — (String)

          The description of the knowledge base.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base.

        • namerequired — (String)

          The name of the knowledge base.

        • statusrequired — (String)

          The status of the knowledge base.

          Possible values include:
          • "CREATING"
          • "ACTIVE"
          • "DELETING"
          • "UPDATING"
          • "FAILED"
          • "DELETE_UNSUCCESSFUL"
        • updatedAtrequired — (Date)

          The time at which the knowledge base was last updated.

      • nextToken — (String)

        If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Returns:

  • (AWS.Request)

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

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

Returns a list of prompts from the Prompt management tool and information about each prompt. For more information, see View information about prompts using Prompt management in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the listPrompts operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  promptIdentifier: 'STRING_VALUE'
};
bedrockagent.listPrompts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

    • nextToken — (String)

      If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

    • promptIdentifier — (String)

      The unique identifier of the prompt.

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 the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

      • promptSummaries — (Array<map>)

        A list, each member of which contains information about a prompt using Prompt management.

        • arnrequired — (String)

          The Amazon Resource Name (ARN) of the prompt.

        • createdAtrequired — (Date)

          The time at which the prompt was created.

        • description — (String)

          The description of the prompt.

        • idrequired — (String)

          The unique identifier of the prompt.

        • namerequired — (String)

          The name of the prompt.

        • updatedAtrequired — (Date)

          The time at which the prompt was last updated.

        • versionrequired — (String)

          The version of the prompt that this summary applies to.

Returns:

  • (AWS.Request)

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

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

List all the tags for the resource you specify.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE' /* required */
};
bedrockagent.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 for which to list tags.

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 — (map<String>)

        The key-value pairs for the tags associated with the resource.

Returns:

  • (AWS.Request)

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

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

Creates a DRAFT version of the agent that can be used for internal testing.

Service Reference:

Examples:

Calling the prepareAgent operation

var params = {
  agentId: 'STRING_VALUE' /* required */
};
bedrockagent.prepareAgent(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: {})
    • agentId — (String)

      The unique identifier of the agent for which to create a 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:

      • agentId — (String)

        The unique identifier of the agent for which the DRAFT version was created.

      • agentStatus — (String)

        The status of the DRAFT version and whether it is ready for use.

        Possible values include:
        • "CREATING"
        • "PREPARING"
        • "PREPARED"
        • "NOT_PREPARED"
        • "DELETING"
        • "FAILED"
        • "VERSIONING"
        • "UPDATING"
      • agentVersion — (String)

        The version of the agent.

      • preparedAt — (Date)

        The time at which the DRAFT version of the agent was last prepared.

Returns:

  • (AWS.Request)

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

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

Prepares the DRAFT version of a flow so that it can be invoked. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the prepareFlow operation

var params = {
  flowIdentifier: 'STRING_VALUE' /* required */
};
bedrockagent.prepareFlow(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: {})
    • flowIdentifier — (String)

      The unique identifier of the flow.

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:

      • id — (String)

        The unique identifier of the flow.

      • status — (String)

        The status of the flow. When you submit this request, the status will be NotPrepared. If preparation succeeds, the status becomes Prepared. If it fails, the status becomes FAILED.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"

Returns:

  • (AWS.Request)

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

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

Begins an ingestion job, in which a data source is added to a knowledge base.

Service Reference:

Examples:

Calling the startIngestionJob operation

var params = {
  dataSourceId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE'
};
bedrockagent.startIngestionJob(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: {})
    • clientToken — (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.
    • dataSourceId — (String)

      The unique identifier of the data source to ingest.

    • description — (String)

      A description of the ingestion job.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base to which to add the data source.

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:

      • ingestionJob — (map)

        An object containing information about the ingestion job.

        • dataSourceIdrequired — (String)

          The unique identifier of the ingested data source.

        • description — (String)

          The description of the ingestion job.

        • failureReasons — (Array<String>)

          A list of reasons that the ingestion job failed.

        • ingestionJobIdrequired — (String)

          The unique identifier of the ingestion job.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source is being added.

        • startedAtrequired — (Date)

          The time at which the ingestion job started.

        • statistics — (map)

          Contains statistics about the ingestion job.

          • numberOfDocumentsDeleted — (Integer)

            The number of source documents that was deleted.

          • numberOfDocumentsFailed — (Integer)

            The number of source documents that failed to be ingested.

          • numberOfDocumentsScanned — (Integer)

            The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

          • numberOfMetadataDocumentsModified — (Integer)

            The number of metadata files that were updated or deleted.

          • numberOfMetadataDocumentsScanned — (Integer)

            The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

          • numberOfModifiedDocumentsIndexed — (Integer)

            The number of modified source documents in the data source that were successfully indexed.

          • numberOfNewDocumentsIndexed — (Integer)

            The number of new source documents in the data source that were successfully indexed.

        • statusrequired — (String)

          The status of the ingestion job.

          Possible values include:
          • "STARTING"
          • "IN_PROGRESS"
          • "COMPLETE"
          • "FAILED"
        • updatedAtrequired — (Date)

          The time at which the ingestion job was last updated.

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 */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
bedrockagent.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 — (map<String>)

      An object containing key-value pairs that define the tags to attach to 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.

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

Remove tags from a resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
bedrockagent.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 from which to remove tags.

    • tagKeys — (Array<String>)

      A list of 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.

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

Updates the configuration of an agent.

Service Reference:

Examples:

Calling the updateAgent operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentName: 'STRING_VALUE', /* required */
  agentResourceRoleArn: 'STRING_VALUE', /* required */
  foundationModel: 'STRING_VALUE', /* required */
  customerEncryptionKeyArn: 'STRING_VALUE',
  description: 'STRING_VALUE',
  guardrailConfiguration: {
    guardrailIdentifier: 'STRING_VALUE',
    guardrailVersion: 'STRING_VALUE'
  },
  idleSessionTTLInSeconds: 'NUMBER_VALUE',
  instruction: 'STRING_VALUE',
  memoryConfiguration: {
    enabledMemoryTypes: [ /* required */
      SESSION_SUMMARY,
      /* more items */
    ],
    storageDays: 'NUMBER_VALUE'
  },
  promptOverrideConfiguration: {
    promptConfigurations: [ /* required */
      {
        basePromptTemplate: 'STRING_VALUE',
        inferenceConfiguration: {
          maximumLength: 'NUMBER_VALUE',
          stopSequences: [
            'STRING_VALUE',
            /* more items */
          ],
          temperature: 'NUMBER_VALUE',
          topK: 'NUMBER_VALUE',
          topP: 'NUMBER_VALUE'
        },
        parserMode: DEFAULT | OVERRIDDEN,
        promptCreationMode: DEFAULT | OVERRIDDEN,
        promptState: ENABLED | DISABLED,
        promptType: PRE_PROCESSING | ORCHESTRATION | POST_PROCESSING | KNOWLEDGE_BASE_RESPONSE_GENERATION
      },
      /* more items */
    ],
    overrideLambda: 'STRING_VALUE'
  }
};
bedrockagent.updateAgent(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: {})
    • agentId — (String)

      The unique identifier of the agent.

    • agentName — (String)

      Specifies a new name for the agent.

    • agentResourceRoleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.

    • description — (String)

      Specifies a new description of the agent.

    • foundationModel — (String)

      Specifies a new foundation model to be used for orchestration by the agent.

    • guardrailConfiguration — (map)

      The unique Guardrail configuration assigned to the agent when it is updated.

      • guardrailIdentifier — (String)

        The unique identifier of the guardrail.

      • guardrailVersion — (String)

        The version of the guardrail.

    • idleSessionTTLInSeconds — (Integer)

      The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

      A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

    • instruction — (String)

      Specifies new instructions that tell the agent what it should do and how it should interact with users.

    • memoryConfiguration — (map)

      Specifies the new memory configuration for the agent.

      • enabledMemoryTypesrequired — (Array<String>)

        The type of memory that is stored.

      • storageDays — (Integer)

        The number of days the agent is configured to retain the conversational context.

    • promptOverrideConfiguration — (map)

      Contains configurations to override prompts in different parts of an agent sequence. For more information, see Advanced prompts.

      • overrideLambda — (String)

        The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

      • promptConfigurationsrequired — (Array<map>)

        Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

        • basePromptTemplate — (String)

          Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

        • inferenceConfiguration — (map)

          Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

          • maximumLength — (Integer)

            The maximum number of tokens to allow in the generated response.

          • stopSequences — (Array<String>)

            A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

          • temperature — (Float)

            The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

          • topK — (Integer)

            While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

          • topP — (Float)

            While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

        • parserMode — (String)

          Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

          Possible values include:
          • "DEFAULT"
          • "OVERRIDDEN"
        • promptCreationMode — (String)

          Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

          Possible values include:
          • "DEFAULT"
          • "OVERRIDDEN"
        • promptState — (String)

          Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

          • PRE_PROCESSINGENABLED

          • ORCHESTRATIONENABLED

          • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

          • POST_PROCESSINGDISABLED

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • promptType — (String)

          The step in the agent sequence that this prompt configuration applies to.

          Possible values include:
          • "PRE_PROCESSING"
          • "ORCHESTRATION"
          • "POST_PROCESSING"
          • "KNOWLEDGE_BASE_RESPONSE_GENERATION"

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:

      • agent — (map)

        Contains details about the agent that was updated.

        • agentArnrequired — (String)

          The Amazon Resource Name (ARN) of the agent.

        • agentIdrequired — (String)

          The unique identifier of the agent.

        • agentNamerequired — (String)

          The name of the agent.

        • agentResourceRoleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

        • agentStatusrequired — (String)

          The status of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent is being created.

          • PREPARING – The agent is being prepared.

          • PREPARED – The agent is prepared and ready to be invoked.

          • NOT_PREPARED – The agent has been created but not yet prepared.

          • FAILED – The agent API operation failed.

          • UPDATING – The agent is being updated.

          • DELETING – The agent is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARING"
          • "PREPARED"
          • "NOT_PREPARED"
          • "DELETING"
          • "FAILED"
          • "VERSIONING"
          • "UPDATING"
        • agentVersionrequired — (String)

          The version of the agent.

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

        • createdAtrequired — (Date)

          The time at which the agent was created.

        • customerEncryptionKeyArn — (String)

          The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.

        • description — (String)

          The description of the agent.

        • failureReasons — (Array<String>)

          Contains reasons that the agent-related API that you invoked failed.

        • foundationModel — (String)

          The foundation model used for orchestration by the agent.

        • guardrailConfiguration — (map)

          Details about the guardrail associated with the agent.

          • guardrailIdentifier — (String)

            The unique identifier of the guardrail.

          • guardrailVersion — (String)

            The version of the guardrail.

        • idleSessionTTLInSecondsrequired — (Integer)

          The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

          A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

        • instruction — (String)

          Instructions that tell the agent what it should do and how it should interact with users.

        • memoryConfiguration — (map)

          Contains memory configuration for the agent.

          • enabledMemoryTypesrequired — (Array<String>)

            The type of memory that is stored.

          • storageDays — (Integer)

            The number of days the agent is configured to retain the conversational context.

        • preparedAt — (Date)

          The time at which the agent was last prepared.

        • promptOverrideConfiguration — (map)

          Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see Advanced prompts.

          • overrideLambda — (String)

            The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the promptConfigurations must contain a parserMode value that is set to OVERRIDDEN. For more information, see Parser Lambda function in Agents for Amazon Bedrock.

          • promptConfigurationsrequired — (Array<map>)

            Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

            • basePromptTemplate — (String)

              Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

            • inferenceConfiguration — (map)

              Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

              • maximumLength — (Integer)

                The maximum number of tokens to allow in the generated response.

              • stopSequences — (Array<String>)

                A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.

              • temperature — (Float)

                The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

              • topK — (Integer)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

              • topP — (Float)

                While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 80, the model only selects the next token from the top 80% of the probability distribution of next tokens.

            • parserMode — (String)

              Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptCreationMode — (String)

              Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

              Possible values include:
              • "DEFAULT"
              • "OVERRIDDEN"
            • promptState — (String)

              Specifies whether to allow the agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

              • PRE_PROCESSINGENABLED

              • ORCHESTRATIONENABLED

              • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

              • POST_PROCESSINGDISABLED

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • promptType — (String)

              The step in the agent sequence that this prompt configuration applies to.

              Possible values include:
              • "PRE_PROCESSING"
              • "ORCHESTRATION"
              • "POST_PROCESSING"
              • "KNOWLEDGE_BASE_RESPONSE_GENERATION"
        • recommendedActions — (Array<String>)

          Contains recommended actions to take for the agent-related API that you invoked to succeed.

        • updatedAtrequired — (Date)

          The time at which the agent was last updated.

Returns:

  • (AWS.Request)

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

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

Updates the configuration for an action group for an agent.

Service Reference:

Examples:

Calling the updateAgentActionGroup operation

var params = {
  actionGroupId: 'STRING_VALUE', /* required */
  actionGroupName: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  actionGroupExecutor: {
    customControl: RETURN_CONTROL,
    lambda: 'STRING_VALUE'
  },
  actionGroupState: ENABLED | DISABLED,
  apiSchema: {
    payload: 'STRING_VALUE',
    s3: {
      s3BucketName: 'STRING_VALUE',
      s3ObjectKey: 'STRING_VALUE'
    }
  },
  description: 'STRING_VALUE',
  functionSchema: {
    functions: [
      {
        name: 'STRING_VALUE', /* required */
        description: 'STRING_VALUE',
        parameters: {
          '<Name>': {
            type: string | number | integer | boolean | array, /* required */
            description: 'STRING_VALUE',
            required: true || false
          },
          /* '<Name>': ... */
        }
      },
      /* more items */
    ]
  },
  parentActionGroupSignature: AMAZON.UserInput | AMAZON.CodeInterpreter
};
bedrockagent.updateAgentActionGroup(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: {})
    • actionGroupExecutor — (map)

      The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

      • customControl — (String)

        To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL.

        Possible values include:
        • "RETURN_CONTROL"
      • lambda — (String)

        The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

    • actionGroupId — (String)

      The unique identifier of the action group.

    • actionGroupName — (String)

      Specifies a new name for the action group.

    • actionGroupState — (String)

      Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • agentId — (String)

      The unique identifier of the agent for which to update the action group.

    • agentVersion — (String)

      The unique identifier of the agent version for which to update the action group.

    • apiSchema — (map)

      Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.

      • payload — (String)

        The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

      • s3 — (map)

        Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

        • s3BucketName — (String)

          The name of the S3 bucket.

        • s3ObjectKey — (String)

          The S3 object key for the S3 resource.

    • description — (String)

      Specifies a new name for the action group.

    • functionSchema — (map)

      Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.

      • functions — (Array<map>)

        A list of functions that each define an action in the action group.

        • description — (String)

          A description of the function and its purpose.

        • namerequired — (String)

          A name for the function.

        • parameters — (map<map>)

          The parameters that the agent elicits from the user to fulfill the function.

          • description — (String)

            A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

          • required — (Boolean)

            Whether the parameter is required for the agent to complete the function for action group invocation.

          • typerequired — (String)

            The data type of the parameter.

            Possible values include:
            • "string"
            • "number"
            • "integer"
            • "boolean"
            • "array"
    • parentActionGroupSignature — (String)

      To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput. You must leave the description, apiSchema, and actionGroupExecutor fields blank for this action group.

      During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

      Possible values include:
      • "AMAZON.UserInput"
      • "AMAZON.CodeInterpreter"

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:

      • agentActionGroup — (map)

        Contains details about the action group that was updated.

        • actionGroupExecutor — (map)

          The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.

          • customControl — (String)

            To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL.

            Possible values include:
            • "RETURN_CONTROL"
          • lambda — (String)

            The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

        • actionGroupIdrequired — (String)

          The unique identifier of the action group.

        • actionGroupNamerequired — (String)

          The name of the action group.

        • actionGroupStaterequired — (String)

          Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • agentIdrequired — (String)

          The unique identifier of the agent to which the action group belongs.

        • agentVersionrequired — (String)

          The version of the agent to which the action group belongs.

        • apiSchema — (map)

          Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.

          • payload — (String)

            The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

          • s3 — (map)

            Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.

            • s3BucketName — (String)

              The name of the S3 bucket.

            • s3ObjectKey — (String)

              The S3 object key for the S3 resource.

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

        • createdAtrequired — (Date)

          The time at which the action group was created.

        • description — (String)

          The description of the action group.

        • functionSchema — (map)

          Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.

          • functions — (Array<map>)

            A list of functions that each define an action in the action group.

            • description — (String)

              A description of the function and its purpose.

            • namerequired — (String)

              A name for the function.

            • parameters — (map<map>)

              The parameters that the agent elicits from the user to fulfill the function.

              • description — (String)

                A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.

              • required — (Boolean)

                Whether the parameter is required for the agent to complete the function for action group invocation.

              • typerequired — (String)

                The data type of the parameter.

                Possible values include:
                • "string"
                • "number"
                • "integer"
                • "boolean"
                • "array"
        • parentActionSignature — (String)

          If this field is set as AMAZON.UserInput, the agent can request the user for additional information when trying to complete a task. The description, apiSchema, and actionGroupExecutor fields must be blank for this action group.

          During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an Observation reprompting the user for more information.

          Possible values include:
          • "AMAZON.UserInput"
          • "AMAZON.CodeInterpreter"
        • updatedAtrequired — (Date)

          The time at which the action group was last updated.

Returns:

  • (AWS.Request)

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

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

Updates configurations for an alias of an agent.

Service Reference:

Examples:

Calling the updateAgentAlias operation

var params = {
  agentAliasId: 'STRING_VALUE', /* required */
  agentAliasName: 'STRING_VALUE', /* required */
  agentId: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  routingConfiguration: [
    {
      agentVersion: 'STRING_VALUE',
      provisionedThroughput: 'STRING_VALUE'
    },
    /* more items */
  ]
};
bedrockagent.updateAgentAlias(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: {})
    • agentAliasId — (String)

      The unique identifier of the alias.

    • agentAliasName — (String)

      Specifies a new name for the alias.

    • agentId — (String)

      The unique identifier of the agent.

    • description — (String)

      Specifies a new description for the alias.

    • routingConfiguration — (Array<map>)

      Contains details about the routing configuration of the alias.

      • agentVersion — (String)

        The version of the agent with which the alias is associated.

      • provisionedThroughput — (String)

        Information on the Provisioned Throughput assigned to an agent alias.

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:

      • agentAlias — (map)

        Contains details about the alias that was updated.

        • agentAliasArnrequired — (String)

          The Amazon Resource Name (ARN) of the alias of the agent.

        • agentAliasHistoryEvents — (Array<map>)

          Contains details about the history of the alias.

          • endDate — (Date)

            The date that the alias stopped being associated to the version in the routingConfiguration object

          • routingConfiguration — (Array<map>)

            Contains details about the version of the agent with which the alias is associated.

            • agentVersion — (String)

              The version of the agent with which the alias is associated.

            • provisionedThroughput — (String)

              Information on the Provisioned Throughput assigned to an agent alias.

          • startDate — (Date)

            The date that the alias began being associated to the version in the routingConfiguration object.

        • agentAliasIdrequired — (String)

          The unique identifier of the alias of the agent.

        • agentAliasNamerequired — (String)

          The name of the alias of the agent.

        • agentAliasStatusrequired — (String)

          The status of the alias of the agent and whether it is ready for use. The following statuses are possible:

          • CREATING – The agent alias is being created.

          • PREPARED – The agent alias is finished being created or updated and is ready to be invoked.

          • FAILED – The agent alias API operation failed.

          • UPDATING – The agent alias is being updated.

          • DELETING – The agent alias is being deleted.

          Possible values include:
          • "CREATING"
          • "PREPARED"
          • "FAILED"
          • "UPDATING"
          • "DELETING"
        • agentIdrequired — (String)

          The unique identifier of the agent.

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

        • createdAtrequired — (Date)

          The time at which the alias of the agent was created.

        • description — (String)

          The description of the alias of the agent.

        • failureReasons — (Array<String>)

          Information on the failure of Provisioned Throughput assigned to an agent alias.

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersion — (String)

            The version of the agent with which the alias is associated.

          • provisionedThroughput — (String)

            Information on the Provisioned Throughput assigned to an agent alias.

        • updatedAtrequired — (Date)

          The time at which the alias was last updated.

Returns:

  • (AWS.Request)

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

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

Updates the configuration for a knowledge base that has been associated with an agent.

Service Reference:

Examples:

Calling the updateAgentKnowledgeBase operation

var params = {
  agentId: 'STRING_VALUE', /* required */
  agentVersion: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  knowledgeBaseState: ENABLED | DISABLED
};
bedrockagent.updateAgentKnowledgeBase(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: {})
    • agentId — (String)

      The unique identifier of the agent associated with the knowledge base that you want to update.

    • agentVersion — (String)

      The version of the agent associated with the knowledge base that you want to update.

    • description — (String)

      Specifies a new description for the knowledge base associated with an agent.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base that has been associated with an agent.

    • knowledgeBaseState — (String)

      Specifies whether the agent uses the knowledge base or not when sending an InvokeAgent request.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

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:

      • agentKnowledgeBase — (map)

        Contains details about the knowledge base that has been associated with an agent.

        • agentIdrequired — (String)

          The unique identifier of the agent with which the knowledge base is associated.

        • agentVersionrequired — (String)

          The version of the agent with which the knowledge base is associated.

        • createdAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was created.

        • descriptionrequired — (String)

          The description of the association between the agent and the knowledge base.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the association between the agent and the knowledge base.

        • knowledgeBaseStaterequired — (String)

          Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • updatedAtrequired — (Date)

          The time at which the association between the agent and the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Updates the configurations for a data source connector.

You can't change the chunkingConfiguration after you create the data source connector. Specify the existing chunkingConfiguration.

Service Reference:

Examples:

Calling the updateDataSource operation

var params = {
  dataSourceConfiguration: { /* required */
    type: S3 | WEB | CONFLUENCE | SALESFORCE | SHAREPOINT, /* required */
    confluenceConfiguration: {
      sourceConfiguration: { /* required */
        authType: BASIC | OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        hostType: SAAS, /* required */
        hostUrl: 'STRING_VALUE' /* required */
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    s3Configuration: {
      bucketArn: 'STRING_VALUE', /* required */
      bucketOwnerAccountId: 'STRING_VALUE',
      inclusionPrefixes: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    salesforceConfiguration: {
      sourceConfiguration: { /* required */
        authType: OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        hostUrl: 'STRING_VALUE' /* required */
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    sharePointConfiguration: {
      sourceConfiguration: { /* required */
        authType: OAUTH2_CLIENT_CREDENTIALS, /* required */
        credentialsSecretArn: 'STRING_VALUE', /* required */
        domain: 'STRING_VALUE', /* required */
        hostType: ONLINE, /* required */
        siteUrls: [ /* required */
          'STRING_VALUE',
          /* more items */
        ],
        tenantId: 'STRING_VALUE'
      },
      crawlerConfiguration: {
        filterConfiguration: {
          type: PATTERN, /* required */
          patternObjectFilter: {
            filters: [ /* required */
              {
                objectType: 'STRING_VALUE', /* required */
                exclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ],
                inclusionFilters: [
                  'STRING_VALUE',
                  /* more items */
                ]
              },
              /* more items */
            ]
          }
        }
      }
    },
    webConfiguration: {
      sourceConfiguration: { /* required */
        urlConfiguration: { /* required */
          seedUrls: [
            {
              url: 'STRING_VALUE'
            },
            /* more items */
          ]
        }
      },
      crawlerConfiguration: {
        crawlerLimits: {
          rateLimit: 'NUMBER_VALUE'
        },
        exclusionFilters: [
          'STRING_VALUE',
          /* more items */
        ],
        inclusionFilters: [
          'STRING_VALUE',
          /* more items */
        ],
        scope: HOST_ONLY | SUBDOMAINS
      }
    }
  },
  dataSourceId: 'STRING_VALUE', /* required */
  knowledgeBaseId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  dataDeletionPolicy: RETAIN | DELETE,
  description: 'STRING_VALUE',
  serverSideEncryptionConfiguration: {
    kmsKeyArn: 'STRING_VALUE'
  },
  vectorIngestionConfiguration: {
    chunkingConfiguration: {
      chunkingStrategy: FIXED_SIZE | NONE | HIERARCHICAL | SEMANTIC, /* required */
      fixedSizeChunkingConfiguration: {
        maxTokens: 'NUMBER_VALUE', /* required */
        overlapPercentage: 'NUMBER_VALUE' /* required */
      },
      hierarchicalChunkingConfiguration: {
        levelConfigurations: [ /* required */
          {
            maxTokens: 'NUMBER_VALUE' /* required */
          },
          /* more items */
        ],
        overlapTokens: 'NUMBER_VALUE' /* required */
      },
      semanticChunkingConfiguration: {
        breakpointPercentileThreshold: 'NUMBER_VALUE', /* required */
        bufferSize: 'NUMBER_VALUE', /* required */
        maxTokens: 'NUMBER_VALUE' /* required */
      }
    },
    customTransformationConfiguration: {
      intermediateStorage: { /* required */
        s3Location: { /* required */
          uri: 'STRING_VALUE' /* required */
        }
      },
      transformations: [ /* required */
        {
          stepToApply: POST_CHUNKING, /* required */
          transformationFunction: { /* required */
            transformationLambdaConfiguration: { /* required */
              lambdaArn: 'STRING_VALUE' /* required */
            }
          }
        },
        /* more items */
      ]
    },
    parsingConfiguration: {
      parsingStrategy: BEDROCK_FOUNDATION_MODEL, /* required */
      bedrockFoundationModelConfiguration: {
        modelArn: 'STRING_VALUE', /* required */
        parsingPrompt: {
          parsingPromptText: 'STRING_VALUE' /* required */
        }
      }
    }
  }
};
bedrockagent.updateDataSource(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: {})
    • dataDeletionPolicy — (String)

      The data deletion policy for the data source that you want to update.

      Possible values include:
      • "RETAIN"
      • "DELETE"
    • dataSourceConfiguration — (map)

      The connection configuration for the data source that you want to update.

      • confluenceConfiguration — (map)

        The configuration information to connect to Confluence as your data source.

        Note: Confluence data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the Confluence content. For example, configuring specific types of Confluence content.

          • filterConfiguration — (map)

            The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your Confluence data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your Confluence instance.

            Possible values include:
            • "BASIC"
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

          • hostTyperequired — (String)

            The supported host type, whether online/cloud or server/on-premises.

            Possible values include:
            • "SAAS"
          • hostUrlrequired — (String)

            The Confluence host URL or instance URL.

      • s3Configuration — (map)

        The configuration information to connect to Amazon S3 as your data source.

        • bucketArnrequired — (String)

          The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

        • bucketOwnerAccountId — (String)

          The account ID for the owner of the S3 bucket.

        • inclusionPrefixes — (Array<String>)

          A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

      • salesforceConfiguration — (map)

        The configuration information to connect to Salesforce as your data source.

        Note: Salesforce data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

          • filterConfiguration — (map)

            The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your Salesforce data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your Salesforce instance.

            Possible values include:
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

          • hostUrlrequired — (String)

            The Salesforce host URL or instance URL.

      • sharePointConfiguration — (map)

        The configuration information to connect to SharePoint as your data source.

        Note: SharePoint data source connector is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

          • filterConfiguration — (map)

            The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

            • patternObjectFilter — (map)

              The configuration of filtering certain objects or content types of the data source.

              • filtersrequired — (Array<map>)

                The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                • exclusionFilters — (Array<String>)

                  A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • inclusionFilters — (Array<String>)

                  A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                • objectTyperequired — (String)

                  The supported object type or content type of the data source.

            • typerequired — (String)

              The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

              Possible values include:
              • "PATTERN"
        • sourceConfigurationrequired — (map)

          The endpoint information to connect to your SharePoint data source.

          • authTyperequired — (String)

            The supported authentication type to authenticate and connect to your SharePoint site/sites.

            Possible values include:
            • "OAUTH2_CLIENT_CREDENTIALS"
          • credentialsSecretArnrequired — (String)

            The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

          • domainrequired — (String)

            The domain of your SharePoint instance or site URL/URLs.

          • hostTyperequired — (String)

            The supported host type, whether online/cloud or server/on-premises.

            Possible values include:
            • "ONLINE"
          • siteUrlsrequired — (Array<String>)

            A list of one or more SharePoint site URLs.

          • tenantId — (String)

            The identifier of your Microsoft 365 tenant.

      • typerequired — (String)

        The type of data source.

        Possible values include:
        • "S3"
        • "WEB"
        • "CONFLUENCE"
        • "SALESFORCE"
        • "SHAREPOINT"
      • webConfiguration — (map)

        The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

        Note: Crawling web URLs as your data source is in preview release and is subject to change.
        • crawlerConfiguration — (map)

          The Web Crawler configuration details for the web data source.

          • crawlerLimits — (map)

            The configuration of crawl limits for the web URLs.

            • rateLimit — (Integer)

              The max rate at which pages are crawled, up to 300 per minute per host.

          • exclusionFilters — (Array<String>)

            A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

          • inclusionFilters — (Array<String>)

            A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

          • scope — (String)

            The scope of what is crawled for your URLs.

            You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

            Possible values include:
            • "HOST_ONLY"
            • "SUBDOMAINS"
        • sourceConfigurationrequired — (map)

          The source configuration details for the web data source.

          • urlConfigurationrequired — (map)

            The configuration of the URL/URLs.

            • seedUrls — (Array<map>)

              One or more seed or starting point URLs.

              • url — (String)

                A seed or starting point URL.

    • dataSourceId — (String)

      The unique identifier of the data source.

    • description — (String)

      Specifies a new description for the data source.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base for the data source.

    • name — (String)

      Specifies a new name for the data source.

    • serverSideEncryptionConfiguration — (map)

      Contains details about server-side encryption of the data source.

      • kmsKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

    • vectorIngestionConfiguration — (map)

      Contains details about how to ingest the documents in the data source.

      • chunkingConfiguration — (map)

        Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

        • chunkingStrategyrequired — (String)

          Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

          • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

          • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

          • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

          • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          Possible values include:
          • "FIXED_SIZE"
          • "NONE"
          • "HIERARCHICAL"
          • "SEMANTIC"
        • fixedSizeChunkingConfiguration — (map)

          Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

          • maxTokensrequired — (Integer)

            The maximum number of tokens to include in a chunk.

          • overlapPercentagerequired — (Integer)

            The percentage of overlap between adjacent chunks of a data source.

        • hierarchicalChunkingConfiguration — (map)

          Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

          • levelConfigurationsrequired — (Array<map>)

            Token settings for each layer.

            • maxTokensrequired — (Integer)

              The maximum number of tokens that a chunk can contain in this layer.

          • overlapTokensrequired — (Integer)

            The number of tokens to repeat across chunks in the same layer.

        • semanticChunkingConfiguration — (map)

          Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

          • breakpointPercentileThresholdrequired — (Integer)

            The dissimilarity threshold for splitting chunks.

          • bufferSizerequired — (Integer)

            The buffer size.

          • maxTokensrequired — (Integer)

            The maximum number of tokens that a chunk can contain.

      • customTransformationConfiguration — (map)

        A custom document transformer for parsed data source documents.

        • intermediateStoragerequired — (map)

          An S3 bucket path for input and output objects.

          • s3Locationrequired — (map)

            An S3 bucket path.

            • urirequired — (String)

              The location's URI. For example, s3://my-bucket/chunk-processor/.

        • transformationsrequired — (Array<map>)

          A Lambda function that processes documents.

          • stepToApplyrequired — (String)

            When the service applies the transformation.

            Possible values include:
            • "POST_CHUNKING"
          • transformationFunctionrequired — (map)

            A Lambda function that processes documents.

            • transformationLambdaConfigurationrequired — (map)

              The Lambda function.

              • lambdaArnrequired — (String)

                The function's ARN identifier.

      • parsingConfiguration — (map)

        A custom parser for data source documents.

        • bedrockFoundationModelConfiguration — (map)

          Settings for a foundation model used to parse documents for a data source.

          • modelArnrequired — (String)

            The model's ARN.

          • parsingPrompt — (map)

            Instructions for interpreting the contents of a document.

            • parsingPromptTextrequired — (String)

              Instructions for interpreting the contents of a document.

        • parsingStrategyrequired — (String)

          The parsing strategy for the data source.

          Possible values include:
          • "BEDROCK_FOUNDATION_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:

      • dataSource — (map)

        Contains details about the data source.

        • createdAtrequired — (Date)

          The time at which the data source was created.

        • dataDeletionPolicy — (String)

          The data deletion policy for the data source.

          Possible values include:
          • "RETAIN"
          • "DELETE"
        • dataSourceConfigurationrequired — (map)

          The connection configuration for the data source.

          • confluenceConfiguration — (map)

            The configuration information to connect to Confluence as your data source.

            Note: Confluence data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Confluence content. For example, configuring specific types of Confluence content.

              • filterConfiguration — (map)

                The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Confluence data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Confluence instance.

                Possible values include:
                • "BASIC"
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "SAAS"
              • hostUrlrequired — (String)

                The Confluence host URL or instance URL.

          • s3Configuration — (map)

            The configuration information to connect to Amazon S3 as your data source.

            • bucketArnrequired — (String)

              The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

          • salesforceConfiguration — (map)

            The configuration information to connect to Salesforce as your data source.

            Note: Salesforce data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

              • filterConfiguration — (map)

                The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your Salesforce data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your Salesforce instance.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

              • hostUrlrequired — (String)

                The Salesforce host URL or instance URL.

          • sharePointConfiguration — (map)

            The configuration information to connect to SharePoint as your data source.

            Note: SharePoint data source connector is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

              • filterConfiguration — (map)

                The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

                • patternObjectFilter — (map)

                  The configuration of filtering certain objects or content types of the data source.

                  • filtersrequired — (Array<map>)

                    The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters — (Array<String>)

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • inclusionFilters — (Array<String>)

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                    • objectTyperequired — (String)

                      The supported object type or content type of the data source.

                • typerequired — (String)

                  The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

                  Possible values include:
                  • "PATTERN"
            • sourceConfigurationrequired — (map)

              The endpoint information to connect to your SharePoint data source.

              • authTyperequired — (String)

                The supported authentication type to authenticate and connect to your SharePoint site/sites.

                Possible values include:
                • "OAUTH2_CLIENT_CREDENTIALS"
              • credentialsSecretArnrequired — (String)

                The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

              • domainrequired — (String)

                The domain of your SharePoint instance or site URL/URLs.

              • hostTyperequired — (String)

                The supported host type, whether online/cloud or server/on-premises.

                Possible values include:
                • "ONLINE"
              • siteUrlsrequired — (Array<String>)

                A list of one or more SharePoint site URLs.

              • tenantId — (String)

                The identifier of your Microsoft 365 tenant.

          • typerequired — (String)

            The type of data source.

            Possible values include:
            • "S3"
            • "WEB"
            • "CONFLUENCE"
            • "SALESFORCE"
            • "SHAREPOINT"
          • webConfiguration — (map)

            The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

            Note: Crawling web URLs as your data source is in preview release and is subject to change.
            • crawlerConfiguration — (map)

              The Web Crawler configuration details for the web data source.

              • crawlerLimits — (map)

                The configuration of crawl limits for the web URLs.

                • rateLimit — (Integer)

                  The max rate at which pages are crawled, up to 300 per minute per host.

              • exclusionFilters — (Array<String>)

                A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • inclusionFilters — (Array<String>)

                A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • scope — (String)

                The scope of what is crawled for your URLs.

                You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

                Possible values include:
                • "HOST_ONLY"
                • "SUBDOMAINS"
            • sourceConfigurationrequired — (map)

              The source configuration details for the web data source.

              • urlConfigurationrequired — (map)

                The configuration of the URL/URLs.

                • seedUrls — (Array<map>)

                  One or more seed or starting point URLs.

                  • url — (String)

                    A seed or starting point URL.

        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The detailed reasons on the failure to delete a data source.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base to which the data source belongs.

        • namerequired — (String)

          The name of the data source.

        • serverSideEncryptionConfiguration — (map)

          Contains details about the configuration of the server-side encryption.

          • kmsKeyArn — (String)

            The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource.

        • statusrequired — (String)

          The status of the data source. The following statuses are possible:

          • Available – The data source has been created and is ready for ingestion into the knowledge base.

          • Deleting – The data source is being deleted.

          Possible values include:
          • "AVAILABLE"
          • "DELETING"
          • "DELETE_UNSUCCESSFUL"
        • updatedAtrequired — (Date)

          The time at which the data source was last updated.

        • vectorIngestionConfiguration — (map)

          Contains details about how to ingest the documents in the data source.

          • chunkingConfiguration — (map)

            Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

            • chunkingStrategyrequired — (String)

              Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

              • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

              • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

              • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

              Possible values include:
              • "FIXED_SIZE"
              • "NONE"
              • "HIERARCHICAL"
              • "SEMANTIC"
            • fixedSizeChunkingConfiguration — (map)

              Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

              • maxTokensrequired — (Integer)

                The maximum number of tokens to include in a chunk.

              • overlapPercentagerequired — (Integer)

                The percentage of overlap between adjacent chunks of a data source.

            • hierarchicalChunkingConfiguration — (map)

              Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

              • levelConfigurationsrequired — (Array<map>)

                Token settings for each layer.

                • maxTokensrequired — (Integer)

                  The maximum number of tokens that a chunk can contain in this layer.

              • overlapTokensrequired — (Integer)

                The number of tokens to repeat across chunks in the same layer.

            • semanticChunkingConfiguration — (map)

              Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

              • breakpointPercentileThresholdrequired — (Integer)

                The dissimilarity threshold for splitting chunks.

              • bufferSizerequired — (Integer)

                The buffer size.

              • maxTokensrequired — (Integer)

                The maximum number of tokens that a chunk can contain.

          • customTransformationConfiguration — (map)

            A custom document transformer for parsed data source documents.

            • intermediateStoragerequired — (map)

              An S3 bucket path for input and output objects.

              • s3Locationrequired — (map)

                An S3 bucket path.

                • urirequired — (String)

                  The location's URI. For example, s3://my-bucket/chunk-processor/.

            • transformationsrequired — (Array<map>)

              A Lambda function that processes documents.

              • stepToApplyrequired — (String)

                When the service applies the transformation.

                Possible values include:
                • "POST_CHUNKING"
              • transformationFunctionrequired — (map)

                A Lambda function that processes documents.

                • transformationLambdaConfigurationrequired — (map)

                  The Lambda function.

                  • lambdaArnrequired — (String)

                    The function's ARN identifier.

          • parsingConfiguration — (map)

            A custom parser for data source documents.

            • bedrockFoundationModelConfiguration — (map)

              Settings for a foundation model used to parse documents for a data source.

              • modelArnrequired — (String)

                The model's ARN.

              • parsingPrompt — (map)

                Instructions for interpreting the contents of a document.

                • parsingPromptTextrequired — (String)

                  Instructions for interpreting the contents of a document.

            • parsingStrategyrequired — (String)

              The parsing strategy for the data source.

              Possible values include:
              • "BEDROCK_FOUNDATION_MODEL"

Returns:

  • (AWS.Request)

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

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

Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the updateFlow operation

var params = {
  executionRoleArn: 'STRING_VALUE', /* required */
  flowIdentifier: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  customerEncryptionKeyArn: 'STRING_VALUE',
  definition: {
    connections: [
      {
        name: 'STRING_VALUE', /* required */
        source: 'STRING_VALUE', /* required */
        target: 'STRING_VALUE', /* required */
        type: Data | Conditional, /* required */
        configuration: {
          conditional: {
            condition: 'STRING_VALUE' /* required */
          },
          data: {
            sourceOutput: 'STRING_VALUE', /* required */
            targetInput: 'STRING_VALUE' /* required */
          }
        }
      },
      /* more items */
    ],
    nodes: [
      {
        name: 'STRING_VALUE', /* required */
        type: Input | Output | KnowledgeBase | Condition | Lex | Prompt | LambdaFunction | Storage | Agent | Retrieval | Iterator | Collector, /* required */
        configuration: {
          agent: {
            agentAliasArn: 'STRING_VALUE' /* required */
          },
          collector: {
          },
          condition: {
            conditions: [ /* required */
              {
                name: 'STRING_VALUE', /* required */
                expression: 'STRING_VALUE'
              },
              /* more items */
            ]
          },
          input: {
          },
          iterator: {
          },
          knowledgeBase: {
            knowledgeBaseId: 'STRING_VALUE', /* required */
            modelId: 'STRING_VALUE'
          },
          lambdaFunction: {
            lambdaArn: 'STRING_VALUE' /* required */
          },
          lex: {
            botAliasArn: 'STRING_VALUE', /* required */
            localeId: 'STRING_VALUE' /* required */
          },
          output: {
          },
          prompt: {
            sourceConfiguration: { /* required */
              inline: {
                modelId: 'STRING_VALUE', /* required */
                templateConfiguration: { /* required */
                  text: {
                    text: 'STRING_VALUE', /* required */
                    inputVariables: [
                      {
                        name: 'STRING_VALUE'
                      },
                      /* more items */
                    ]
                  }
                },
                templateType: TEXT, /* required */
                inferenceConfiguration: {
                  text: {
                    maxTokens: 'NUMBER_VALUE',
                    stopSequences: [
                      'STRING_VALUE',
                      /* more items */
                    ],
                    temperature: 'NUMBER_VALUE',
                    topK: 'NUMBER_VALUE',
                    topP: 'NUMBER_VALUE'
                  }
                }
              },
              resource: {
                promptArn: 'STRING_VALUE' /* required */
              }
            }
          },
          retrieval: {
            serviceConfiguration: { /* required */
              s3: {
                bucketName: 'STRING_VALUE' /* required */
              }
            }
          },
          storage: {
            serviceConfiguration: { /* required */
              s3: {
                bucketName: 'STRING_VALUE' /* required */
              }
            }
          }
        },
        inputs: [
          {
            expression: 'STRING_VALUE', /* required */
            name: 'STRING_VALUE', /* required */
            type: String | Number | Boolean | Object | Array /* required */
          },
          /* more items */
        ],
        outputs: [
          {
            name: 'STRING_VALUE', /* required */
            type: String | Number | Boolean | Object | Array /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  description: 'STRING_VALUE'
};
bedrockagent.updateFlow(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: {})
    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.

    • definition — (map)

      A definition of the nodes and the connections between the nodes in the flow.

      • connections — (Array<map>)

        An array of connection definitions in the flow.

        • configuration — (map)

          The configuration of the connection.

          • conditional — (map)

            The configuration of a connection originating from a Condition node.

            • conditionrequired — (String)

              The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

          • data — (map)

            The configuration of a connection originating from a node that isn't a Condition node.

            • sourceOutputrequired — (String)

              The name of the output in the source node that the connection begins from.

            • targetInputrequired — (String)

              The name of the input in the target node that the connection ends at.

        • namerequired — (String)

          A name for the connection that you can reference.

        • sourcerequired — (String)

          The node that the connection starts at.

        • targetrequired — (String)

          The node that the connection ends at.

        • typerequired — (String)

          Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

          Possible values include:
          • "Data"
          • "Conditional"
      • nodes — (Array<map>)

        An array of node definitions in the flow.

        • configuration — (map)

          Contains configurations for the node.

          • agent — (map)

            Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

            • agentAliasArnrequired — (String)

              The Amazon Resource Name (ARN) of the alias of the agent to invoke.

          • collector — (map)

            Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

          • condition — (map)

            Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

            • conditionsrequired — (Array<map>)

              An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

              • expression — (String)

                Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

              • namerequired — (String)

                A name for the condition that you can reference.

          • input — (map)

            Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

          • iterator — (map)

            Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

            The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

          • knowledgeBase — (map)

            Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

            • knowledgeBaseIdrequired — (String)

              The unique identifier of the knowledge base to query.

            • modelId — (String)

              The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

          • lambdaFunction — (map)

            Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

            • lambdaArnrequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to invoke.

          • lex — (map)

            Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

            • botAliasArnrequired — (String)

              The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

            • localeIdrequired — (String)

              The Region to invoke the Amazon Lex bot in.

          • output — (map)

            Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

          • prompt — (map)

            Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

            • sourceConfigurationrequired — (map)

              Specifies whether the prompt is from Prompt management or defined inline.

              • inline — (map)

                Contains configurations for a prompt that is defined inline

                • inferenceConfiguration — (map)

                  Contains inference configurations for the prompt.

                  • text — (map)

                    Contains inference configurations for a text prompt.

                    • maxTokens — (Integer)

                      The maximum number of tokens to return in the response.

                    • stopSequences — (Array<String>)

                      A list of strings that define sequences after which the model will stop generating.

                    • temperature — (Float)

                      Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                    • topK — (Integer)

                      The number of most-likely candidates that the model considers for the next token during generation.

                    • topP — (Float)

                      The percentage of most-likely candidates that the model considers for the next token.

                • modelIdrequired — (String)

                  The unique identifier of the model to run inference with.

                • templateConfigurationrequired — (map)

                  Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                  • text — (map)

                    Contains configurations for the text in a message for a prompt.

                    • inputVariables — (Array<map>)

                      An array of the variables in the prompt template.

                      • name — (String)

                        The name of the variable.

                    • textrequired — (String)

                      The message for the prompt.

                • templateTyperequired — (String)

                  The type of prompt template.

                  Possible values include:
                  • "TEXT"
              • resource — (map)

                Contains configurations for a prompt from Prompt management.

                • promptArnrequired — (String)

                  The Amazon Resource Name (ARN) of the prompt from Prompt management.

          • retrieval — (map)

            Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

            • serviceConfigurationrequired — (map)

              Contains configurations for the service to use for retrieving data to return as the output from the node.

              • s3 — (map)

                Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                • bucketNamerequired — (String)

                  The name of the Amazon S3 bucket from which to retrieve data.

          • storage — (map)

            Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

            • serviceConfigurationrequired — (map)

              Contains configurations for the service to use for storing the input into the node.

              • s3 — (map)

                Contains configurations for the Amazon S3 location in which to store the input into the node.

                • bucketNamerequired — (String)

                  The name of the Amazon S3 bucket in which to store the input into the node.

        • inputs — (Array<map>)

          An array of objects, each of which contains information about an input into the node.

          • expressionrequired — (String)

            An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

          • namerequired — (String)

            A name for the input that you can reference.

          • typerequired — (String)

            The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

            Possible values include:
            • "String"
            • "Number"
            • "Boolean"
            • "Object"
            • "Array"
        • namerequired — (String)

          A name for the node.

        • outputs — (Array<map>)

          A list of objects, each of which contains information about an output from the node.

          • namerequired — (String)

            A name for the output that you can reference.

          • typerequired — (String)

            The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

            Possible values include:
            • "String"
            • "Number"
            • "Boolean"
            • "Object"
            • "Array"
        • typerequired — (String)

          The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

          Possible values include:
          • "Input"
          • "Output"
          • "KnowledgeBase"
          • "Condition"
          • "Lex"
          • "Prompt"
          • "LambdaFunction"
          • "Storage"
          • "Agent"
          • "Retrieval"
          • "Iterator"
          • "Collector"
    • description — (String)

      A description for the flow.

    • executionRoleArn — (String)

      The Amazon Resource Name (ARN) of the service role with permissions to create and manage a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

    • flowIdentifier — (String)

      The unique identifier of the flow.

    • name — (String)

      A name for the flow.

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key that the flow was encrypted with.

      • definition — (map)

        A definition of the nodes and the connections between nodes in the flow.

        • connections — (Array<map>)

          An array of connection definitions in the flow.

          • configuration — (map)

            The configuration of the connection.

            • conditional — (map)

              The configuration of a connection originating from a Condition node.

              • conditionrequired — (String)

                The condition that triggers this connection. For more information about how to write conditions, see the Condition node type in the Node types topic in the Amazon Bedrock User Guide.

            • data — (map)

              The configuration of a connection originating from a node that isn't a Condition node.

              • sourceOutputrequired — (String)

                The name of the output in the source node that the connection begins from.

              • targetInputrequired — (String)

                The name of the input in the target node that the connection ends at.

          • namerequired — (String)

            A name for the connection that you can reference.

          • sourcerequired — (String)

            The node that the connection starts at.

          • targetrequired — (String)

            The node that the connection ends at.

          • typerequired — (String)

            Whether the source node that the connection begins from is a condition node (Conditional) or not (Data).

            Possible values include:
            • "Data"
            • "Conditional"
        • nodes — (Array<map>)

          An array of node definitions in the flow.

          • configuration — (map)

            Contains configurations for the node.

            • agent — (map)

              Contains configurations for an agent node in your flow. Invokes an alias of an agent and returns the response.

              • agentAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the alias of the agent to invoke.

            • collector — (map)

              Contains configurations for a collector node in your flow. Collects an iteration of inputs and consolidates them into an array of outputs.

            • condition — (map)

              Contains configurations for a Condition node in your flow. Defines conditions that lead to different branches of the flow.

              • conditionsrequired — (Array<map>)

                An array of conditions. Each member contains the name of a condition and an expression that defines the condition.

                • expression — (String)

                  Defines the condition. You must refer to at least one of the inputs in the condition. For more information, expand the Condition node section in Node types in prompt flows.

                • namerequired — (String)

                  A name for the condition that you can reference.

            • input — (map)

              Contains configurations for an input flow node in your flow. The first node in the flow. inputs can't be specified for this node.

            • iterator — (map)

              Contains configurations for an iterator node in your flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

              The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

            • knowledgeBase — (map)

              Contains configurations for a knowledge base node in your flow. Queries a knowledge base and returns the retrieved results or generated response.

              • knowledgeBaseIdrequired — (String)

                The unique identifier of the knowledge base to query.

              • modelId — (String)

                The unique identifier of the model to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.

            • lambdaFunction — (map)

              Contains configurations for a Lambda function node in your flow. Invokes an Lambda function.

              • lambdaArnrequired — (String)

                The Amazon Resource Name (ARN) of the Lambda function to invoke.

            • lex — (map)

              Contains configurations for a Lex node in your flow. Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.

              • botAliasArnrequired — (String)

                The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.

              • localeIdrequired — (String)

                The Region to invoke the Amazon Lex bot in.

            • output — (map)

              Contains configurations for an output flow node in your flow. The last node in the flow. outputs can't be specified for this node.

            • prompt — (map)

              Contains configurations for a prompt node in your flow. Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.

              • sourceConfigurationrequired — (map)

                Specifies whether the prompt is from Prompt management or defined inline.

                • inline — (map)

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration — (map)

                    Contains inference configurations for the prompt.

                    • text — (map)

                      Contains inference configurations for a text prompt.

                      • maxTokens — (Integer)

                        The maximum number of tokens to return in the response.

                      • stopSequences — (Array<String>)

                        A list of strings that define sequences after which the model will stop generating.

                      • temperature — (Float)

                        Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

                      • topK — (Integer)

                        The number of most-likely candidates that the model considers for the next token during generation.

                      • topP — (Float)

                        The percentage of most-likely candidates that the model considers for the next token.

                  • modelIdrequired — (String)

                    The unique identifier of the model to run inference with.

                  • templateConfigurationrequired — (map)

                    Contains a prompt and variables in the prompt that can be replaced with values at runtime.

                    • text — (map)

                      Contains configurations for the text in a message for a prompt.

                      • inputVariables — (Array<map>)

                        An array of the variables in the prompt template.

                        • name — (String)

                          The name of the variable.

                      • textrequired — (String)

                        The message for the prompt.

                  • templateTyperequired — (String)

                    The type of prompt template.

                    Possible values include:
                    • "TEXT"
                • resource — (map)

                  Contains configurations for a prompt from Prompt management.

                  • promptArnrequired — (String)

                    The Amazon Resource Name (ARN) of the prompt from Prompt management.

            • retrieval — (map)

              Contains configurations for a Retrieval node in your flow. Retrieves data from an Amazon S3 location and returns it as the output.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for retrieving data to return as the output from the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location from which to retrieve data to return as the output from the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket from which to retrieve data.

            • storage — (map)

              Contains configurations for a Storage node in your flow. Stores an input in an Amazon S3 location.

              • serviceConfigurationrequired — (map)

                Contains configurations for the service to use for storing the input into the node.

                • s3 — (map)

                  Contains configurations for the Amazon S3 location in which to store the input into the node.

                  • bucketNamerequired — (String)

                    The name of the Amazon S3 bucket in which to store the input into the node.

          • inputs — (Array<map>)

            An array of objects, each of which contains information about an input into the node.

            • expressionrequired — (String)

              An expression that formats the input for the node. For an explanation of how to create expressions, see Expressions in Prompt flows in Amazon Bedrock.

            • namerequired — (String)

              A name for the input that you can reference.

            • typerequired — (String)

              The data type of the input. If the input doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • namerequired — (String)

            A name for the node.

          • outputs — (Array<map>)

            A list of objects, each of which contains information about an output from the node.

            • namerequired — (String)

              A name for the output that you can reference.

            • typerequired — (String)

              The data type of the output. If the output doesn't match this type at runtime, a validation error will be thrown.

              Possible values include:
              • "String"
              • "Number"
              • "Boolean"
              • "Object"
              • "Array"
          • typerequired — (String)

            The type of node. This value must match the name of the key that you provide in the configuration you provide in the FlowNodeConfiguration field.

            Possible values include:
            • "Input"
            • "Output"
            • "KnowledgeBase"
            • "Condition"
            • "Lex"
            • "Prompt"
            • "LambdaFunction"
            • "Storage"
            • "Agent"
            • "Retrieval"
            • "Iterator"
            • "Collector"
      • description — (String)

        The description of the flow.

      • executionRoleArn — (String)

        The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see Create a service role for flows in Amazon Bedrock in the Amazon Bedrock User Guide.

      • id — (String)

        The unique identifier of the flow.

      • name — (String)

        The name of the flow.

      • status — (String)

        The status of the flow. When you submit this request, the status will be NotPrepared. If updating fails, the status becomes Failed.

        Possible values include:
        • "Failed"
        • "Prepared"
        • "Preparing"
        • "NotPrepared"
      • updatedAt — (Date)

        The time at which the flow was last updated.

      • version — (String)

        The version of the flow. When you update a flow, the version updated is the DRAFT version.

Returns:

  • (AWS.Request)

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

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

Modifies the alias of a flow. Include both fields that you want to keep and ones that you want to change. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the updateFlowAlias operation

var params = {
  aliasIdentifier: 'STRING_VALUE', /* required */
  flowIdentifier: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  routingConfiguration: [ /* required */
    {
      flowVersion: 'STRING_VALUE'
    },
    /* more items */
  ],
  description: 'STRING_VALUE'
};
bedrockagent.updateFlowAlias(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: {})
    • aliasIdentifier — (String)

      The unique identifier of the alias.

    • description — (String)

      A description for the flow alias.

    • flowIdentifier — (String)

      The unique identifier of the flow.

    • name — (String)

      The name of the flow alias.

    • routingConfiguration — (Array<map>)

      Contains information about the version to which to map the alias.

      • flowVersion — (String)

        The version that the alias maps 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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the flow.

      • createdAt — (Date)

        The time at which the flow was created.

      • description — (String)

        The description of the flow.

      • flowId — (String)

        The unique identifier of the flow.

      • id — (String)

        The unique identifier of the alias.

      • name — (String)

        The name of the flow alias.

      • routingConfiguration — (Array<map>)

        Contains information about the version that the alias is mapped to.

        • flowVersion — (String)

          The version that the alias maps to.

      • updatedAt — (Date)

        The time at which the flow alias was last updated.

Returns:

  • (AWS.Request)

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

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

Updates the configuration of a knowledge base with the fields that you specify. Because all fields will be overwritten, you must include the same values for fields that you want to keep the same.

You can change the following fields:

  • name

  • description

  • roleArn

You can't change the knowledgeBaseConfiguration or storageConfiguration fields, so you must specify the same configurations as when you created the knowledge base. You can send a GetKnowledgeBase request and copy the same configurations.

Service Reference:

Examples:

Calling the updateKnowledgeBase operation

var params = {
  knowledgeBaseConfiguration: { /* required */
    type: VECTOR, /* required */
    vectorKnowledgeBaseConfiguration: {
      embeddingModelArn: 'STRING_VALUE', /* required */
      embeddingModelConfiguration: {
        bedrockEmbeddingModelConfiguration: {
          dimensions: 'NUMBER_VALUE'
        }
      }
    }
  },
  knowledgeBaseId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  storageConfiguration: { /* required */
    type: OPENSEARCH_SERVERLESS | PINECONE | REDIS_ENTERPRISE_CLOUD | RDS | MONGO_DB_ATLAS, /* required */
    mongoDbAtlasConfiguration: {
      collectionName: 'STRING_VALUE', /* required */
      credentialsSecretArn: 'STRING_VALUE', /* required */
      databaseName: 'STRING_VALUE', /* required */
      endpoint: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE', /* required */
      endpointServiceName: 'STRING_VALUE'
    },
    opensearchServerlessConfiguration: {
      collectionArn: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE' /* required */
    },
    pineconeConfiguration: {
      connectionString: 'STRING_VALUE', /* required */
      credentialsSecretArn: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE' /* required */
      },
      namespace: 'STRING_VALUE'
    },
    rdsConfiguration: {
      credentialsSecretArn: 'STRING_VALUE', /* required */
      databaseName: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        primaryKeyField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      resourceArn: 'STRING_VALUE', /* required */
      tableName: 'STRING_VALUE' /* required */
    },
    redisEnterpriseCloudConfiguration: {
      credentialsSecretArn: 'STRING_VALUE', /* required */
      endpoint: 'STRING_VALUE', /* required */
      fieldMapping: { /* required */
        metadataField: 'STRING_VALUE', /* required */
        textField: 'STRING_VALUE', /* required */
        vectorField: 'STRING_VALUE' /* required */
      },
      vectorIndexName: 'STRING_VALUE' /* required */
    }
  },
  description: 'STRING_VALUE'
};
bedrockagent.updateKnowledgeBase(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: {})
    • description — (String)

      Specifies a new description for the knowledge base.

    • knowledgeBaseConfiguration — (map)

      Specifies the configuration for the embeddings model used for the knowledge base. You must use the same configuration as when the knowledge base was created.

      • typerequired — (String)

        The type of data that the data source is converted into for the knowledge base.

        Possible values include:
        • "VECTOR"
      • vectorKnowledgeBaseConfiguration — (map)

        Contains details about the embeddings model that'sused to convert the data source.

        • embeddingModelArnrequired — (String)

          The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

        • embeddingModelConfiguration — (map)

          The embeddings model configuration details for the vector model used in Knowledge Base.

          • bedrockEmbeddingModelConfiguration — (map)

            The vector configuration details on the Bedrock embeddings model.

            • dimensions — (Integer)

              The dimensions details for the vector configuration used on the Bedrock embeddings model.

    • knowledgeBaseId — (String)

      The unique identifier of the knowledge base to update.

    • name — (String)

      Specifies a new name for the knowledge base.

    • roleArn — (String)

      Specifies a different Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

    • storageConfiguration — (map)

      Specifies the configuration for the vector store used for the knowledge base. You must use the same configuration as when the knowledge base was created.

      • mongoDbAtlasConfiguration — (map)

        Contains the storage configuration of the knowledge base in MongoDB Atlas.

        • collectionNamerequired — (String)

          The collection name of the knowledge base in MongoDB Atlas.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

        • databaseNamerequired — (String)

          The database name in your MongoDB Atlas cluster for your knowledge base.

        • endpointrequired — (String)

          The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

        • endpointServiceName — (String)

          The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the MongoDB Atlas vector search index.

      • opensearchServerlessConfiguration — (map)

        Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

        • collectionArnrequired — (String)

          The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the vector store.

      • pineconeConfiguration — (map)

        Contains the storage configuration of the knowledge base in Pinecone.

        • connectionStringrequired — (String)

          The endpoint URL for your index management page.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

        • namespace — (String)

          The namespace to be used to write new data to your database.

      • rdsConfiguration — (map)

        Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

        • databaseNamerequired — (String)

          The name of your Amazon RDS database.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • primaryKeyFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the ID for each entry.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • resourceArnrequired — (String)

          The Amazon Resource Name (ARN) of the vector store.

        • tableNamerequired — (String)

          The name of the table in the database.

      • redisEnterpriseCloudConfiguration — (map)

        Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

        • credentialsSecretArnrequired — (String)

          The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

        • endpointrequired — (String)

          The endpoint URL of the Redis Enterprise Cloud database.

        • fieldMappingrequired — (map)

          Contains the names of the fields to which to map information about the vector store.

          • metadataFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores metadata about the vector store.

          • textFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

          • vectorFieldrequired — (String)

            The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

        • vectorIndexNamerequired — (String)

          The name of the vector index.

      • typerequired — (String)

        The vector store service in which the knowledge base is stored.

        Possible values include:
        • "OPENSEARCH_SERVERLESS"
        • "PINECONE"
        • "REDIS_ENTERPRISE_CLOUD"
        • "RDS"
        • "MONGO_DB_ATLAS"

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:

      • knowledgeBase — (map)

        Contains details about the knowledge base.

        • createdAtrequired — (Date)

          The time at which the knowledge base was created.

        • description — (String)

          The description of the knowledge base.

        • failureReasons — (Array<String>)

          A list of reasons that the API operation on the knowledge base failed.

        • knowledgeBaseArnrequired — (String)

          The Amazon Resource Name (ARN) of the knowledge base.

        • knowledgeBaseConfigurationrequired — (map)

          Contains details about the embeddings configuration of the knowledge base.

          • typerequired — (String)

            The type of data that the data source is converted into for the knowledge base.

            Possible values include:
            • "VECTOR"
          • vectorKnowledgeBaseConfiguration — (map)

            Contains details about the embeddings model that'sused to convert the data source.

            • embeddingModelArnrequired — (String)

              The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

            • embeddingModelConfiguration — (map)

              The embeddings model configuration details for the vector model used in Knowledge Base.

              • bedrockEmbeddingModelConfiguration — (map)

                The vector configuration details on the Bedrock embeddings model.

                • dimensions — (Integer)

                  The dimensions details for the vector configuration used on the Bedrock embeddings model.

        • knowledgeBaseIdrequired — (String)

          The unique identifier of the knowledge base.

        • namerequired — (String)

          The name of the knowledge base.

        • roleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

        • statusrequired — (String)

          The status of the knowledge base. The following statuses are possible:

          • CREATING – The knowledge base is being created.

          • ACTIVE – The knowledge base is ready to be queried.

          • DELETING – The knowledge base is being deleted.

          • UPDATING – The knowledge base is being updated.

          • FAILED – The knowledge base API operation failed.

          Possible values include:
          • "CREATING"
          • "ACTIVE"
          • "DELETING"
          • "UPDATING"
          • "FAILED"
          • "DELETE_UNSUCCESSFUL"
        • storageConfigurationrequired — (map)

          Contains details about the storage configuration of the knowledge base.

          • mongoDbAtlasConfiguration — (map)

            Contains the storage configuration of the knowledge base in MongoDB Atlas.

            • collectionNamerequired — (String)

              The collection name of the knowledge base in MongoDB Atlas.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

            • databaseNamerequired — (String)

              The database name in your MongoDB Atlas cluster for your knowledge base.

            • endpointrequired — (String)

              The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

            • endpointServiceName — (String)

              The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the MongoDB Atlas vector search index.

          • opensearchServerlessConfiguration — (map)

            Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

            • collectionArnrequired — (String)

              The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector store.

          • pineconeConfiguration — (map)

            Contains the storage configuration of the knowledge base in Pinecone.

            • connectionStringrequired — (String)

              The endpoint URL for your index management page.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

            • namespace — (String)

              The namespace to be used to write new data to your database.

          • rdsConfiguration — (map)

            Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

            • databaseNamerequired — (String)

              The name of your Amazon RDS database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • primaryKeyFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the ID for each entry.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • resourceArnrequired — (String)

              The Amazon Resource Name (ARN) of the vector store.

            • tableNamerequired — (String)

              The name of the table in the database.

          • redisEnterpriseCloudConfiguration — (map)

            Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

            • credentialsSecretArnrequired — (String)

              The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

            • endpointrequired — (String)

              The endpoint URL of the Redis Enterprise Cloud database.

            • fieldMappingrequired — (map)

              Contains the names of the fields to which to map information about the vector store.

              • metadataFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores metadata about the vector store.

              • textFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

              • vectorFieldrequired — (String)

                The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

            • vectorIndexNamerequired — (String)

              The name of the vector index.

          • typerequired — (String)

            The vector store service in which the knowledge base is stored.

            Possible values include:
            • "OPENSEARCH_SERVERLESS"
            • "PINECONE"
            • "REDIS_ENTERPRISE_CLOUD"
            • "RDS"
            • "MONGO_DB_ATLAS"
        • updatedAtrequired — (Date)

          The time at which the knowledge base was last updated.

Returns:

  • (AWS.Request)

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

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

Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see Prompt management in Amazon Bedrock and Edit prompts in your prompt library in the Amazon Bedrock User Guide.

Service Reference:

Examples:

Calling the updatePrompt operation

var params = {
  name: 'STRING_VALUE', /* required */
  promptIdentifier: 'STRING_VALUE', /* required */
  customerEncryptionKeyArn: 'STRING_VALUE',
  defaultVariant: 'STRING_VALUE',
  description: 'STRING_VALUE',
  variants: [
    {
      name: 'STRING_VALUE', /* required */
      templateType: TEXT, /* required */
      inferenceConfiguration: {
        text: {
          maxTokens: 'NUMBER_VALUE',
          stopSequences: [
            'STRING_VALUE',
            /* more items */
          ],
          temperature: 'NUMBER_VALUE',
          topK: 'NUMBER_VALUE',
          topP: 'NUMBER_VALUE'
        }
      },
      modelId: 'STRING_VALUE',
      templateConfiguration: {
        text: {
          text: 'STRING_VALUE', /* required */
          inputVariables: [
            {
              name: 'STRING_VALUE'
            },
            /* more items */
          ]
        }
      }
    },
    /* more items */
  ]
};
bedrockagent.updatePrompt(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: {})
    • customerEncryptionKeyArn — (String)

      The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.

    • defaultVariant — (String)

      The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

    • description — (String)

      A description for the prompt.

    • name — (String)

      A name for the prompt.

    • promptIdentifier — (String)

      The unique identifier of the prompt.

    • variants — (Array<map>)

      A list of objects, each containing details about a variant of the prompt.

      • inferenceConfiguration — (map)

        Contains inference configurations for the prompt variant.

        • text — (map)

          Contains inference configurations for a text prompt.

          • maxTokens — (Integer)

            The maximum number of tokens to return in the response.

          • stopSequences — (Array<String>)

            A list of strings that define sequences after which the model will stop generating.

          • temperature — (Float)

            Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

          • topK — (Integer)

            The number of most-likely candidates that the model considers for the next token during generation.

          • topP — (Float)

            The percentage of most-likely candidates that the model considers for the next token.

      • modelId — (String)

        The unique identifier of the model with which to run inference on the prompt.

      • namerequired — (String)

        The name of the prompt variant.

      • templateConfiguration — (map)

        Contains configurations for the prompt template.

        • text — (map)

          Contains configurations for the text in a message for a prompt.

          • inputVariables — (Array<map>)

            An array of the variables in the prompt template.

            • name — (String)

              The name of the variable.

          • textrequired — (String)

            The message for the prompt.

      • templateTyperequired — (String)

        The type of prompt template to use.

        Possible values include:
        • "TEXT"

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:

      • arn — (String)

        The Amazon Resource Name (ARN) of the prompt.

      • createdAt — (Date)

        The time at which the prompt was created.

      • customerEncryptionKeyArn — (String)

        The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.

      • defaultVariant — (String)

        The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

      • description — (String)

        The description of the prompt.

      • id — (String)

        The unique identifier of the prompt.

      • name — (String)

        The name of the prompt.

      • updatedAt — (Date)

        The time at which the prompt was last updated.

      • variants — (Array<map>)

        A list of objects, each containing details about a variant of the prompt.

        • inferenceConfiguration — (map)

          Contains inference configurations for the prompt variant.

          • text — (map)

            Contains inference configurations for a text prompt.

            • maxTokens — (Integer)

              The maximum number of tokens to return in the response.

            • stopSequences — (Array<String>)

              A list of strings that define sequences after which the model will stop generating.

            • temperature — (Float)

              Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.

            • topK — (Integer)

              The number of most-likely candidates that the model considers for the next token during generation.

            • topP — (Float)

              The percentage of most-likely candidates that the model considers for the next token.

        • modelId — (String)

          The unique identifier of the model with which to run inference on the prompt.

        • namerequired — (String)

          The name of the prompt variant.

        • templateConfiguration — (map)

          Contains configurations for the prompt template.

          • text — (map)

            Contains configurations for the text in a message for a prompt.

            • inputVariables — (Array<map>)

              An array of the variables in the prompt template.

              • name — (String)

                The name of the variable.

            • textrequired — (String)

              The message for the prompt.

        • templateTyperequired — (String)

          The type of prompt template to use.

          Possible values include:
          • "TEXT"
      • version — (String)

        The version of the prompt. When you update a prompt, the version updated is the DRAFT version.

Returns:

  • (AWS.Request)

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