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 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',
  idleSessionTTLInSeconds: 'NUMBER_VALUE',
  instruction: 'STRING_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.

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

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

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

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

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

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

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

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

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

      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"

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.

          • 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 containing the 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"
        • 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' /* required */
    },
    /* 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.

      • agentVersionrequired — (String)

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

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

            • agentVersionrequired — (String)

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

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

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersionrequired — (String)

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

        • 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

Sets up a data source to be added to a knowledge base.

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

Service Reference:

Examples:

Calling the createDataSource operation

var params = {
  dataSourceConfiguration: { /* required */
    type: S3, /* required */
    s3Configuration: {
      bucketArn: 'STRING_VALUE', /* required */
      bucketOwnerAccountId: 'STRING_VALUE',
      inclusionPrefixes: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  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, /* required */
      fixedSizeChunkingConfiguration: {
        maxTokens: 'NUMBER_VALUE', /* required */
        overlapPercentage: 'NUMBER_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 deletion policy for the requested data source

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

      Contains metadata about where the data source is stored.

      • s3Configuration — (map)

        Contains details about the configuration of the S3 object containing the data source.

        • bucketArnrequired — (String)

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

        • bucketOwnerAccountId — (String)

          The account ID for the owner of the S3 bucket.

        • inclusionPrefixes — (Array<String>)

          A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

      • typerequired — (String)

        The type of storage for the data source.

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

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

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 deletion policy for the data source.

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

          Contains details about how the data source is stored.

          • s3Configuration — (map)

            Contains details about the configuration of the S3 object containing the data source.

            • bucketArnrequired — (String)

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

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

          • typerequired — (String)

            The type of storage for the data source.

            Possible values include:
            • "S3"
        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The details of the failure reasons related to 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.

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

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

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 */
    }
  },
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  storageConfiguration: { /* required */
    type: OPENSEARCH_SERVERLESS | PINECONE | REDIS_ENTERPRISE_CLOUD | RDS, /* required */
    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.

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

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

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

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

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.

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.

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.

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

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

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

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

          • 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 containing the 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"
        • 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.

            • agentVersionrequired — (String)

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

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

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersionrequired — (String)

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

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

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

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

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

            • 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 deletion policy for the data source.

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

          Contains details about how the data source is stored.

          • s3Configuration — (map)

            Contains details about the configuration of the S3 object containing the data source.

            • bucketArnrequired — (String)

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

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

          • typerequired — (String)

            The type of storage for the data source.

            Possible values include:
            • "S3"
        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The details of the failure reasons related to 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.

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

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

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.

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

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

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.

          • agentVersionrequired — (String)

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

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

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

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

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.

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.

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',
  idleSessionTTLInSeconds: 'NUMBER_VALUE',
  instruction: 'STRING_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.

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

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

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

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

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

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

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

            • 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
};
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 containing the 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"

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.

          • 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 containing the 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"
        • 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' /* required */
    },
    /* 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.

      • agentVersionrequired — (String)

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

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.

            • agentVersionrequired — (String)

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

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

        • routingConfigurationrequired — (Array<map>)

          Contains details about the routing configuration of the alias.

          • agentVersionrequired — (String)

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

        • 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 configurations for a data source.

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

Service Reference:

Examples:

Calling the updateDataSource operation

var params = {
  dataSourceConfiguration: { /* required */
    type: S3, /* required */
    s3Configuration: {
      bucketArn: 'STRING_VALUE', /* required */
      bucketOwnerAccountId: 'STRING_VALUE',
      inclusionPrefixes: [
        'STRING_VALUE',
        /* more items */
      ]
    }
  },
  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, /* required */
      fixedSizeChunkingConfiguration: {
        maxTokens: 'NUMBER_VALUE', /* required */
        overlapPercentage: 'NUMBER_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 of the updated data source.

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

      Contains details about the storage configuration of the data source.

      • s3Configuration — (map)

        Contains details about the configuration of the S3 object containing the data source.

        • bucketArnrequired — (String)

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

        • bucketOwnerAccountId — (String)

          The account ID for the owner of the S3 bucket.

        • inclusionPrefixes — (Array<String>)

          A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

      • typerequired — (String)

        The type of storage for the data source.

        Possible values include:
        • "S3"
    • 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 to which the data source belongs.

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

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

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 deletion policy for the data source.

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

          Contains details about how the data source is stored.

          • s3Configuration — (map)

            Contains details about the configuration of the S3 object containing the data source.

            • bucketArnrequired — (String)

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

            • bucketOwnerAccountId — (String)

              The account ID for the owner of the S3 bucket.

            • inclusionPrefixes — (Array<String>)

              A list of S3 prefixes that define the object containing the data sources. For more information, see Organizing objects using prefixes.

          • typerequired — (String)

            The type of storage for the data source.

            Possible values include:
            • "S3"
        • dataSourceIdrequired — (String)

          The unique identifier of the data source.

        • description — (String)

          The description of the data source.

        • failureReasons — (Array<String>)

          The details of the failure reasons related to 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.

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

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

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 */
    }
  },
  knowledgeBaseId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  storageConfiguration: { /* required */
    type: OPENSEARCH_SERVERLESS | PINECONE | REDIS_ENTERPRISE_CLOUD | RDS, /* required */
    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.

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

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

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.

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

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