Agents for Amazon Bedrock

2024/07/10 - Agents for Amazon Bedrock - 21 new10 updated api methods

Changes  Add support for contextual grounding check for Guardrails for Amazon Bedrock.

CreatePrompt (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_prompt(
    clientToken='string',
    customerEncryptionKeyArn='string',
    defaultVariant='string',
    description='string',
    name='string',
    tags={
        'string': 'string'
    },
    variants=[
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ]
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type defaultVariant:

string

param defaultVariant:

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

type description:

string

param description:

A description for the prompt.

type name:

string

param name:

[REQUIRED]

A name for the prompt.

type tags:

dict

param tags:

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

  • (string) --

    • (string) --

type variants:

list

param variants:

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

  • (dict) --

    Contains details about a variant of the prompt.

    • inferenceConfiguration (dict) --

      Contains inference configurations for the prompt variant.

      • text (dict) --

        Contains inference configurations for a text prompt.

        • maxTokens (integer) --

          The maximum number of tokens to return in the response.

        • stopSequences (list) --

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

          • (string) --

        • temperature (float) --

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

        • topK (integer) --

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

        • topP (float) --

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

    • modelId (string) --

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

    • name (string) -- [REQUIRED]

      The name of the prompt variant.

    • templateConfiguration (dict) --

      Contains configurations for the prompt template.

      • text (dict) --

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

        • inputVariables (list) --

          An array of the variables in the prompt template.

          • (dict) --

            Contains information about a variable in the prompt.

            • name (string) --

              The name of the variable.

        • text (string) -- [REQUIRED]

          The message for the prompt.

    • templateType (string) -- [REQUIRED]

      The type of prompt template to use.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'defaultVariant': 'string',
    'description': 'string',
    'id': 'string',
    'name': 'string',
    'updatedAt': datetime(2015, 1, 1),
    'variants': [
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ],
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the prompt.

    • createdAt (datetime) --

      The time at which the prompt was created.

    • customerEncryptionKeyArn (string) --

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

    • defaultVariant (string) --

      The name of the default variant for your prompt.

    • description (string) --

      The description of the prompt.

    • id (string) --

      The unique identifier of the prompt.

    • name (string) --

      The name of the prompt.

    • updatedAt (datetime) --

      The time at which the prompt was last updated.

    • variants (list) --

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

      • (dict) --

        Contains details about a variant of the prompt.

        • inferenceConfiguration (dict) --

          Contains inference configurations for the prompt variant.

          • text (dict) --

            Contains inference configurations for a text prompt.

            • maxTokens (integer) --

              The maximum number of tokens to return in the response.

            • stopSequences (list) --

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

              • (string) --

            • temperature (float) --

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

            • topK (integer) --

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

            • topP (float) --

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

        • modelId (string) --

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

        • name (string) --

          The name of the prompt variant.

        • templateConfiguration (dict) --

          Contains configurations for the prompt template.

          • text (dict) --

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

            • inputVariables (list) --

              An array of the variables in the prompt template.

              • (dict) --

                Contains information about a variable in the prompt.

                • name (string) --

                  The name of the variable.

            • text (string) --

              The message for the prompt.

        • templateType (string) --

          The type of prompt template to use.

    • version (string) --

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

GetFlowVersion (new) Link ¶

Retrieves information about a version of a flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_flow_version(
    flowIdentifier='string',
    flowVersion='string'
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

type flowVersion:

string

param flowVersion:

[REQUIRED]

The version of the flow for which to get information.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'definition': {
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {},
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {},
                    'iterator': {},
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {},
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    'description': 'string',
    'executionRoleArn': 'string',
    'id': 'string',
    'name': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • customerEncryptionKeyArn (string) --

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

    • definition (dict) --

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

      • connections (list) --

        An array of connection definitions in the flow.

        • (dict) --

          Contains information about a connection between two nodes in the flow.

          • configuration (dict) --

            The configuration of the connection.

            • conditional (dict) --

              The configuration of a connection originating from a Condition node.

              • condition (string) --

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

            • data (dict) --

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

              • sourceOutput (string) --

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

              • targetInput (string) --

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

          • name (string) --

            A name for the connection that you can reference.

          • source (string) --

            The node that the connection starts at.

          • target (string) --

            The node that the connection ends at.

          • type (string) --

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

      • nodes (list) --

        An array of node definitions in the flow.

        • (dict) --

          Contains configurations about a node in the flow.

          • configuration (dict) --

            Contains configurations for the node.

            • agent (dict) --

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

              • agentAliasArn (string) --

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

            • collector (dict) --

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

            • condition (dict) --

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

              • conditions (list) --

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

                • (dict) --

                  Defines a condition in the condition node.

                  • expression (string) --

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

                  • name (string) --

                    A name for the condition that you can reference.

            • input (dict) --

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

            • iterator (dict) --

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

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

            • knowledgeBase (dict) --

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

              • knowledgeBaseId (string) --

                The unique identifier of the knowledge base to query.

              • modelId (string) --

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

            • lambdaFunction (dict) --

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

              • lambdaArn (string) --

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

            • lex (dict) --

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

              • botAliasArn (string) --

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

              • localeId (string) --

                The Region to invoke the Amazon Lex bot in.

            • output (dict) --

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

            • prompt (dict) --

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

              • sourceConfiguration (dict) --

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

                • inline (dict) --

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration (dict) --

                    Contains inference configurations for the prompt.

                    • text (dict) --

                      Contains inference configurations for a text prompt.

                      • maxTokens (integer) --

                        The maximum number of tokens to return in the response.

                      • stopSequences (list) --

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

                        • (string) --

                      • temperature (float) --

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

                      • topK (integer) --

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

                      • topP (float) --

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

                  • modelId (string) --

                    The unique identifier of the model to run inference with.

                  • templateConfiguration (dict) --

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

                    • text (dict) --

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

                      • inputVariables (list) --

                        An array of the variables in the prompt template.

                        • (dict) --

                          Contains information about a variable in the prompt.

                          • name (string) --

                            The name of the variable.

                      • text (string) --

                        The message for the prompt.

                  • templateType (string) --

                    The type of prompt template.

                • resource (dict) --

                  Contains configurations for a prompt from Prompt management.

                  • promptArn (string) --

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

            • retrieval (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

            • storage (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

          • inputs (list) --

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

            • (dict) --

              Contains configurations for an input to a node.

              • expression (string) --

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

              • name (string) --

                A name for the input that you can reference.

              • type (string) --

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

          • name (string) --

            A name for the node.

          • outputs (list) --

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

            • (dict) --

              Contains configurations for an output from a node.

              • name (string) --

                A name for the output that you can reference.

              • type (string) --

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

          • type (string) --

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

    • description (string) --

      The description of the flow.

    • executionRoleArn (string) --

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

    • id (string) --

      The unique identifier of the flow.

    • name (string) --

      The name of the flow version.

    • status (string) --

      The status of the flow.

    • version (string) --

      The version of the flow for which information was retrieved.

GetPrompt (new) Link ¶

Retrieves information about a prompt or a version of it. For more information, see View information about prompts using Prompt management and View information about a version of your prompt in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_prompt(
    promptIdentifier='string',
    promptVersion='string'
)
type promptIdentifier:

string

param promptIdentifier:

[REQUIRED]

The unique identifier of the prompt.

type promptVersion:

string

param promptVersion:

The version of the prompt about which you want to retrieve information.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'defaultVariant': 'string',
    'description': 'string',
    'id': 'string',
    'name': 'string',
    'updatedAt': datetime(2015, 1, 1),
    'variants': [
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ],
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the prompt.

    • createdAt (datetime) --

      The time at which the prompt was created.

    • customerEncryptionKeyArn (string) --

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

    • defaultVariant (string) --

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

    • description (string) --

      The descriptino of the prompt.

    • id (string) --

      The unique identifier of the prompt.

    • name (string) --

      The name of the prompt.

    • updatedAt (datetime) --

      The time at which the prompt was last updated.

    • variants (list) --

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

      • (dict) --

        Contains details about a variant of the prompt.

        • inferenceConfiguration (dict) --

          Contains inference configurations for the prompt variant.

          • text (dict) --

            Contains inference configurations for a text prompt.

            • maxTokens (integer) --

              The maximum number of tokens to return in the response.

            • stopSequences (list) --

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

              • (string) --

            • temperature (float) --

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

            • topK (integer) --

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

            • topP (float) --

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

        • modelId (string) --

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

        • name (string) --

          The name of the prompt variant.

        • templateConfiguration (dict) --

          Contains configurations for the prompt template.

          • text (dict) --

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

            • inputVariables (list) --

              An array of the variables in the prompt template.

              • (dict) --

                Contains information about a variable in the prompt.

                • name (string) --

                  The name of the variable.

            • text (string) --

              The message for the prompt.

        • templateType (string) --

          The type of prompt template to use.

    • version (string) --

      The version of the prompt.

ListFlowAliases (new) Link ¶

Returns a list of aliases for a flow.

See also: AWS API Documentation

Request Syntax

client.list_flow_aliases(
    flowIdentifier='string',
    maxResults=123,
    nextToken='string'
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow for which aliases are being returned.

type maxResults:

integer

param maxResults:

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.

type nextToken:

string

param nextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'flowAliasSummaries': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'description': 'string',
            'flowId': 'string',
            'id': 'string',
            'name': 'string',
            'routingConfiguration': [
                {
                    'flowVersion': 'string'
                },
            ],
            'updatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • flowAliasSummaries (list) --

      A list, each member of which contains information about a flow alias.

      • (dict) --

        Contains information about an alias of a flow.

        This data type is used in the following API operations:

        • arn (string) --

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

        • createdAt (datetime) --

          The time at which the alias was created.

        • description (string) --

          A description of the alias.

        • flowId (string) --

          The unique identifier of the flow.

        • id (string) --

          The unique identifier of the alias of the flow.

        • name (string) --

          The name of the alias.

        • routingConfiguration (list) --

          A list of configurations about the versions that the alias maps to. Currently, you can only specify one.

          • (dict) --

            Contains information about a version that the alias maps to.

            • flowVersion (string) --

              The version that the alias maps to.

        • updatedAt (datetime) --

          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.

CreatePromptVersion (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_prompt_version(
    clientToken='string',
    description='string',
    promptIdentifier='string',
    tags={
        'string': 'string'
    }
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type description:

string

param description:

A description for the version of the prompt.

type promptIdentifier:

string

param promptIdentifier:

[REQUIRED]

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

type tags:

dict

param tags:

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

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'defaultVariant': 'string',
    'description': 'string',
    'id': 'string',
    'name': 'string',
    'updatedAt': datetime(2015, 1, 1),
    'variants': [
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ],
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

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

    • createdAt (datetime) --

      The time at which the prompt was created.

    • customerEncryptionKeyArn (string) --

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

    • defaultVariant (string) --

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

    • description (string) --

      A description for the prompt version.

    • id (string) --

      The unique identifier of the prompt.

    • name (string) --

      The name of the prompt version.

    • updatedAt (datetime) --

      The time at which the prompt was last updated.

    • variants (list) --

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

      • (dict) --

        Contains details about a variant of the prompt.

        • inferenceConfiguration (dict) --

          Contains inference configurations for the prompt variant.

          • text (dict) --

            Contains inference configurations for a text prompt.

            • maxTokens (integer) --

              The maximum number of tokens to return in the response.

            • stopSequences (list) --

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

              • (string) --

            • temperature (float) --

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

            • topK (integer) --

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

            • topP (float) --

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

        • modelId (string) --

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

        • name (string) --

          The name of the prompt variant.

        • templateConfiguration (dict) --

          Contains configurations for the prompt template.

          • text (dict) --

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

            • inputVariables (list) --

              An array of the variables in the prompt template.

              • (dict) --

                Contains information about a variable in the prompt.

                • name (string) --

                  The name of the variable.

            • text (string) --

              The message for the prompt.

        • templateType (string) --

          The type of prompt template to use.

    • version (string) --

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

CreateFlow (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_flow(
    clientToken='string',
    customerEncryptionKeyArn='string',
    definition={
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {}
                    ,
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {}
                    ,
                    'iterator': {}
                    ,
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {}
                    ,
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    description='string',
    executionRoleArn='string',
    name='string',
    tags={
        'string': 'string'
    }
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type definition:

dict

param definition:

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

  • connections (list) --

    An array of connection definitions in the flow.

    • (dict) --

      Contains information about a connection between two nodes in the flow.

      • configuration (dict) --

        The configuration of the connection.

        • conditional (dict) --

          The configuration of a connection originating from a Condition node.

          • condition (string) -- [REQUIRED]

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

        • data (dict) --

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

          • sourceOutput (string) -- [REQUIRED]

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

          • targetInput (string) -- [REQUIRED]

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

      • name (string) -- [REQUIRED]

        A name for the connection that you can reference.

      • source (string) -- [REQUIRED]

        The node that the connection starts at.

      • target (string) -- [REQUIRED]

        The node that the connection ends at.

      • type (string) -- [REQUIRED]

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

  • nodes (list) --

    An array of node definitions in the flow.

    • (dict) --

      Contains configurations about a node in the flow.

      • configuration (dict) --

        Contains configurations for the node.

        • agent (dict) --

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

          • agentAliasArn (string) -- [REQUIRED]

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

        • collector (dict) --

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

        • condition (dict) --

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

          • conditions (list) -- [REQUIRED]

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

            • (dict) --

              Defines a condition in the condition node.

              • expression (string) --

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

              • name (string) -- [REQUIRED]

                A name for the condition that you can reference.

        • input (dict) --

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

        • iterator (dict) --

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

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

        • knowledgeBase (dict) --

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

          • knowledgeBaseId (string) -- [REQUIRED]

            The unique identifier of the knowledge base to query.

          • modelId (string) --

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

        • lambdaFunction (dict) --

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

          • lambdaArn (string) -- [REQUIRED]

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

        • lex (dict) --

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

          • botAliasArn (string) -- [REQUIRED]

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

          • localeId (string) -- [REQUIRED]

            The Region to invoke the Amazon Lex bot in.

        • output (dict) --

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

        • prompt (dict) --

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

          • sourceConfiguration (dict) -- [REQUIRED]

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

            • inline (dict) --

              Contains configurations for a prompt that is defined inline

              • inferenceConfiguration (dict) --

                Contains inference configurations for the prompt.

                • text (dict) --

                  Contains inference configurations for a text prompt.

                  • maxTokens (integer) --

                    The maximum number of tokens to return in the response.

                  • stopSequences (list) --

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

                    • (string) --

                  • temperature (float) --

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

                  • topK (integer) --

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

                  • topP (float) --

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

              • modelId (string) -- [REQUIRED]

                The unique identifier of the model to run inference with.

              • templateConfiguration (dict) -- [REQUIRED]

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

                • text (dict) --

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

                  • inputVariables (list) --

                    An array of the variables in the prompt template.

                    • (dict) --

                      Contains information about a variable in the prompt.

                      • name (string) --

                        The name of the variable.

                  • text (string) -- [REQUIRED]

                    The message for the prompt.

              • templateType (string) -- [REQUIRED]

                The type of prompt template.

            • resource (dict) --

              Contains configurations for a prompt from Prompt management.

              • promptArn (string) -- [REQUIRED]

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

        • retrieval (dict) --

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

          • serviceConfiguration (dict) -- [REQUIRED]

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

            • s3 (dict) --

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

              • bucketName (string) -- [REQUIRED]

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

        • storage (dict) --

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

          • serviceConfiguration (dict) -- [REQUIRED]

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

            • s3 (dict) --

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

              • bucketName (string) -- [REQUIRED]

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

      • inputs (list) --

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

        • (dict) --

          Contains configurations for an input to a node.

          • expression (string) -- [REQUIRED]

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

          • name (string) -- [REQUIRED]

            A name for the input that you can reference.

          • type (string) -- [REQUIRED]

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

      • name (string) -- [REQUIRED]

        A name for the node.

      • outputs (list) --

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

        • (dict) --

          Contains configurations for an output from a node.

          • name (string) -- [REQUIRED]

            A name for the output that you can reference.

          • type (string) -- [REQUIRED]

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

      • type (string) -- [REQUIRED]

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

type description:

string

param description:

A description for the flow.

type executionRoleArn:

string

param executionRoleArn:

[REQUIRED]

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

type name:

string

param name:

[REQUIRED]

A name for the flow.

type tags:

dict

param tags:

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

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'definition': {
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {},
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {},
                    'iterator': {},
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {},
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    'description': 'string',
    'executionRoleArn': 'string',
    'id': 'string',
    'name': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
    'updatedAt': datetime(2015, 1, 1),
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • customerEncryptionKeyArn (string) --

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

    • definition (dict) --

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

      • connections (list) --

        An array of connection definitions in the flow.

        • (dict) --

          Contains information about a connection between two nodes in the flow.

          • configuration (dict) --

            The configuration of the connection.

            • conditional (dict) --

              The configuration of a connection originating from a Condition node.

              • condition (string) --

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

            • data (dict) --

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

              • sourceOutput (string) --

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

              • targetInput (string) --

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

          • name (string) --

            A name for the connection that you can reference.

          • source (string) --

            The node that the connection starts at.

          • target (string) --

            The node that the connection ends at.

          • type (string) --

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

      • nodes (list) --

        An array of node definitions in the flow.

        • (dict) --

          Contains configurations about a node in the flow.

          • configuration (dict) --

            Contains configurations for the node.

            • agent (dict) --

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

              • agentAliasArn (string) --

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

            • collector (dict) --

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

            • condition (dict) --

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

              • conditions (list) --

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

                • (dict) --

                  Defines a condition in the condition node.

                  • expression (string) --

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

                  • name (string) --

                    A name for the condition that you can reference.

            • input (dict) --

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

            • iterator (dict) --

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

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

            • knowledgeBase (dict) --

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

              • knowledgeBaseId (string) --

                The unique identifier of the knowledge base to query.

              • modelId (string) --

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

            • lambdaFunction (dict) --

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

              • lambdaArn (string) --

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

            • lex (dict) --

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

              • botAliasArn (string) --

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

              • localeId (string) --

                The Region to invoke the Amazon Lex bot in.

            • output (dict) --

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

            • prompt (dict) --

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

              • sourceConfiguration (dict) --

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

                • inline (dict) --

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration (dict) --

                    Contains inference configurations for the prompt.

                    • text (dict) --

                      Contains inference configurations for a text prompt.

                      • maxTokens (integer) --

                        The maximum number of tokens to return in the response.

                      • stopSequences (list) --

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

                        • (string) --

                      • temperature (float) --

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

                      • topK (integer) --

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

                      • topP (float) --

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

                  • modelId (string) --

                    The unique identifier of the model to run inference with.

                  • templateConfiguration (dict) --

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

                    • text (dict) --

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

                      • inputVariables (list) --

                        An array of the variables in the prompt template.

                        • (dict) --

                          Contains information about a variable in the prompt.

                          • name (string) --

                            The name of the variable.

                      • text (string) --

                        The message for the prompt.

                  • templateType (string) --

                    The type of prompt template.

                • resource (dict) --

                  Contains configurations for a prompt from Prompt management.

                  • promptArn (string) --

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

            • retrieval (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

            • storage (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

          • inputs (list) --

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

            • (dict) --

              Contains configurations for an input to a node.

              • expression (string) --

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

              • name (string) --

                A name for the input that you can reference.

              • type (string) --

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

          • name (string) --

            A name for the node.

          • outputs (list) --

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

            • (dict) --

              Contains configurations for an output from a node.

              • name (string) --

                A name for the output that you can reference.

              • type (string) --

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

          • type (string) --

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

    • description (string) --

      The description of the flow.

    • executionRoleArn (string) --

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

    • id (string) --

      The unique identifier of the flow.

    • name (string) --

      The name of the flow.

    • status (string) --

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

    • updatedAt (datetime) --

      The time at which the flow was last updated.

    • version (string) --

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

ListPrompts (new) Link ¶

Returns a list of prompts from the Prompt management tool and information about each prompt. For more information, see View information about prompts using Prompt management in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_prompts(
    maxResults=123,
    nextToken='string',
    promptIdentifier='string'
)
type maxResults:

integer

param maxResults:

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.

type nextToken:

string

param nextToken:

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.

type promptIdentifier:

string

param promptIdentifier:

The unique identifier of the prompt.

rtype:

dict

returns:

Response Syntax

{
    'nextToken': 'string',
    'promptSummaries': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'description': 'string',
            'id': 'string',
            'name': 'string',
            'updatedAt': datetime(2015, 1, 1),
            'version': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

    • promptSummaries (list) --

      A list, each member of which contains information about a prompt using Prompt management.

      • (dict) --

        Contains information about a prompt in your Prompt management tool.

        This data type is used in the following API operations:

        • arn (string) --

          The Amazon Resource Name (ARN) of the prompt.

        • createdAt (datetime) --

          The time at which the prompt was created.

        • description (string) --

          The description of the prompt.

        • id (string) --

          The unique identifier of the prompt.

        • name (string) --

          The name of the prompt.

        • updatedAt (datetime) --

          The time at which the prompt was last updated.

        • version (string) --

          The version of the prompt that this summary applies to.

UpdateFlow (new) Link ¶

Modifies a flow. Include both fields that you want to keep and fields that you want to change. For more information, see How it works and Create a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.update_flow(
    customerEncryptionKeyArn='string',
    definition={
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {}
                    ,
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {}
                    ,
                    'iterator': {}
                    ,
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {}
                    ,
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    description='string',
    executionRoleArn='string',
    flowIdentifier='string',
    name='string'
)
type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type definition:

dict

param definition:

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

  • connections (list) --

    An array of connection definitions in the flow.

    • (dict) --

      Contains information about a connection between two nodes in the flow.

      • configuration (dict) --

        The configuration of the connection.

        • conditional (dict) --

          The configuration of a connection originating from a Condition node.

          • condition (string) -- [REQUIRED]

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

        • data (dict) --

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

          • sourceOutput (string) -- [REQUIRED]

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

          • targetInput (string) -- [REQUIRED]

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

      • name (string) -- [REQUIRED]

        A name for the connection that you can reference.

      • source (string) -- [REQUIRED]

        The node that the connection starts at.

      • target (string) -- [REQUIRED]

        The node that the connection ends at.

      • type (string) -- [REQUIRED]

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

  • nodes (list) --

    An array of node definitions in the flow.

    • (dict) --

      Contains configurations about a node in the flow.

      • configuration (dict) --

        Contains configurations for the node.

        • agent (dict) --

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

          • agentAliasArn (string) -- [REQUIRED]

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

        • collector (dict) --

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

        • condition (dict) --

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

          • conditions (list) -- [REQUIRED]

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

            • (dict) --

              Defines a condition in the condition node.

              • expression (string) --

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

              • name (string) -- [REQUIRED]

                A name for the condition that you can reference.

        • input (dict) --

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

        • iterator (dict) --

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

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

        • knowledgeBase (dict) --

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

          • knowledgeBaseId (string) -- [REQUIRED]

            The unique identifier of the knowledge base to query.

          • modelId (string) --

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

        • lambdaFunction (dict) --

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

          • lambdaArn (string) -- [REQUIRED]

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

        • lex (dict) --

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

          • botAliasArn (string) -- [REQUIRED]

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

          • localeId (string) -- [REQUIRED]

            The Region to invoke the Amazon Lex bot in.

        • output (dict) --

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

        • prompt (dict) --

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

          • sourceConfiguration (dict) -- [REQUIRED]

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

            • inline (dict) --

              Contains configurations for a prompt that is defined inline

              • inferenceConfiguration (dict) --

                Contains inference configurations for the prompt.

                • text (dict) --

                  Contains inference configurations for a text prompt.

                  • maxTokens (integer) --

                    The maximum number of tokens to return in the response.

                  • stopSequences (list) --

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

                    • (string) --

                  • temperature (float) --

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

                  • topK (integer) --

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

                  • topP (float) --

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

              • modelId (string) -- [REQUIRED]

                The unique identifier of the model to run inference with.

              • templateConfiguration (dict) -- [REQUIRED]

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

                • text (dict) --

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

                  • inputVariables (list) --

                    An array of the variables in the prompt template.

                    • (dict) --

                      Contains information about a variable in the prompt.

                      • name (string) --

                        The name of the variable.

                  • text (string) -- [REQUIRED]

                    The message for the prompt.

              • templateType (string) -- [REQUIRED]

                The type of prompt template.

            • resource (dict) --

              Contains configurations for a prompt from Prompt management.

              • promptArn (string) -- [REQUIRED]

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

        • retrieval (dict) --

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

          • serviceConfiguration (dict) -- [REQUIRED]

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

            • s3 (dict) --

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

              • bucketName (string) -- [REQUIRED]

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

        • storage (dict) --

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

          • serviceConfiguration (dict) -- [REQUIRED]

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

            • s3 (dict) --

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

              • bucketName (string) -- [REQUIRED]

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

      • inputs (list) --

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

        • (dict) --

          Contains configurations for an input to a node.

          • expression (string) -- [REQUIRED]

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

          • name (string) -- [REQUIRED]

            A name for the input that you can reference.

          • type (string) -- [REQUIRED]

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

      • name (string) -- [REQUIRED]

        A name for the node.

      • outputs (list) --

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

        • (dict) --

          Contains configurations for an output from a node.

          • name (string) -- [REQUIRED]

            A name for the output that you can reference.

          • type (string) -- [REQUIRED]

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

      • type (string) -- [REQUIRED]

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

type description:

string

param description:

A description for the flow.

type executionRoleArn:

string

param executionRoleArn:

[REQUIRED]

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

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

type name:

string

param name:

[REQUIRED]

A name for the flow.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'definition': {
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {},
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {},
                    'iterator': {},
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {},
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    'description': 'string',
    'executionRoleArn': 'string',
    'id': 'string',
    'name': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
    'updatedAt': datetime(2015, 1, 1),
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • customerEncryptionKeyArn (string) --

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

    • definition (dict) --

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

      • connections (list) --

        An array of connection definitions in the flow.

        • (dict) --

          Contains information about a connection between two nodes in the flow.

          • configuration (dict) --

            The configuration of the connection.

            • conditional (dict) --

              The configuration of a connection originating from a Condition node.

              • condition (string) --

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

            • data (dict) --

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

              • sourceOutput (string) --

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

              • targetInput (string) --

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

          • name (string) --

            A name for the connection that you can reference.

          • source (string) --

            The node that the connection starts at.

          • target (string) --

            The node that the connection ends at.

          • type (string) --

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

      • nodes (list) --

        An array of node definitions in the flow.

        • (dict) --

          Contains configurations about a node in the flow.

          • configuration (dict) --

            Contains configurations for the node.

            • agent (dict) --

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

              • agentAliasArn (string) --

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

            • collector (dict) --

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

            • condition (dict) --

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

              • conditions (list) --

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

                • (dict) --

                  Defines a condition in the condition node.

                  • expression (string) --

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

                  • name (string) --

                    A name for the condition that you can reference.

            • input (dict) --

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

            • iterator (dict) --

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

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

            • knowledgeBase (dict) --

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

              • knowledgeBaseId (string) --

                The unique identifier of the knowledge base to query.

              • modelId (string) --

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

            • lambdaFunction (dict) --

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

              • lambdaArn (string) --

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

            • lex (dict) --

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

              • botAliasArn (string) --

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

              • localeId (string) --

                The Region to invoke the Amazon Lex bot in.

            • output (dict) --

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

            • prompt (dict) --

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

              • sourceConfiguration (dict) --

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

                • inline (dict) --

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration (dict) --

                    Contains inference configurations for the prompt.

                    • text (dict) --

                      Contains inference configurations for a text prompt.

                      • maxTokens (integer) --

                        The maximum number of tokens to return in the response.

                      • stopSequences (list) --

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

                        • (string) --

                      • temperature (float) --

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

                      • topK (integer) --

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

                      • topP (float) --

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

                  • modelId (string) --

                    The unique identifier of the model to run inference with.

                  • templateConfiguration (dict) --

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

                    • text (dict) --

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

                      • inputVariables (list) --

                        An array of the variables in the prompt template.

                        • (dict) --

                          Contains information about a variable in the prompt.

                          • name (string) --

                            The name of the variable.

                      • text (string) --

                        The message for the prompt.

                  • templateType (string) --

                    The type of prompt template.

                • resource (dict) --

                  Contains configurations for a prompt from Prompt management.

                  • promptArn (string) --

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

            • retrieval (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

            • storage (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

          • inputs (list) --

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

            • (dict) --

              Contains configurations for an input to a node.

              • expression (string) --

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

              • name (string) --

                A name for the input that you can reference.

              • type (string) --

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

          • name (string) --

            A name for the node.

          • outputs (list) --

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

            • (dict) --

              Contains configurations for an output from a node.

              • name (string) --

                A name for the output that you can reference.

              • type (string) --

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

          • type (string) --

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

    • description (string) --

      The description of the flow.

    • executionRoleArn (string) --

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

    • id (string) --

      The unique identifier of the flow.

    • name (string) --

      The name of the flow.

    • status (string) --

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

    • updatedAt (datetime) --

      The time at which the flow was last updated.

    • version (string) --

      The version of the flow. When you update a flow, the version updated is the DRAFT version.

CreateFlowAlias (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_flow_alias(
    clientToken='string',
    description='string',
    flowIdentifier='string',
    name='string',
    routingConfiguration=[
        {
            'flowVersion': 'string'
        },
    ],
    tags={
        'string': 'string'
    }
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type description:

string

param description:

A description for the alias.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

type name:

string

param name:

[REQUIRED]

A name for the alias.

type routingConfiguration:

list

param routingConfiguration:

[REQUIRED]

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

  • (dict) --

    Contains information about a version that the alias maps to.

    • flowVersion (string) --

      The version that the alias maps to.

type tags:

dict

param tags:

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

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'description': 'string',
    'flowId': 'string',
    'id': 'string',
    'name': 'string',
    'routingConfiguration': [
        {
            'flowVersion': 'string'
        },
    ],
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the alias.

    • createdAt (datetime) --

      The time at which the alias was created.

    • description (string) --

      The description of the alias.

    • flowId (string) --

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

    • id (string) --

      The unique identifier of the alias.

    • name (string) --

      The name of the alias.

    • routingConfiguration (list) --

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

      • (dict) --

        Contains information about a version that the alias maps to.

        • flowVersion (string) --

          The version that the alias maps to.

    • updatedAt (datetime) --

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

ListFlowVersions (new) Link ¶

Returns a list of information about each flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_flow_versions(
    flowIdentifier='string',
    maxResults=123,
    nextToken='string'
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

type maxResults:

integer

param maxResults:

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.

type nextToken:

string

param nextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'flowVersionSummaries': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'id': 'string',
            'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
            'version': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • flowVersionSummaries (list) --

      A list, each member of which contains information about a flow.

      • (dict) --

        Contains information about the flow version.

        This data type is used in the following API operations:

        • arn (string) --

          The Amazon Resource Name (ARN) of the flow that the version belongs to.

        • createdAt (datetime) --

          The time at the flow version was created.

        • id (string) --

          The unique identifier of the flow.

        • status (string) --

          The status of the flow.

        • version (string) --

          The version of the flow.

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

DeleteFlowAlias (new) Link ¶

Deletes an alias of a flow.

See also: AWS API Documentation

Request Syntax

client.delete_flow_alias(
    aliasIdentifier='string',
    flowIdentifier='string'
)
type aliasIdentifier:

string

param aliasIdentifier:

[REQUIRED]

The unique identifier of the alias to be deleted.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'flowId': 'string',
    'id': 'string'
}

Response Structure

  • (dict) --

    • flowId (string) --

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

    • id (string) --

      The unique identifier of the flow.

DeleteFlow (new) Link ¶

Deletes a flow.

See also: AWS API Documentation

Request Syntax

client.delete_flow(
    flowIdentifier='string',
    skipResourceInUseCheck=True|False
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

type skipResourceInUseCheck:

boolean

param skipResourceInUseCheck:

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.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the flow.

GetFlowAlias (new) Link ¶

Retrieves information about a flow. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_flow_alias(
    aliasIdentifier='string',
    flowIdentifier='string'
)
type aliasIdentifier:

string

param aliasIdentifier:

[REQUIRED]

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

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'description': 'string',
    'flowId': 'string',
    'id': 'string',
    'name': 'string',
    'routingConfiguration': [
        {
            'flowVersion': 'string'
        },
    ],
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • description (string) --

      The description of the flow.

    • flowId (string) --

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

    • id (string) --

      The unique identifier of the alias of the flow.

    • name (string) --

      The name of the flow alias.

    • routingConfiguration (list) --

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

      • (dict) --

        Contains information about a version that the alias maps to.

        • flowVersion (string) --

          The version that the alias maps to.

    • updatedAt (datetime) --

      The time at which the flow alias was last updated.

ListFlows (new) Link ¶

Returns a list of flows and information about each flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_flows(
    maxResults=123,
    nextToken='string'
)
type maxResults:

integer

param maxResults:

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.

type nextToken:

string

param nextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'flowSummaries': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'description': 'string',
            'id': 'string',
            'name': 'string',
            'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
            'updatedAt': datetime(2015, 1, 1),
            'version': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • flowSummaries (list) --

      A list, each member of which contains information about a flow.

      • (dict) --

        Contains the definition of a flow.

        • arn (string) --

          The Amazon Resource Name (ARN) of the flow.

        • createdAt (datetime) --

          The time at which the flow was created.

        • description (string) --

          A description of the flow.

        • id (string) --

          The unique identifier of the flow.

        • name (string) --

          The name of the flow.

        • status (string) --

          The status of the flow. The following statuses are possible:

          • NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the DRAFT version won't contain the latest changes for testing. Send a PrepareFlow request to package the latest changes into the DRAFT version.

          • Preparing – The flow is being prepared so that the DRAFT version contains the latest changes for testing.

          • Prepared – The flow is prepared and the DRAFT version contains the latest changes for testing.

          • Failed – The last API operation that you invoked on the flow failed. Send a GetFlow request and check the error message in the validations field.

        • updatedAt (datetime) --

          The time at which the flow was last updated.

        • version (string) --

          The latest version of the flow.

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

UpdatePrompt (new) Link ¶

Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see Prompt management in Amazon Bedrock and Edit prompts in your prompt library in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.update_prompt(
    customerEncryptionKeyArn='string',
    defaultVariant='string',
    description='string',
    name='string',
    promptIdentifier='string',
    variants=[
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ]
)
type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type defaultVariant:

string

param defaultVariant:

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

type description:

string

param description:

A description for the prompt.

type name:

string

param name:

[REQUIRED]

A name for the prompt.

type promptIdentifier:

string

param promptIdentifier:

[REQUIRED]

The unique identifier of the prompt.

type variants:

list

param variants:

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

  • (dict) --

    Contains details about a variant of the prompt.

    • inferenceConfiguration (dict) --

      Contains inference configurations for the prompt variant.

      • text (dict) --

        Contains inference configurations for a text prompt.

        • maxTokens (integer) --

          The maximum number of tokens to return in the response.

        • stopSequences (list) --

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

          • (string) --

        • temperature (float) --

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

        • topK (integer) --

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

        • topP (float) --

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

    • modelId (string) --

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

    • name (string) -- [REQUIRED]

      The name of the prompt variant.

    • templateConfiguration (dict) --

      Contains configurations for the prompt template.

      • text (dict) --

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

        • inputVariables (list) --

          An array of the variables in the prompt template.

          • (dict) --

            Contains information about a variable in the prompt.

            • name (string) --

              The name of the variable.

        • text (string) -- [REQUIRED]

          The message for the prompt.

    • templateType (string) -- [REQUIRED]

      The type of prompt template to use.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'defaultVariant': 'string',
    'description': 'string',
    'id': 'string',
    'name': 'string',
    'updatedAt': datetime(2015, 1, 1),
    'variants': [
        {
            'inferenceConfiguration': {
                'text': {
                    'maxTokens': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                }
            },
            'modelId': 'string',
            'name': 'string',
            'templateConfiguration': {
                'text': {
                    'inputVariables': [
                        {
                            'name': 'string'
                        },
                    ],
                    'text': 'string'
                }
            },
            'templateType': 'TEXT'
        },
    ],
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the prompt.

    • createdAt (datetime) --

      The time at which the prompt was created.

    • customerEncryptionKeyArn (string) --

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

    • defaultVariant (string) --

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

    • description (string) --

      The description of the prompt.

    • id (string) --

      The unique identifier of the prompt.

    • name (string) --

      The name of the prompt.

    • updatedAt (datetime) --

      The time at which the prompt was last updated.

    • variants (list) --

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

      • (dict) --

        Contains details about a variant of the prompt.

        • inferenceConfiguration (dict) --

          Contains inference configurations for the prompt variant.

          • text (dict) --

            Contains inference configurations for a text prompt.

            • maxTokens (integer) --

              The maximum number of tokens to return in the response.

            • stopSequences (list) --

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

              • (string) --

            • temperature (float) --

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

            • topK (integer) --

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

            • topP (float) --

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

        • modelId (string) --

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

        • name (string) --

          The name of the prompt variant.

        • templateConfiguration (dict) --

          Contains configurations for the prompt template.

          • text (dict) --

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

            • inputVariables (list) --

              An array of the variables in the prompt template.

              • (dict) --

                Contains information about a variable in the prompt.

                • name (string) --

                  The name of the variable.

            • text (string) --

              The message for the prompt.

        • templateType (string) --

          The type of prompt template to use.

    • version (string) --

      The version of the prompt. When you update a prompt, the version updated is the DRAFT version.

GetFlow (new) Link ¶

Retrieves information about a flow. For more information, see Manage a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_flow(
    flowIdentifier='string'
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'definition': {
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {},
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {},
                    'iterator': {},
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {},
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    'description': 'string',
    'executionRoleArn': 'string',
    'id': 'string',
    'name': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
    'updatedAt': datetime(2015, 1, 1),
    'validations': [
        {
            'message': 'string',
            'severity': 'Warning'|'Error'
        },
    ],
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • customerEncryptionKeyArn (string) --

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

    • definition (dict) --

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

      • connections (list) --

        An array of connection definitions in the flow.

        • (dict) --

          Contains information about a connection between two nodes in the flow.

          • configuration (dict) --

            The configuration of the connection.

            • conditional (dict) --

              The configuration of a connection originating from a Condition node.

              • condition (string) --

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

            • data (dict) --

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

              • sourceOutput (string) --

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

              • targetInput (string) --

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

          • name (string) --

            A name for the connection that you can reference.

          • source (string) --

            The node that the connection starts at.

          • target (string) --

            The node that the connection ends at.

          • type (string) --

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

      • nodes (list) --

        An array of node definitions in the flow.

        • (dict) --

          Contains configurations about a node in the flow.

          • configuration (dict) --

            Contains configurations for the node.

            • agent (dict) --

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

              • agentAliasArn (string) --

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

            • collector (dict) --

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

            • condition (dict) --

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

              • conditions (list) --

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

                • (dict) --

                  Defines a condition in the condition node.

                  • expression (string) --

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

                  • name (string) --

                    A name for the condition that you can reference.

            • input (dict) --

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

            • iterator (dict) --

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

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

            • knowledgeBase (dict) --

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

              • knowledgeBaseId (string) --

                The unique identifier of the knowledge base to query.

              • modelId (string) --

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

            • lambdaFunction (dict) --

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

              • lambdaArn (string) --

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

            • lex (dict) --

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

              • botAliasArn (string) --

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

              • localeId (string) --

                The Region to invoke the Amazon Lex bot in.

            • output (dict) --

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

            • prompt (dict) --

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

              • sourceConfiguration (dict) --

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

                • inline (dict) --

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration (dict) --

                    Contains inference configurations for the prompt.

                    • text (dict) --

                      Contains inference configurations for a text prompt.

                      • maxTokens (integer) --

                        The maximum number of tokens to return in the response.

                      • stopSequences (list) --

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

                        • (string) --

                      • temperature (float) --

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

                      • topK (integer) --

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

                      • topP (float) --

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

                  • modelId (string) --

                    The unique identifier of the model to run inference with.

                  • templateConfiguration (dict) --

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

                    • text (dict) --

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

                      • inputVariables (list) --

                        An array of the variables in the prompt template.

                        • (dict) --

                          Contains information about a variable in the prompt.

                          • name (string) --

                            The name of the variable.

                      • text (string) --

                        The message for the prompt.

                  • templateType (string) --

                    The type of prompt template.

                • resource (dict) --

                  Contains configurations for a prompt from Prompt management.

                  • promptArn (string) --

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

            • retrieval (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

            • storage (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

          • inputs (list) --

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

            • (dict) --

              Contains configurations for an input to a node.

              • expression (string) --

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

              • name (string) --

                A name for the input that you can reference.

              • type (string) --

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

          • name (string) --

            A name for the node.

          • outputs (list) --

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

            • (dict) --

              Contains configurations for an output from a node.

              • name (string) --

                A name for the output that you can reference.

              • type (string) --

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

          • type (string) --

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

    • description (string) --

      The description of the flow.

    • executionRoleArn (string) --

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

    • id (string) --

      The unique identifier of the flow.

    • name (string) --

      The name of the flow.

    • status (string) --

      The status of the flow. The following statuses are possible:

      • NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the DRAFT version won't contain the latest changes for testing. Send a PrepareFlow request to package the latest changes into the DRAFT version.

      • Preparing – The flow is being prepared so that the DRAFT version contains the latest changes for testing.

      • Prepared – The flow is prepared and the DRAFT version contains the latest changes for testing.

      • Failed – The last API operation that you invoked on the flow failed. Send a GetFlow request and check the error message in the validations field.

    • updatedAt (datetime) --

      The time at which the flow was last updated.

    • validations (list) --

      A list of validation error messages related to the last failed operation on the flow.

      • (dict) --

        Contains information about validation of the flow.

        This data type is used in the following API operations:

        • message (string) --

          A message describing the validation error.

        • severity (string) --

          The severity of the issue described in the message.

    • version (string) --

      The version of the flow for which information was retrieved.

DeleteFlowVersion (new) Link ¶

Deletes a version of a flow.

See also: AWS API Documentation

Request Syntax

client.delete_flow_version(
    flowIdentifier='string',
    flowVersion='string',
    skipResourceInUseCheck=True|False
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

type flowVersion:

string

param flowVersion:

[REQUIRED]

The version of the flow that you want to delete.

type skipResourceInUseCheck:

boolean

param skipResourceInUseCheck:

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.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'version': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the flow.

    • version (string) --

      The version of the flow being deleted.

CreateFlowVersion (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.create_flow_version(
    clientToken='string',
    description='string',
    flowIdentifier='string'
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type description:

string

param description:

A description of the version of the flow.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customerEncryptionKeyArn': 'string',
    'definition': {
        'connections': [
            {
                'configuration': {
                    'conditional': {
                        'condition': 'string'
                    },
                    'data': {
                        'sourceOutput': 'string',
                        'targetInput': 'string'
                    }
                },
                'name': 'string',
                'source': 'string',
                'target': 'string',
                'type': 'Data'|'Conditional'
            },
        ],
        'nodes': [
            {
                'configuration': {
                    'agent': {
                        'agentAliasArn': 'string'
                    },
                    'collector': {},
                    'condition': {
                        'conditions': [
                            {
                                'expression': 'string',
                                'name': 'string'
                            },
                        ]
                    },
                    'input': {},
                    'iterator': {},
                    'knowledgeBase': {
                        'knowledgeBaseId': 'string',
                        'modelId': 'string'
                    },
                    'lambdaFunction': {
                        'lambdaArn': 'string'
                    },
                    'lex': {
                        'botAliasArn': 'string',
                        'localeId': 'string'
                    },
                    'output': {},
                    'prompt': {
                        'sourceConfiguration': {
                            'inline': {
                                'inferenceConfiguration': {
                                    'text': {
                                        'maxTokens': 123,
                                        'stopSequences': [
                                            'string',
                                        ],
                                        'temperature': ...,
                                        'topK': 123,
                                        'topP': ...
                                    }
                                },
                                'modelId': 'string',
                                'templateConfiguration': {
                                    'text': {
                                        'inputVariables': [
                                            {
                                                'name': 'string'
                                            },
                                        ],
                                        'text': 'string'
                                    }
                                },
                                'templateType': 'TEXT'
                            },
                            'resource': {
                                'promptArn': 'string'
                            }
                        }
                    },
                    'retrieval': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    },
                    'storage': {
                        'serviceConfiguration': {
                            's3': {
                                'bucketName': 'string'
                            }
                        }
                    }
                },
                'inputs': [
                    {
                        'expression': 'string',
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'name': 'string',
                'outputs': [
                    {
                        'name': 'string',
                        'type': 'String'|'Number'|'Boolean'|'Object'|'Array'
                    },
                ],
                'type': 'Input'|'Output'|'KnowledgeBase'|'Condition'|'Lex'|'Prompt'|'LambdaFunction'|'Storage'|'Agent'|'Retrieval'|'Iterator'|'Collector'
            },
        ]
    },
    'description': 'string',
    'executionRoleArn': 'string',
    'id': 'string',
    'name': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared',
    'version': 'string'
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • customerEncryptionKeyArn (string) --

      The KMS key that the flow is encrypted with.

    • definition (dict) --

      A definition of the nodes and connections in the flow.

      • connections (list) --

        An array of connection definitions in the flow.

        • (dict) --

          Contains information about a connection between two nodes in the flow.

          • configuration (dict) --

            The configuration of the connection.

            • conditional (dict) --

              The configuration of a connection originating from a Condition node.

              • condition (string) --

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

            • data (dict) --

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

              • sourceOutput (string) --

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

              • targetInput (string) --

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

          • name (string) --

            A name for the connection that you can reference.

          • source (string) --

            The node that the connection starts at.

          • target (string) --

            The node that the connection ends at.

          • type (string) --

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

      • nodes (list) --

        An array of node definitions in the flow.

        • (dict) --

          Contains configurations about a node in the flow.

          • configuration (dict) --

            Contains configurations for the node.

            • agent (dict) --

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

              • agentAliasArn (string) --

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

            • collector (dict) --

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

            • condition (dict) --

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

              • conditions (list) --

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

                • (dict) --

                  Defines a condition in the condition node.

                  • expression (string) --

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

                  • name (string) --

                    A name for the condition that you can reference.

            • input (dict) --

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

            • iterator (dict) --

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

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

            • knowledgeBase (dict) --

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

              • knowledgeBaseId (string) --

                The unique identifier of the knowledge base to query.

              • modelId (string) --

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

            • lambdaFunction (dict) --

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

              • lambdaArn (string) --

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

            • lex (dict) --

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

              • botAliasArn (string) --

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

              • localeId (string) --

                The Region to invoke the Amazon Lex bot in.

            • output (dict) --

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

            • prompt (dict) --

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

              • sourceConfiguration (dict) --

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

                • inline (dict) --

                  Contains configurations for a prompt that is defined inline

                  • inferenceConfiguration (dict) --

                    Contains inference configurations for the prompt.

                    • text (dict) --

                      Contains inference configurations for a text prompt.

                      • maxTokens (integer) --

                        The maximum number of tokens to return in the response.

                      • stopSequences (list) --

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

                        • (string) --

                      • temperature (float) --

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

                      • topK (integer) --

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

                      • topP (float) --

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

                  • modelId (string) --

                    The unique identifier of the model to run inference with.

                  • templateConfiguration (dict) --

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

                    • text (dict) --

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

                      • inputVariables (list) --

                        An array of the variables in the prompt template.

                        • (dict) --

                          Contains information about a variable in the prompt.

                          • name (string) --

                            The name of the variable.

                      • text (string) --

                        The message for the prompt.

                  • templateType (string) --

                    The type of prompt template.

                • resource (dict) --

                  Contains configurations for a prompt from Prompt management.

                  • promptArn (string) --

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

            • retrieval (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

            • storage (dict) --

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

              • serviceConfiguration (dict) --

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

                • s3 (dict) --

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

                  • bucketName (string) --

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

          • inputs (list) --

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

            • (dict) --

              Contains configurations for an input to a node.

              • expression (string) --

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

              • name (string) --

                A name for the input that you can reference.

              • type (string) --

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

          • name (string) --

            A name for the node.

          • outputs (list) --

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

            • (dict) --

              Contains configurations for an output from a node.

              • name (string) --

                A name for the output that you can reference.

              • type (string) --

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

          • type (string) --

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

    • description (string) --

      The description of the flow version.

    • executionRoleArn (string) --

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

    • id (string) --

      The unique identifier of the flow.

    • name (string) --

      The name of the flow version.

    • status (string) --

      The status of the flow.

    • version (string) --

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

UpdateFlowAlias (new) Link ¶

Modifies the alias of a flow. Include both fields that you want to keep and ones that you want to change. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.update_flow_alias(
    aliasIdentifier='string',
    description='string',
    flowIdentifier='string',
    name='string',
    routingConfiguration=[
        {
            'flowVersion': 'string'
        },
    ]
)
type aliasIdentifier:

string

param aliasIdentifier:

[REQUIRED]

The unique identifier of the alias.

type description:

string

param description:

A description for the flow alias.

type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

type name:

string

param name:

[REQUIRED]

The name of the flow alias.

type routingConfiguration:

list

param routingConfiguration:

[REQUIRED]

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

  • (dict) --

    Contains information about a version that the alias maps to.

    • flowVersion (string) --

      The version that the alias maps to.

rtype:

dict

returns:

Response Syntax

{
    'arn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'description': 'string',
    'flowId': 'string',
    'id': 'string',
    'name': 'string',
    'routingConfiguration': [
        {
            'flowVersion': 'string'
        },
    ],
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • arn (string) --

      The Amazon Resource Name (ARN) of the flow.

    • createdAt (datetime) --

      The time at which the flow was created.

    • description (string) --

      The description of the flow.

    • flowId (string) --

      The unique identifier of the flow.

    • id (string) --

      The unique identifier of the alias.

    • name (string) --

      The name of the flow alias.

    • routingConfiguration (list) --

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

      • (dict) --

        Contains information about a version that the alias maps to.

        • flowVersion (string) --

          The version that the alias maps to.

    • updatedAt (datetime) --

      The time at which the flow alias was last updated.

PrepareFlow (new) Link ¶

Prepares the DRAFT version of a flow so that it can be invoked. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.prepare_flow(
    flowIdentifier='string'
)
type flowIdentifier:

string

param flowIdentifier:

[REQUIRED]

The unique identifier of the flow.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'status': 'Failed'|'Prepared'|'Preparing'|'NotPrepared'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the flow.

    • status (string) --

      The status of the flow. When you submit this request, the status will be NotPrepared. If preparation succeeds, the status becomes Prepared. If it fails, the status becomes FAILED.

DeletePrompt (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.delete_prompt(
    promptIdentifier='string',
    promptVersion='string'
)
type promptIdentifier:

string

param promptIdentifier:

[REQUIRED]

The unique identifier of the prompt.

type promptVersion:

string

param promptVersion:

The version of the prompt to delete.

rtype:

dict

returns:

Response Syntax

{
    'id': 'string',
    'version': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The unique identifier of the prompt that was deleted.

    • version (string) --

      The version of the prompt that was deleted.

CreateAgent (updated) Link ¶
Changes (request, response)
Request
{'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                         'storageDays': 'integer'}}
Response
{'agent': {'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                                   'storageDays': 'integer'}}}

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

  • Specify the following fields for security purposes.

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

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

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

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

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

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

See also: AWS API Documentation

Request Syntax

client.create_agent(
    agentName='string',
    agentResourceRoleArn='string',
    clientToken='string',
    customerEncryptionKeyArn='string',
    description='string',
    foundationModel='string',
    guardrailConfiguration={
        'guardrailIdentifier': 'string',
        'guardrailVersion': 'string'
    },
    idleSessionTTLInSeconds=123,
    instruction='string',
    memoryConfiguration={
        'enabledMemoryTypes': [
            'SESSION_SUMMARY',
        ],
        'storageDays': 123
    },
    promptOverrideConfiguration={
        'overrideLambda': 'string',
        'promptConfigurations': [
            {
                'basePromptTemplate': 'string',
                'inferenceConfiguration': {
                    'maximumLength': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                },
                'parserMode': 'DEFAULT'|'OVERRIDDEN',
                'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                'promptState': 'ENABLED'|'DISABLED',
                'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
            },
        ]
    },
    tags={
        'string': 'string'
    }
)
type agentName:

string

param agentName:

[REQUIRED]

A name for the agent that you create.

type agentResourceRoleArn:

string

param agentResourceRoleArn:

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

type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type description:

string

param description:

A description of the agent.

type foundationModel:

string

param foundationModel:

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

type guardrailConfiguration:

dict

param guardrailConfiguration:

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

  • guardrailIdentifier (string) --

    The unique identifier of the guardrail.

  • guardrailVersion (string) --

    The version of the guardrail.

type idleSessionTTLInSeconds:

integer

param idleSessionTTLInSeconds:

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.

type instruction:

string

param instruction:

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

type memoryConfiguration:

dict

param memoryConfiguration:

Contains the details of the memory configured for the agent.

  • enabledMemoryTypes (list) -- [REQUIRED]

    The type of memory that is stored.

    • (string) --

  • storageDays (integer) --

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

type promptOverrideConfiguration:

dict

param promptOverrideConfiguration:

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

  • overrideLambda (string) --

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

  • promptConfigurations (list) -- [REQUIRED]

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

    • (dict) --

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

      • basePromptTemplate (string) --

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

      • inferenceConfiguration (dict) --

        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 (list) --

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

          • (string) --

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

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

      • 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

      • promptType (string) --

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

type tags:

dict

param tags:

Any tags that you want to attach to the agent.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'agent': {
        'agentArn': 'string',
        'agentId': 'string',
        'agentName': 'string',
        'agentResourceRoleArn': 'string',
        'agentStatus': 'CREATING'|'PREPARING'|'PREPARED'|'NOT_PREPARED'|'DELETING'|'FAILED'|'VERSIONING'|'UPDATING',
        'agentVersion': 'string',
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'customerEncryptionKeyArn': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'foundationModel': 'string',
        'guardrailConfiguration': {
            'guardrailIdentifier': 'string',
            'guardrailVersion': 'string'
        },
        'idleSessionTTLInSeconds': 123,
        'instruction': 'string',
        'memoryConfiguration': {
            'enabledMemoryTypes': [
                'SESSION_SUMMARY',
            ],
            'storageDays': 123
        },
        'preparedAt': datetime(2015, 1, 1),
        'promptOverrideConfiguration': {
            'overrideLambda': 'string',
            'promptConfigurations': [
                {
                    'basePromptTemplate': 'string',
                    'inferenceConfiguration': {
                        'maximumLength': 123,
                        'stopSequences': [
                            'string',
                        ],
                        'temperature': ...,
                        'topK': 123,
                        'topP': ...
                    },
                    'parserMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptState': 'ENABLED'|'DISABLED',
                    'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
                },
            ]
        },
        'recommendedActions': [
            'string',
        ],
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agent (dict) --

      Contains details about the agent created.

      • agentArn (string) --

        The Amazon Resource Name (ARN) of the agent.

      • agentId (string) --

        The unique identifier of the agent.

      • agentName (string) --

        The name of the agent.

      • agentResourceRoleArn (string) --

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

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

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

      • createdAt (datetime) --

        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 (list) --

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

        • (string) --

      • foundationModel (string) --

        The foundation model used for orchestration by the agent.

      • guardrailConfiguration (dict) --

        Details about the guardrail associated with the agent.

        • guardrailIdentifier (string) --

          The unique identifier of the guardrail.

        • guardrailVersion (string) --

          The version of the guardrail.

      • idleSessionTTLInSeconds (integer) --

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

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

      • instruction (string) --

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

      • memoryConfiguration (dict) --

        Contains memory configuration for the agent.

        • enabledMemoryTypes (list) --

          The type of memory that is stored.

          • (string) --

        • storageDays (integer) --

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

      • preparedAt (datetime) --

        The time at which the agent was last prepared.

      • promptOverrideConfiguration (dict) --

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

        • overrideLambda (string) --

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

        • promptConfigurations (list) --

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

          • (dict) --

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

            • basePromptTemplate (string) --

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

            • inferenceConfiguration (dict) --

              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 (list) --

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

                • (string) --

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

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

            • 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

            • promptType (string) --

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

      • recommendedActions (list) --

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

        • (string) --

      • updatedAt (datetime) --

        The time at which the agent was last updated.

CreateAgentActionGroup (updated) Link ¶
Changes (request, response)
Request
{'parentActionGroupSignature': {'AMAZON.CodeInterpreter'}}
Response
{'agentActionGroup': {'parentActionSignature': {'AMAZON.CodeInterpreter'}}}

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

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

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

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

See also: AWS API Documentation

Request Syntax

client.create_agent_action_group(
    actionGroupExecutor={
        'customControl': 'RETURN_CONTROL',
        'lambda': 'string'
    },
    actionGroupName='string',
    actionGroupState='ENABLED'|'DISABLED',
    agentId='string',
    agentVersion='string',
    apiSchema={
        'payload': 'string',
        's3': {
            's3BucketName': 'string',
            's3ObjectKey': 'string'
        }
    },
    clientToken='string',
    description='string',
    functionSchema={
        'functions': [
            {
                'description': 'string',
                'name': 'string',
                'parameters': {
                    'string': {
                        'description': 'string',
                        'required': True|False,
                        'type': 'string'|'number'|'integer'|'boolean'|'array'
                    }
                }
            },
        ]
    },
    parentActionGroupSignature='AMAZON.UserInput'|'AMAZON.CodeInterpreter'
)
type actionGroupExecutor:

dict

param actionGroupExecutor:

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

  • customControl (string) --

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

  • lambda (string) --

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

type actionGroupName:

string

param actionGroupName:

[REQUIRED]

The name to give the action group.

type actionGroupState:

string

param actionGroupState:

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

type agentId:

string

param agentId:

[REQUIRED]

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

type agentVersion:

string

param agentVersion:

[REQUIRED]

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

type apiSchema:

dict

param apiSchema:

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 (dict) --

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

    • s3BucketName (string) --

      The name of the S3 bucket.

    • s3ObjectKey (string) --

      The S3 object key for the S3 resource.

type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type description:

string

param description:

A description of the action group.

type functionSchema:

dict

param functionSchema:

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

type parentActionGroupSignature:

string

param parentActionGroupSignature:

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

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

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

rtype:

dict

returns:

Response Syntax

{
    'agentActionGroup': {
        'actionGroupExecutor': {
            'customControl': 'RETURN_CONTROL',
            'lambda': 'string'
        },
        'actionGroupId': 'string',
        'actionGroupName': 'string',
        'actionGroupState': 'ENABLED'|'DISABLED',
        'agentId': 'string',
        'agentVersion': 'string',
        'apiSchema': {
            'payload': 'string',
            's3': {
                's3BucketName': 'string',
                's3ObjectKey': 'string'
            }
        },
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'description': 'string',
        'functionSchema': {
            'functions': [
                {
                    'description': 'string',
                    'name': 'string',
                    'parameters': {
                        'string': {
                            'description': 'string',
                            'required': True|False,
                            'type': 'string'|'number'|'integer'|'boolean'|'array'
                        }
                    }
                },
            ]
        },
        'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter',
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agentActionGroup (dict) --

      Contains details about the action group that was created.

      • actionGroupExecutor (dict) --

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

        • customControl (string) --

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

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

        The name of the action group.

      • actionGroupState (string) --

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

      • agentId (string) --

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

      • agentVersion (string) --

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

      • apiSchema (dict) --

        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 (dict) --

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

          • s3BucketName (string) --

            The name of the S3 bucket.

          • s3ObjectKey (string) --

            The S3 object key for the S3 resource.

      • clientToken (string) --

        A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

      • createdAt (datetime) --

        The time at which the action group was created.

      • description (string) --

        The description of the action group.

      • functionSchema (dict) --

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

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

      • updatedAt (datetime) --

        The time at which the action group was last updated.

CreateDataSource (updated) Link ¶
Changes (request, response)
Request
{'dataSourceConfiguration': {'confluenceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'BASIC '
                                                                                             '| '
                                                                                             'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'hostType': 'SAAS',
                                                                                 'hostUrl': 'string'}},
                             'salesforceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'hostUrl': 'string'}},
                             'sharePointConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'domain': 'string',
                                                                                 'hostType': 'ONLINE',
                                                                                 'siteUrls': ['string'],
                                                                                 'tenantId': 'string'}},
                             'type': {'CONFLUENCE',
                                      'SALESFORCE',
                                      'SHAREPOINT',
                                      'WEB'},
                             'webConfiguration': {'crawlerConfiguration': {'crawlerLimits': {'rateLimit': 'integer'},
                                                                           'exclusionFilters': ['string'],
                                                                           'inclusionFilters': ['string'],
                                                                           'scope': 'HOST_ONLY '
                                                                                    '| '
                                                                                    'SUBDOMAINS'},
                                                  'sourceConfiguration': {'urlConfiguration': {'seedUrls': [{'url': 'string'}]}}}},
 'vectorIngestionConfiguration': {'chunkingConfiguration': {'chunkingStrategy': {'HIERARCHICAL',
                                                                                 'SEMANTIC'},
                                                            'hierarchicalChunkingConfiguration': {'levelConfigurations': [{'maxTokens': 'integer'}],
                                                                                                  'overlapTokens': 'integer'},
                                                            'semanticChunkingConfiguration': {'breakpointPercentileThreshold': 'integer',
                                                                                              'bufferSize': 'integer',
                                                                                              'maxTokens': 'integer'}},
                                  'customTransformationConfiguration': {'intermediateStorage': {'s3Location': {'uri': 'string'}},
                                                                        'transformations': [{'stepToApply': 'POST_CHUNKING',
                                                                                             'transformationFunction': {'transformationLambdaConfiguration': {'lambdaArn': 'string'}}}]},
                                  'parsingConfiguration': {'bedrockFoundationModelConfiguration': {'modelArn': 'string',
                                                                                                   'parsingPrompt': {'parsingPromptText': 'string'}},
                                                           'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'}}}
Response
{'dataSource': {'dataSourceConfiguration': {'confluenceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'BASIC '
                                                                                                            '| '
                                                                                                            'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostType': 'SAAS',
                                                                                                'hostUrl': 'string'}},
                                            'salesforceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostUrl': 'string'}},
                                            'sharePointConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'domain': 'string',
                                                                                                'hostType': 'ONLINE',
                                                                                                'siteUrls': ['string'],
                                                                                                'tenantId': 'string'}},
                                            'type': {'CONFLUENCE',
                                                     'SALESFORCE',
                                                     'SHAREPOINT',
                                                     'WEB'},
                                            'webConfiguration': {'crawlerConfiguration': {'crawlerLimits': {'rateLimit': 'integer'},
                                                                                          'exclusionFilters': ['string'],
                                                                                          'inclusionFilters': ['string'],
                                                                                          'scope': 'HOST_ONLY '
                                                                                                   '| '
                                                                                                   'SUBDOMAINS'},
                                                                 'sourceConfiguration': {'urlConfiguration': {'seedUrls': [{'url': 'string'}]}}}},
                'vectorIngestionConfiguration': {'chunkingConfiguration': {'chunkingStrategy': {'HIERARCHICAL',
                                                                                                'SEMANTIC'},
                                                                           'hierarchicalChunkingConfiguration': {'levelConfigurations': [{'maxTokens': 'integer'}],
                                                                                                                 'overlapTokens': 'integer'},
                                                                           'semanticChunkingConfiguration': {'breakpointPercentileThreshold': 'integer',
                                                                                                             'bufferSize': 'integer',
                                                                                                             'maxTokens': 'integer'}},
                                                 'customTransformationConfiguration': {'intermediateStorage': {'s3Location': {'uri': 'string'}},
                                                                                       'transformations': [{'stepToApply': 'POST_CHUNKING',
                                                                                                            'transformationFunction': {'transformationLambdaConfiguration': {'lambdaArn': 'string'}}}]},
                                                 'parsingConfiguration': {'bedrockFoundationModelConfiguration': {'modelArn': 'string',
                                                                                                                  'parsingPrompt': {'parsingPromptText': 'string'}},
                                                                          'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'}}}}

Creates a data source connector for a knowledge base.

See also: AWS API Documentation

Request Syntax

client.create_data_source(
    clientToken='string',
    dataDeletionPolicy='RETAIN'|'DELETE',
    dataSourceConfiguration={
        'confluenceConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'BASIC'|'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'hostType': 'SAAS',
                'hostUrl': 'string'
            }
        },
        's3Configuration': {
            'bucketArn': 'string',
            'bucketOwnerAccountId': 'string',
            'inclusionPrefixes': [
                'string',
            ]
        },
        'salesforceConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'hostUrl': 'string'
            }
        },
        'sharePointConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'domain': 'string',
                'hostType': 'ONLINE',
                'siteUrls': [
                    'string',
                ],
                'tenantId': 'string'
            }
        },
        'type': 'S3'|'WEB'|'CONFLUENCE'|'SALESFORCE'|'SHAREPOINT',
        'webConfiguration': {
            'crawlerConfiguration': {
                'crawlerLimits': {
                    'rateLimit': 123
                },
                'exclusionFilters': [
                    'string',
                ],
                'inclusionFilters': [
                    'string',
                ],
                'scope': 'HOST_ONLY'|'SUBDOMAINS'
            },
            'sourceConfiguration': {
                'urlConfiguration': {
                    'seedUrls': [
                        {
                            'url': 'string'
                        },
                    ]
                }
            }
        }
    },
    description='string',
    knowledgeBaseId='string',
    name='string',
    serverSideEncryptionConfiguration={
        'kmsKeyArn': 'string'
    },
    vectorIngestionConfiguration={
        'chunkingConfiguration': {
            'chunkingStrategy': 'FIXED_SIZE'|'NONE'|'HIERARCHICAL'|'SEMANTIC',
            'fixedSizeChunkingConfiguration': {
                'maxTokens': 123,
                'overlapPercentage': 123
            },
            'hierarchicalChunkingConfiguration': {
                'levelConfigurations': [
                    {
                        'maxTokens': 123
                    },
                ],
                'overlapTokens': 123
            },
            'semanticChunkingConfiguration': {
                'breakpointPercentileThreshold': 123,
                'bufferSize': 123,
                'maxTokens': 123
            }
        },
        'customTransformationConfiguration': {
            'intermediateStorage': {
                's3Location': {
                    'uri': 'string'
                }
            },
            'transformations': [
                {
                    'stepToApply': 'POST_CHUNKING',
                    'transformationFunction': {
                        'transformationLambdaConfiguration': {
                            'lambdaArn': 'string'
                        }
                    }
                },
            ]
        },
        'parsingConfiguration': {
            'bedrockFoundationModelConfiguration': {
                'modelArn': 'string',
                'parsingPrompt': {
                    'parsingPromptText': 'string'
                }
            },
            'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'
        }
    }
)
type clientToken:

string

param clientToken:

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.

This field is autopopulated if not provided.

type dataDeletionPolicy:

string

param dataDeletionPolicy:

The data deletion policy for the data source.

You can set the data deletion policy to:

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

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

type dataSourceConfiguration:

dict

param dataSourceConfiguration:

[REQUIRED]

The connection configuration for the data source.

  • confluenceConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your Confluence data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

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

      • hostType (string) -- [REQUIRED]

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

      • hostUrl (string) -- [REQUIRED]

        The Confluence host URL or instance URL.

  • s3Configuration (dict) --

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

    • bucketArn (string) -- [REQUIRED]

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

    • bucketOwnerAccountId (string) --

      The account ID for the owner of the S3 bucket.

    • inclusionPrefixes (list) --

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

      • (string) --

  • salesforceConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your Salesforce data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

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

      • hostUrl (string) -- [REQUIRED]

        The Salesforce host URL or instance URL.

  • sharePointConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your SharePoint data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

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

      • domain (string) -- [REQUIRED]

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

      • hostType (string) -- [REQUIRED]

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

      • siteUrls (list) -- [REQUIRED]

        A list of one or more SharePoint site URLs.

        • (string) --

      • tenantId (string) --

        The identifier of your Microsoft 365 tenant.

  • type (string) -- [REQUIRED]

    The type of data source.

  • webConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

      The Web Crawler configuration details for the web data source.

      • crawlerLimits (dict) --

        The configuration of crawl limits for the web URLs.

        • rateLimit (integer) --

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

      • exclusionFilters (list) --

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

        • (string) --

      • inclusionFilters (list) --

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

        • (string) --

      • scope (string) --

        The scope of what is crawled for your URLs.

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The source configuration details for the web data source.

      • urlConfiguration (dict) -- [REQUIRED]

        The configuration of the URL/URLs.

        • seedUrls (list) --

          One or more seed or starting point URLs.

          • (dict) --

            The seed or starting point URL. You should be authorized to crawl the URL.

            • url (string) --

              A seed or starting point URL.

type description:

string

param description:

A description of the data source.

type knowledgeBaseId:

string

param knowledgeBaseId:

[REQUIRED]

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

type name:

string

param name:

[REQUIRED]

The name of the data source.

type serverSideEncryptionConfiguration:

dict

param serverSideEncryptionConfiguration:

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.

type vectorIngestionConfiguration:

dict

param vectorIngestionConfiguration:

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

  • chunkingConfiguration (dict) --

    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.

    • chunkingStrategy (string) -- [REQUIRED]

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

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

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

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

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

    • fixedSizeChunkingConfiguration (dict) --

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

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens to include in a chunk.

      • overlapPercentage (integer) -- [REQUIRED]

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

    • hierarchicalChunkingConfiguration (dict) --

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

      • levelConfigurations (list) -- [REQUIRED]

        Token settings for each layer.

        • (dict) --

          Token settings for a layer in a hierarchical chunking configuration.

          • maxTokens (integer) -- [REQUIRED]

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

      • overlapTokens (integer) -- [REQUIRED]

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

    • semanticChunkingConfiguration (dict) --

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

      • breakpointPercentileThreshold (integer) -- [REQUIRED]

        The dissimilarity threshold for splitting chunks.

      • bufferSize (integer) -- [REQUIRED]

        The buffer size.

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens that a chunk can contain.

  • customTransformationConfiguration (dict) --

    A custom document transformer for parsed data source documents.

    • intermediateStorage (dict) -- [REQUIRED]

      An S3 bucket path for input and output objects.

      • s3Location (dict) -- [REQUIRED]

        An S3 bucket path.

        • uri (string) -- [REQUIRED]

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

    • transformations (list) -- [REQUIRED]

      A Lambda function that processes documents.

      • (dict) --

        A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to POST_CHUNKING.

        • stepToApply (string) -- [REQUIRED]

          When the service applies the transformation.

        • transformationFunction (dict) -- [REQUIRED]

          A Lambda function that processes documents.

          • transformationLambdaConfiguration (dict) -- [REQUIRED]

            The Lambda function.

            • lambdaArn (string) -- [REQUIRED]

              The function's ARN identifier.

  • parsingConfiguration (dict) --

    A custom parser for data source documents.

    • bedrockFoundationModelConfiguration (dict) --

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

      • modelArn (string) -- [REQUIRED]

        The model's ARN.

      • parsingPrompt (dict) --

        Instructions for interpreting the contents of a document.

        • parsingPromptText (string) -- [REQUIRED]

          Instructions for interpreting the contents of a document.

    • parsingStrategy (string) -- [REQUIRED]

      The parsing strategy for the data source.

rtype:

dict

returns:

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            'confluenceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'BASIC'|'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostType': 'SAAS',
                    'hostUrl': 'string'
                }
            },
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'salesforceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostUrl': 'string'
                }
            },
            'sharePointConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'domain': 'string',
                    'hostType': 'ONLINE',
                    'siteUrls': [
                        'string',
                    ],
                    'tenantId': 'string'
                }
            },
            'type': 'S3'|'WEB'|'CONFLUENCE'|'SALESFORCE'|'SHAREPOINT',
            'webConfiguration': {
                'crawlerConfiguration': {
                    'crawlerLimits': {
                        'rateLimit': 123
                    },
                    'exclusionFilters': [
                        'string',
                    ],
                    'inclusionFilters': [
                        'string',
                    ],
                    'scope': 'HOST_ONLY'|'SUBDOMAINS'
                },
                'sourceConfiguration': {
                    'urlConfiguration': {
                        'seedUrls': [
                            {
                                'url': 'string'
                            },
                        ]
                    }
                }
            }
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE'|'HIERARCHICAL'|'SEMANTIC',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                },
                'hierarchicalChunkingConfiguration': {
                    'levelConfigurations': [
                        {
                            'maxTokens': 123
                        },
                    ],
                    'overlapTokens': 123
                },
                'semanticChunkingConfiguration': {
                    'breakpointPercentileThreshold': 123,
                    'bufferSize': 123,
                    'maxTokens': 123
                }
            },
            'customTransformationConfiguration': {
                'intermediateStorage': {
                    's3Location': {
                        'uri': 'string'
                    }
                },
                'transformations': [
                    {
                        'stepToApply': 'POST_CHUNKING',
                        'transformationFunction': {
                            'transformationLambdaConfiguration': {
                                'lambdaArn': 'string'
                            }
                        }
                    },
                ]
            },
            'parsingConfiguration': {
                'bedrockFoundationModelConfiguration': {
                    'modelArn': 'string',
                    'parsingPrompt': {
                        'parsingPromptText': 'string'
                    }
                },
                'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The data deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        The connection configuration for the data source.

        • confluenceConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Confluence data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • hostType (string) --

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

            • hostUrl (string) --

              The Confluence host URL or instance URL.

        • s3Configuration (dict) --

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

          • bucketArn (string) --

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

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

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

            • (string) --

        • salesforceConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Salesforce data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • hostUrl (string) --

              The Salesforce host URL or instance URL.

        • sharePointConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your SharePoint data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • domain (string) --

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

            • hostType (string) --

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

            • siteUrls (list) --

              A list of one or more SharePoint site URLs.

              • (string) --

            • tenantId (string) --

              The identifier of your Microsoft 365 tenant.

        • type (string) --

          The type of data source.

        • webConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

            The Web Crawler configuration details for the web data source.

            • crawlerLimits (dict) --

              The configuration of crawl limits for the web URLs.

              • rateLimit (integer) --

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

            • exclusionFilters (list) --

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

              • (string) --

            • inclusionFilters (list) --

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

              • (string) --

            • scope (string) --

              The scope of what is crawled for your URLs.

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

          • sourceConfiguration (dict) --

            The source configuration details for the web data source.

            • urlConfiguration (dict) --

              The configuration of the URL/URLs.

              • seedUrls (list) --

                One or more seed or starting point URLs.

                • (dict) --

                  The seed or starting point URL. You should be authorized to crawl the URL.

                  • url (string) --

                    A seed or starting point URL.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

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

        • (string) --

      • knowledgeBaseId (string) --

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

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        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.

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

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

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

        • chunkingConfiguration (dict) --

          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.

          • chunkingStrategy (string) --

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

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

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

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

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

          • fixedSizeChunkingConfiguration (dict) --

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

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

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

          • hierarchicalChunkingConfiguration (dict) --

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

            • levelConfigurations (list) --

              Token settings for each layer.

              • (dict) --

                Token settings for a layer in a hierarchical chunking configuration.

                • maxTokens (integer) --

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

            • overlapTokens (integer) --

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

          • semanticChunkingConfiguration (dict) --

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

            • breakpointPercentileThreshold (integer) --

              The dissimilarity threshold for splitting chunks.

            • bufferSize (integer) --

              The buffer size.

            • maxTokens (integer) --

              The maximum number of tokens that a chunk can contain.

        • customTransformationConfiguration (dict) --

          A custom document transformer for parsed data source documents.

          • intermediateStorage (dict) --

            An S3 bucket path for input and output objects.

            • s3Location (dict) --

              An S3 bucket path.

              • uri (string) --

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

          • transformations (list) --

            A Lambda function that processes documents.

            • (dict) --

              A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to POST_CHUNKING.

              • stepToApply (string) --

                When the service applies the transformation.

              • transformationFunction (dict) --

                A Lambda function that processes documents.

                • transformationLambdaConfiguration (dict) --

                  The Lambda function.

                  • lambdaArn (string) --

                    The function's ARN identifier.

        • parsingConfiguration (dict) --

          A custom parser for data source documents.

          • bedrockFoundationModelConfiguration (dict) --

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

            • modelArn (string) --

              The model's ARN.

            • parsingPrompt (dict) --

              Instructions for interpreting the contents of a document.

              • parsingPromptText (string) --

                Instructions for interpreting the contents of a document.

          • parsingStrategy (string) --

            The parsing strategy for the data source.

GetAgent (updated) Link ¶
Changes (response)
{'agent': {'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                                   'storageDays': 'integer'}}}

Gets information about an agent.

See also: AWS API Documentation

Request Syntax

client.get_agent(
    agentId='string'
)
type agentId:

string

param agentId:

[REQUIRED]

The unique identifier of the agent.

rtype:

dict

returns:

Response Syntax

{
    'agent': {
        'agentArn': 'string',
        'agentId': 'string',
        'agentName': 'string',
        'agentResourceRoleArn': 'string',
        'agentStatus': 'CREATING'|'PREPARING'|'PREPARED'|'NOT_PREPARED'|'DELETING'|'FAILED'|'VERSIONING'|'UPDATING',
        'agentVersion': 'string',
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'customerEncryptionKeyArn': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'foundationModel': 'string',
        'guardrailConfiguration': {
            'guardrailIdentifier': 'string',
            'guardrailVersion': 'string'
        },
        'idleSessionTTLInSeconds': 123,
        'instruction': 'string',
        'memoryConfiguration': {
            'enabledMemoryTypes': [
                'SESSION_SUMMARY',
            ],
            'storageDays': 123
        },
        'preparedAt': datetime(2015, 1, 1),
        'promptOverrideConfiguration': {
            'overrideLambda': 'string',
            'promptConfigurations': [
                {
                    'basePromptTemplate': 'string',
                    'inferenceConfiguration': {
                        'maximumLength': 123,
                        'stopSequences': [
                            'string',
                        ],
                        'temperature': ...,
                        'topK': 123,
                        'topP': ...
                    },
                    'parserMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptState': 'ENABLED'|'DISABLED',
                    'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
                },
            ]
        },
        'recommendedActions': [
            'string',
        ],
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agent (dict) --

      Contains details about the agent.

      • agentArn (string) --

        The Amazon Resource Name (ARN) of the agent.

      • agentId (string) --

        The unique identifier of the agent.

      • agentName (string) --

        The name of the agent.

      • agentResourceRoleArn (string) --

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

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

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

      • createdAt (datetime) --

        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 (list) --

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

        • (string) --

      • foundationModel (string) --

        The foundation model used for orchestration by the agent.

      • guardrailConfiguration (dict) --

        Details about the guardrail associated with the agent.

        • guardrailIdentifier (string) --

          The unique identifier of the guardrail.

        • guardrailVersion (string) --

          The version of the guardrail.

      • idleSessionTTLInSeconds (integer) --

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

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

      • instruction (string) --

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

      • memoryConfiguration (dict) --

        Contains memory configuration for the agent.

        • enabledMemoryTypes (list) --

          The type of memory that is stored.

          • (string) --

        • storageDays (integer) --

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

      • preparedAt (datetime) --

        The time at which the agent was last prepared.

      • promptOverrideConfiguration (dict) --

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

        • overrideLambda (string) --

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

        • promptConfigurations (list) --

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

          • (dict) --

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

            • basePromptTemplate (string) --

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

            • inferenceConfiguration (dict) --

              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 (list) --

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

                • (string) --

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

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

            • 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

            • promptType (string) --

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

      • recommendedActions (list) --

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

        • (string) --

      • updatedAt (datetime) --

        The time at which the agent was last updated.

GetAgentActionGroup (updated) Link ¶
Changes (response)
{'agentActionGroup': {'parentActionSignature': {'AMAZON.CodeInterpreter'}}}

Gets information about an action group for an agent.

See also: AWS API Documentation

Request Syntax

client.get_agent_action_group(
    actionGroupId='string',
    agentId='string',
    agentVersion='string'
)
type actionGroupId:

string

param actionGroupId:

[REQUIRED]

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

type agentId:

string

param agentId:

[REQUIRED]

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

type agentVersion:

string

param agentVersion:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'agentActionGroup': {
        'actionGroupExecutor': {
            'customControl': 'RETURN_CONTROL',
            'lambda': 'string'
        },
        'actionGroupId': 'string',
        'actionGroupName': 'string',
        'actionGroupState': 'ENABLED'|'DISABLED',
        'agentId': 'string',
        'agentVersion': 'string',
        'apiSchema': {
            'payload': 'string',
            's3': {
                's3BucketName': 'string',
                's3ObjectKey': 'string'
            }
        },
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'description': 'string',
        'functionSchema': {
            'functions': [
                {
                    'description': 'string',
                    'name': 'string',
                    'parameters': {
                        'string': {
                            'description': 'string',
                            'required': True|False,
                            'type': 'string'|'number'|'integer'|'boolean'|'array'
                        }
                    }
                },
            ]
        },
        'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter',
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agentActionGroup (dict) --

      Contains details about the action group.

      • actionGroupExecutor (dict) --

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

        • customControl (string) --

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

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

        The name of the action group.

      • actionGroupState (string) --

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

      • agentId (string) --

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

      • agentVersion (string) --

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

      • apiSchema (dict) --

        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 (dict) --

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

          • s3BucketName (string) --

            The name of the S3 bucket.

          • s3ObjectKey (string) --

            The S3 object key for the S3 resource.

      • clientToken (string) --

        A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

      • createdAt (datetime) --

        The time at which the action group was created.

      • description (string) --

        The description of the action group.

      • functionSchema (dict) --

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

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

      • updatedAt (datetime) --

        The time at which the action group was last updated.

GetAgentVersion (updated) Link ¶
Changes (response)
{'agentVersion': {'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                                          'storageDays': 'integer'}}}

Gets details about a version of an agent.

See also: AWS API Documentation

Request Syntax

client.get_agent_version(
    agentId='string',
    agentVersion='string'
)
type agentId:

string

param agentId:

[REQUIRED]

The unique identifier of the agent.

type agentVersion:

string

param agentVersion:

[REQUIRED]

The version of the agent.

rtype:

dict

returns:

Response Syntax

{
    'agentVersion': {
        'agentArn': 'string',
        'agentId': 'string',
        'agentName': 'string',
        'agentResourceRoleArn': 'string',
        'agentStatus': 'CREATING'|'PREPARING'|'PREPARED'|'NOT_PREPARED'|'DELETING'|'FAILED'|'VERSIONING'|'UPDATING',
        'createdAt': datetime(2015, 1, 1),
        'customerEncryptionKeyArn': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'foundationModel': 'string',
        'guardrailConfiguration': {
            'guardrailIdentifier': 'string',
            'guardrailVersion': 'string'
        },
        'idleSessionTTLInSeconds': 123,
        'instruction': 'string',
        'memoryConfiguration': {
            'enabledMemoryTypes': [
                'SESSION_SUMMARY',
            ],
            'storageDays': 123
        },
        'promptOverrideConfiguration': {
            'overrideLambda': 'string',
            'promptConfigurations': [
                {
                    'basePromptTemplate': 'string',
                    'inferenceConfiguration': {
                        'maximumLength': 123,
                        'stopSequences': [
                            'string',
                        ],
                        'temperature': ...,
                        'topK': 123,
                        'topP': ...
                    },
                    'parserMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptState': 'ENABLED'|'DISABLED',
                    'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
                },
            ]
        },
        'recommendedActions': [
            'string',
        ],
        'updatedAt': datetime(2015, 1, 1),
        'version': 'string'
    }
}

Response Structure

  • (dict) --

    • agentVersion (dict) --

      Contains details about the version of the agent.

      • agentArn (string) --

        The Amazon Resource Name (ARN) of the agent that the version belongs to.

      • agentId (string) --

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

      • agentName (string) --

        The name of the agent that the version belongs to.

      • agentResourceRoleArn (string) --

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

      • agentStatus (string) --

        The status of the agent that the version belongs to.

      • createdAt (datetime) --

        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 (list) --

        A list of reasons that the API operation on the version failed.

        • (string) --

      • foundationModel (string) --

        The foundation model that the version invokes.

      • guardrailConfiguration (dict) --

        Details about the guardrail associated with the agent.

        • guardrailIdentifier (string) --

          The unique identifier of the guardrail.

        • guardrailVersion (string) --

          The version of the guardrail.

      • idleSessionTTLInSeconds (integer) --

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

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

      • instruction (string) --

        The instructions provided to the agent.

      • memoryConfiguration (dict) --

        Contains details of the memory configuration on the version of the agent.

        • enabledMemoryTypes (list) --

          The type of memory that is stored.

          • (string) --

        • storageDays (integer) --

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

      • promptOverrideConfiguration (dict) --

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

        • overrideLambda (string) --

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

        • promptConfigurations (list) --

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

          • (dict) --

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

            • basePromptTemplate (string) --

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

            • inferenceConfiguration (dict) --

              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 (list) --

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

                • (string) --

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

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

            • 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

            • promptType (string) --

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

      • recommendedActions (list) --

        A list of recommended actions to take for the failed API operation on the version to succeed.

        • (string) --

      • updatedAt (datetime) --

        The time at which the version was last updated.

      • version (string) --

        The version number.

GetDataSource (updated) Link ¶
Changes (response)
{'dataSource': {'dataSourceConfiguration': {'confluenceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'BASIC '
                                                                                                            '| '
                                                                                                            'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostType': 'SAAS',
                                                                                                'hostUrl': 'string'}},
                                            'salesforceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostUrl': 'string'}},
                                            'sharePointConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'domain': 'string',
                                                                                                'hostType': 'ONLINE',
                                                                                                'siteUrls': ['string'],
                                                                                                'tenantId': 'string'}},
                                            'type': {'CONFLUENCE',
                                                     'SALESFORCE',
                                                     'SHAREPOINT',
                                                     'WEB'},
                                            'webConfiguration': {'crawlerConfiguration': {'crawlerLimits': {'rateLimit': 'integer'},
                                                                                          'exclusionFilters': ['string'],
                                                                                          'inclusionFilters': ['string'],
                                                                                          'scope': 'HOST_ONLY '
                                                                                                   '| '
                                                                                                   'SUBDOMAINS'},
                                                                 'sourceConfiguration': {'urlConfiguration': {'seedUrls': [{'url': 'string'}]}}}},
                'vectorIngestionConfiguration': {'chunkingConfiguration': {'chunkingStrategy': {'HIERARCHICAL',
                                                                                                'SEMANTIC'},
                                                                           'hierarchicalChunkingConfiguration': {'levelConfigurations': [{'maxTokens': 'integer'}],
                                                                                                                 'overlapTokens': 'integer'},
                                                                           'semanticChunkingConfiguration': {'breakpointPercentileThreshold': 'integer',
                                                                                                             'bufferSize': 'integer',
                                                                                                             'maxTokens': 'integer'}},
                                                 'customTransformationConfiguration': {'intermediateStorage': {'s3Location': {'uri': 'string'}},
                                                                                       'transformations': [{'stepToApply': 'POST_CHUNKING',
                                                                                                            'transformationFunction': {'transformationLambdaConfiguration': {'lambdaArn': 'string'}}}]},
                                                 'parsingConfiguration': {'bedrockFoundationModelConfiguration': {'modelArn': 'string',
                                                                                                                  'parsingPrompt': {'parsingPromptText': 'string'}},
                                                                          'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'}}}}

Gets information about a data source.

See also: AWS API Documentation

Request Syntax

client.get_data_source(
    dataSourceId='string',
    knowledgeBaseId='string'
)
type dataSourceId:

string

param dataSourceId:

[REQUIRED]

The unique identifier of the data source.

type knowledgeBaseId:

string

param knowledgeBaseId:

[REQUIRED]

The unique identifier of the knowledge base that the data source was added to.

rtype:

dict

returns:

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            'confluenceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'BASIC'|'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostType': 'SAAS',
                    'hostUrl': 'string'
                }
            },
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'salesforceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostUrl': 'string'
                }
            },
            'sharePointConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'domain': 'string',
                    'hostType': 'ONLINE',
                    'siteUrls': [
                        'string',
                    ],
                    'tenantId': 'string'
                }
            },
            'type': 'S3'|'WEB'|'CONFLUENCE'|'SALESFORCE'|'SHAREPOINT',
            'webConfiguration': {
                'crawlerConfiguration': {
                    'crawlerLimits': {
                        'rateLimit': 123
                    },
                    'exclusionFilters': [
                        'string',
                    ],
                    'inclusionFilters': [
                        'string',
                    ],
                    'scope': 'HOST_ONLY'|'SUBDOMAINS'
                },
                'sourceConfiguration': {
                    'urlConfiguration': {
                        'seedUrls': [
                            {
                                'url': 'string'
                            },
                        ]
                    }
                }
            }
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE'|'HIERARCHICAL'|'SEMANTIC',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                },
                'hierarchicalChunkingConfiguration': {
                    'levelConfigurations': [
                        {
                            'maxTokens': 123
                        },
                    ],
                    'overlapTokens': 123
                },
                'semanticChunkingConfiguration': {
                    'breakpointPercentileThreshold': 123,
                    'bufferSize': 123,
                    'maxTokens': 123
                }
            },
            'customTransformationConfiguration': {
                'intermediateStorage': {
                    's3Location': {
                        'uri': 'string'
                    }
                },
                'transformations': [
                    {
                        'stepToApply': 'POST_CHUNKING',
                        'transformationFunction': {
                            'transformationLambdaConfiguration': {
                                'lambdaArn': 'string'
                            }
                        }
                    },
                ]
            },
            'parsingConfiguration': {
                'bedrockFoundationModelConfiguration': {
                    'modelArn': 'string',
                    'parsingPrompt': {
                        'parsingPromptText': 'string'
                    }
                },
                'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The data deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        The connection configuration for the data source.

        • confluenceConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Confluence data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • hostType (string) --

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

            • hostUrl (string) --

              The Confluence host URL or instance URL.

        • s3Configuration (dict) --

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

          • bucketArn (string) --

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

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

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

            • (string) --

        • salesforceConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Salesforce data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • hostUrl (string) --

              The Salesforce host URL or instance URL.

        • sharePointConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

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

            • filterConfiguration (dict) --

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

              • patternObjectFilter (dict) --

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

                • filters (list) --

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

                  • (dict) --

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

                    • exclusionFilters (list) --

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

                      • (string) --

                    • inclusionFilters (list) --

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

                      • (string) --

                    • objectType (string) --

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

              • type (string) --

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

          • sourceConfiguration (dict) --

            The endpoint information to connect to your SharePoint data source.

            • authType (string) --

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

            • credentialsSecretArn (string) --

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

            • domain (string) --

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

            • hostType (string) --

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

            • siteUrls (list) --

              A list of one or more SharePoint site URLs.

              • (string) --

            • tenantId (string) --

              The identifier of your Microsoft 365 tenant.

        • type (string) --

          The type of data source.

        • webConfiguration (dict) --

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

          • crawlerConfiguration (dict) --

            The Web Crawler configuration details for the web data source.

            • crawlerLimits (dict) --

              The configuration of crawl limits for the web URLs.

              • rateLimit (integer) --

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

            • exclusionFilters (list) --

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

              • (string) --

            • inclusionFilters (list) --

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

              • (string) --

            • scope (string) --

              The scope of what is crawled for your URLs.

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

          • sourceConfiguration (dict) --

            The source configuration details for the web data source.

            • urlConfiguration (dict) --

              The configuration of the URL/URLs.

              • seedUrls (list) --

                One or more seed or starting point URLs.

                • (dict) --

                  The seed or starting point URL. You should be authorized to crawl the URL.

                  • url (string) --

                    A seed or starting point URL.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

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

        • (string) --

      • knowledgeBaseId (string) --

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

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        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.

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

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

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

        • chunkingConfiguration (dict) --

          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.

          • chunkingStrategy (string) --

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

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

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

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

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

          • fixedSizeChunkingConfiguration (dict) --

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

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

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

          • hierarchicalChunkingConfiguration (dict) --

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

            • levelConfigurations (list) --

              Token settings for each layer.

              • (dict) --

                Token settings for a layer in a hierarchical chunking configuration.

                • maxTokens (integer) --

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

            • overlapTokens (integer) --

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

          • semanticChunkingConfiguration (dict) --

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

            • breakpointPercentileThreshold (integer) --

              The dissimilarity threshold for splitting chunks.

            • bufferSize (integer) --

              The buffer size.

            • maxTokens (integer) --

              The maximum number of tokens that a chunk can contain.

        • customTransformationConfiguration (dict) --

          A custom document transformer for parsed data source documents.

          • intermediateStorage (dict) --

            An S3 bucket path for input and output objects.

            • s3Location (dict) --

              An S3 bucket path.

              • uri (string) --

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

          • transformations (list) --

            A Lambda function that processes documents.

            • (dict) --

              A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to POST_CHUNKING.

              • stepToApply (string) --

                When the service applies the transformation.

              • transformationFunction (dict) --

                A Lambda function that processes documents.

                • transformationLambdaConfiguration (dict) --

                  The Lambda function.

                  • lambdaArn (string) --

                    The function's ARN identifier.

        • parsingConfiguration (dict) --

          A custom parser for data source documents.

          • bedrockFoundationModelConfiguration (dict) --

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

            • modelArn (string) --

              The model's ARN.

            • parsingPrompt (dict) --

              Instructions for interpreting the contents of a document.

              • parsingPromptText (string) --

                Instructions for interpreting the contents of a document.

          • parsingStrategy (string) --

            The parsing strategy for the data source.

UpdateAgent (updated) Link ¶
Changes (request, response)
Request
{'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                         'storageDays': 'integer'}}
Response
{'agent': {'memoryConfiguration': {'enabledMemoryTypes': ['SESSION_SUMMARY'],
                                   'storageDays': 'integer'}}}

Updates the configuration of an agent.

See also: AWS API Documentation

Request Syntax

client.update_agent(
    agentId='string',
    agentName='string',
    agentResourceRoleArn='string',
    customerEncryptionKeyArn='string',
    description='string',
    foundationModel='string',
    guardrailConfiguration={
        'guardrailIdentifier': 'string',
        'guardrailVersion': 'string'
    },
    idleSessionTTLInSeconds=123,
    instruction='string',
    memoryConfiguration={
        'enabledMemoryTypes': [
            'SESSION_SUMMARY',
        ],
        'storageDays': 123
    },
    promptOverrideConfiguration={
        'overrideLambda': 'string',
        'promptConfigurations': [
            {
                'basePromptTemplate': 'string',
                'inferenceConfiguration': {
                    'maximumLength': 123,
                    'stopSequences': [
                        'string',
                    ],
                    'temperature': ...,
                    'topK': 123,
                    'topP': ...
                },
                'parserMode': 'DEFAULT'|'OVERRIDDEN',
                'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                'promptState': 'ENABLED'|'DISABLED',
                'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
            },
        ]
    }
)
type agentId:

string

param agentId:

[REQUIRED]

The unique identifier of the agent.

type agentName:

string

param agentName:

[REQUIRED]

Specifies a new name for the agent.

type agentResourceRoleArn:

string

param agentResourceRoleArn:

[REQUIRED]

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

type customerEncryptionKeyArn:

string

param customerEncryptionKeyArn:

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

type description:

string

param description:

Specifies a new description of the agent.

type foundationModel:

string

param foundationModel:

[REQUIRED]

Specifies a new foundation model to be used for orchestration by the agent.

type guardrailConfiguration:

dict

param guardrailConfiguration:

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

  • guardrailIdentifier (string) --

    The unique identifier of the guardrail.

  • guardrailVersion (string) --

    The version of the guardrail.

type idleSessionTTLInSeconds:

integer

param idleSessionTTLInSeconds:

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.

type instruction:

string

param instruction:

Specifies new instructions that tell the agent what it should do and how it should interact with users.

type memoryConfiguration:

dict

param memoryConfiguration:

Specifies the new memory configuration for the agent.

  • enabledMemoryTypes (list) -- [REQUIRED]

    The type of memory that is stored.

    • (string) --

  • storageDays (integer) --

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

type promptOverrideConfiguration:

dict

param promptOverrideConfiguration:

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

  • overrideLambda (string) --

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

  • promptConfigurations (list) -- [REQUIRED]

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

    • (dict) --

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

      • basePromptTemplate (string) --

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

      • inferenceConfiguration (dict) --

        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 (list) --

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

          • (string) --

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

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

      • 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

      • promptType (string) --

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

rtype:

dict

returns:

Response Syntax

{
    'agent': {
        'agentArn': 'string',
        'agentId': 'string',
        'agentName': 'string',
        'agentResourceRoleArn': 'string',
        'agentStatus': 'CREATING'|'PREPARING'|'PREPARED'|'NOT_PREPARED'|'DELETING'|'FAILED'|'VERSIONING'|'UPDATING',
        'agentVersion': 'string',
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'customerEncryptionKeyArn': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'foundationModel': 'string',
        'guardrailConfiguration': {
            'guardrailIdentifier': 'string',
            'guardrailVersion': 'string'
        },
        'idleSessionTTLInSeconds': 123,
        'instruction': 'string',
        'memoryConfiguration': {
            'enabledMemoryTypes': [
                'SESSION_SUMMARY',
            ],
            'storageDays': 123
        },
        'preparedAt': datetime(2015, 1, 1),
        'promptOverrideConfiguration': {
            'overrideLambda': 'string',
            'promptConfigurations': [
                {
                    'basePromptTemplate': 'string',
                    'inferenceConfiguration': {
                        'maximumLength': 123,
                        'stopSequences': [
                            'string',
                        ],
                        'temperature': ...,
                        'topK': 123,
                        'topP': ...
                    },
                    'parserMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptCreationMode': 'DEFAULT'|'OVERRIDDEN',
                    'promptState': 'ENABLED'|'DISABLED',
                    'promptType': 'PRE_PROCESSING'|'ORCHESTRATION'|'POST_PROCESSING'|'KNOWLEDGE_BASE_RESPONSE_GENERATION'
                },
            ]
        },
        'recommendedActions': [
            'string',
        ],
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agent (dict) --

      Contains details about the agent that was updated.

      • agentArn (string) --

        The Amazon Resource Name (ARN) of the agent.

      • agentId (string) --

        The unique identifier of the agent.

      • agentName (string) --

        The name of the agent.

      • agentResourceRoleArn (string) --

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

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

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

      • createdAt (datetime) --

        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 (list) --

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

        • (string) --

      • foundationModel (string) --

        The foundation model used for orchestration by the agent.

      • guardrailConfiguration (dict) --

        Details about the guardrail associated with the agent.

        • guardrailIdentifier (string) --

          The unique identifier of the guardrail.

        • guardrailVersion (string) --

          The version of the guardrail.

      • idleSessionTTLInSeconds (integer) --

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

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

      • instruction (string) --

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

      • memoryConfiguration (dict) --

        Contains memory configuration for the agent.

        • enabledMemoryTypes (list) --

          The type of memory that is stored.

          • (string) --

        • storageDays (integer) --

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

      • preparedAt (datetime) --

        The time at which the agent was last prepared.

      • promptOverrideConfiguration (dict) --

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

        • overrideLambda (string) --

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

        • promptConfigurations (list) --

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

          • (dict) --

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

            • basePromptTemplate (string) --

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

            • inferenceConfiguration (dict) --

              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 (list) --

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

                • (string) --

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

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

            • 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

            • promptType (string) --

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

      • recommendedActions (list) --

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

        • (string) --

      • updatedAt (datetime) --

        The time at which the agent was last updated.

UpdateAgentActionGroup (updated) Link ¶
Changes (request, response)
Request
{'parentActionGroupSignature': {'AMAZON.CodeInterpreter'}}
Response
{'agentActionGroup': {'parentActionSignature': {'AMAZON.CodeInterpreter'}}}

Updates the configuration for an action group for an agent.

See also: AWS API Documentation

Request Syntax

client.update_agent_action_group(
    actionGroupExecutor={
        'customControl': 'RETURN_CONTROL',
        'lambda': 'string'
    },
    actionGroupId='string',
    actionGroupName='string',
    actionGroupState='ENABLED'|'DISABLED',
    agentId='string',
    agentVersion='string',
    apiSchema={
        'payload': 'string',
        's3': {
            's3BucketName': 'string',
            's3ObjectKey': 'string'
        }
    },
    description='string',
    functionSchema={
        'functions': [
            {
                'description': 'string',
                'name': 'string',
                'parameters': {
                    'string': {
                        'description': 'string',
                        'required': True|False,
                        'type': 'string'|'number'|'integer'|'boolean'|'array'
                    }
                }
            },
        ]
    },
    parentActionGroupSignature='AMAZON.UserInput'|'AMAZON.CodeInterpreter'
)
type actionGroupExecutor:

dict

param actionGroupExecutor:

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.

  • lambda (string) --

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

type actionGroupId:

string

param actionGroupId:

[REQUIRED]

The unique identifier of the action group.

type actionGroupName:

string

param actionGroupName:

[REQUIRED]

Specifies a new name for the action group.

type actionGroupState:

string

param actionGroupState:

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

type agentId:

string

param agentId:

[REQUIRED]

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

type agentVersion:

string

param agentVersion:

[REQUIRED]

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

type apiSchema:

dict

param apiSchema:

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 (dict) --

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

    • s3BucketName (string) --

      The name of the S3 bucket.

    • s3ObjectKey (string) --

      The S3 object key for the S3 resource.

type description:

string

param description:

Specifies a new name for the action group.

type functionSchema:

dict

param functionSchema:

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

type parentActionGroupSignature:

string

param parentActionGroupSignature:

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.

rtype:

dict

returns:

Response Syntax

{
    'agentActionGroup': {
        'actionGroupExecutor': {
            'customControl': 'RETURN_CONTROL',
            'lambda': 'string'
        },
        'actionGroupId': 'string',
        'actionGroupName': 'string',
        'actionGroupState': 'ENABLED'|'DISABLED',
        'agentId': 'string',
        'agentVersion': 'string',
        'apiSchema': {
            'payload': 'string',
            's3': {
                's3BucketName': 'string',
                's3ObjectKey': 'string'
            }
        },
        'clientToken': 'string',
        'createdAt': datetime(2015, 1, 1),
        'description': 'string',
        'functionSchema': {
            'functions': [
                {
                    'description': 'string',
                    'name': 'string',
                    'parameters': {
                        'string': {
                            'description': 'string',
                            'required': True|False,
                            'type': 'string'|'number'|'integer'|'boolean'|'array'
                        }
                    }
                },
            ]
        },
        'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter',
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • agentActionGroup (dict) --

      Contains details about the action group that was updated.

      • actionGroupExecutor (dict) --

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

        • customControl (string) --

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

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

        The name of the action group.

      • actionGroupState (string) --

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

      • agentId (string) --

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

      • agentVersion (string) --

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

      • apiSchema (dict) --

        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 (dict) --

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

          • s3BucketName (string) --

            The name of the S3 bucket.

          • s3ObjectKey (string) --

            The S3 object key for the S3 resource.

      • clientToken (string) --

        A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

      • createdAt (datetime) --

        The time at which the action group was created.

      • description (string) --

        The description of the action group.

      • functionSchema (dict) --

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

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

      • updatedAt (datetime) --

        The time at which the action group was last updated.

UpdateDataSource (updated) Link ¶
Changes (request, response)
Request
{'dataSourceConfiguration': {'confluenceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'BASIC '
                                                                                             '| '
                                                                                             'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'hostType': 'SAAS',
                                                                                 'hostUrl': 'string'}},
                             'salesforceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'hostUrl': 'string'}},
                             'sharePointConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                               'inclusionFilters': ['string'],
                                                                                                                                               'objectType': 'string'}]},
                                                                                                          'type': 'PATTERN'}},
                                                         'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                 'credentialsSecretArn': 'string',
                                                                                 'domain': 'string',
                                                                                 'hostType': 'ONLINE',
                                                                                 'siteUrls': ['string'],
                                                                                 'tenantId': 'string'}},
                             'type': {'CONFLUENCE',
                                      'SALESFORCE',
                                      'SHAREPOINT',
                                      'WEB'},
                             'webConfiguration': {'crawlerConfiguration': {'crawlerLimits': {'rateLimit': 'integer'},
                                                                           'exclusionFilters': ['string'],
                                                                           'inclusionFilters': ['string'],
                                                                           'scope': 'HOST_ONLY '
                                                                                    '| '
                                                                                    'SUBDOMAINS'},
                                                  'sourceConfiguration': {'urlConfiguration': {'seedUrls': [{'url': 'string'}]}}}},
 'vectorIngestionConfiguration': {'chunkingConfiguration': {'chunkingStrategy': {'HIERARCHICAL',
                                                                                 'SEMANTIC'},
                                                            'hierarchicalChunkingConfiguration': {'levelConfigurations': [{'maxTokens': 'integer'}],
                                                                                                  'overlapTokens': 'integer'},
                                                            'semanticChunkingConfiguration': {'breakpointPercentileThreshold': 'integer',
                                                                                              'bufferSize': 'integer',
                                                                                              'maxTokens': 'integer'}},
                                  'customTransformationConfiguration': {'intermediateStorage': {'s3Location': {'uri': 'string'}},
                                                                        'transformations': [{'stepToApply': 'POST_CHUNKING',
                                                                                             'transformationFunction': {'transformationLambdaConfiguration': {'lambdaArn': 'string'}}}]},
                                  'parsingConfiguration': {'bedrockFoundationModelConfiguration': {'modelArn': 'string',
                                                                                                   'parsingPrompt': {'parsingPromptText': 'string'}},
                                                           'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'}}}
Response
{'dataSource': {'dataSourceConfiguration': {'confluenceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'BASIC '
                                                                                                            '| '
                                                                                                            'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostType': 'SAAS',
                                                                                                'hostUrl': 'string'}},
                                            'salesforceConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'hostUrl': 'string'}},
                                            'sharePointConfiguration': {'crawlerConfiguration': {'filterConfiguration': {'patternObjectFilter': {'filters': [{'exclusionFilters': ['string'],
                                                                                                                                                              'inclusionFilters': ['string'],
                                                                                                                                                              'objectType': 'string'}]},
                                                                                                                         'type': 'PATTERN'}},
                                                                        'sourceConfiguration': {'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                                                                                                'credentialsSecretArn': 'string',
                                                                                                'domain': 'string',
                                                                                                'hostType': 'ONLINE',
                                                                                                'siteUrls': ['string'],
                                                                                                'tenantId': 'string'}},
                                            'type': {'CONFLUENCE',
                                                     'SALESFORCE',
                                                     'SHAREPOINT',
                                                     'WEB'},
                                            'webConfiguration': {'crawlerConfiguration': {'crawlerLimits': {'rateLimit': 'integer'},
                                                                                          'exclusionFilters': ['string'],
                                                                                          'inclusionFilters': ['string'],
                                                                                          'scope': 'HOST_ONLY '
                                                                                                   '| '
                                                                                                   'SUBDOMAINS'},
                                                                 'sourceConfiguration': {'urlConfiguration': {'seedUrls': [{'url': 'string'}]}}}},
                'vectorIngestionConfiguration': {'chunkingConfiguration': {'chunkingStrategy': {'HIERARCHICAL',
                                                                                                'SEMANTIC'},
                                                                           'hierarchicalChunkingConfiguration': {'levelConfigurations': [{'maxTokens': 'integer'}],
                                                                                                                 'overlapTokens': 'integer'},
                                                                           'semanticChunkingConfiguration': {'breakpointPercentileThreshold': 'integer',
                                                                                                             'bufferSize': 'integer',
                                                                                                             'maxTokens': 'integer'}},
                                                 'customTransformationConfiguration': {'intermediateStorage': {'s3Location': {'uri': 'string'}},
                                                                                       'transformations': [{'stepToApply': 'POST_CHUNKING',
                                                                                                            'transformationFunction': {'transformationLambdaConfiguration': {'lambdaArn': 'string'}}}]},
                                                 'parsingConfiguration': {'bedrockFoundationModelConfiguration': {'modelArn': 'string',
                                                                                                                  'parsingPrompt': {'parsingPromptText': 'string'}},
                                                                          'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'}}}}

Updates the configurations for a data source connector.

See also: AWS API Documentation

Request Syntax

client.update_data_source(
    dataDeletionPolicy='RETAIN'|'DELETE',
    dataSourceConfiguration={
        'confluenceConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'BASIC'|'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'hostType': 'SAAS',
                'hostUrl': 'string'
            }
        },
        's3Configuration': {
            'bucketArn': 'string',
            'bucketOwnerAccountId': 'string',
            'inclusionPrefixes': [
                'string',
            ]
        },
        'salesforceConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'hostUrl': 'string'
            }
        },
        'sharePointConfiguration': {
            'crawlerConfiguration': {
                'filterConfiguration': {
                    'patternObjectFilter': {
                        'filters': [
                            {
                                'exclusionFilters': [
                                    'string',
                                ],
                                'inclusionFilters': [
                                    'string',
                                ],
                                'objectType': 'string'
                            },
                        ]
                    },
                    'type': 'PATTERN'
                }
            },
            'sourceConfiguration': {
                'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                'credentialsSecretArn': 'string',
                'domain': 'string',
                'hostType': 'ONLINE',
                'siteUrls': [
                    'string',
                ],
                'tenantId': 'string'
            }
        },
        'type': 'S3'|'WEB'|'CONFLUENCE'|'SALESFORCE'|'SHAREPOINT',
        'webConfiguration': {
            'crawlerConfiguration': {
                'crawlerLimits': {
                    'rateLimit': 123
                },
                'exclusionFilters': [
                    'string',
                ],
                'inclusionFilters': [
                    'string',
                ],
                'scope': 'HOST_ONLY'|'SUBDOMAINS'
            },
            'sourceConfiguration': {
                'urlConfiguration': {
                    'seedUrls': [
                        {
                            'url': 'string'
                        },
                    ]
                }
            }
        }
    },
    dataSourceId='string',
    description='string',
    knowledgeBaseId='string',
    name='string',
    serverSideEncryptionConfiguration={
        'kmsKeyArn': 'string'
    },
    vectorIngestionConfiguration={
        'chunkingConfiguration': {
            'chunkingStrategy': 'FIXED_SIZE'|'NONE'|'HIERARCHICAL'|'SEMANTIC',
            'fixedSizeChunkingConfiguration': {
                'maxTokens': 123,
                'overlapPercentage': 123
            },
            'hierarchicalChunkingConfiguration': {
                'levelConfigurations': [
                    {
                        'maxTokens': 123
                    },
                ],
                'overlapTokens': 123
            },
            'semanticChunkingConfiguration': {
                'breakpointPercentileThreshold': 123,
                'bufferSize': 123,
                'maxTokens': 123
            }
        },
        'customTransformationConfiguration': {
            'intermediateStorage': {
                's3Location': {
                    'uri': 'string'
                }
            },
            'transformations': [
                {
                    'stepToApply': 'POST_CHUNKING',
                    'transformationFunction': {
                        'transformationLambdaConfiguration': {
                            'lambdaArn': 'string'
                        }
                    }
                },
            ]
        },
        'parsingConfiguration': {
            'bedrockFoundationModelConfiguration': {
                'modelArn': 'string',
                'parsingPrompt': {
                    'parsingPromptText': 'string'
                }
            },
            'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'
        }
    }
)
type dataDeletionPolicy:

string

param dataDeletionPolicy:

The data deletion policy for the data source that you want to update.

type dataSourceConfiguration:

dict

param dataSourceConfiguration:

[REQUIRED]

The connection configuration for the data source that you want to update.

  • confluenceConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your Confluence data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

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

      • hostType (string) -- [REQUIRED]

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

      • hostUrl (string) -- [REQUIRED]

        The Confluence host URL or instance URL.

  • s3Configuration (dict) --

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

    • bucketArn (string) -- [REQUIRED]

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

    • bucketOwnerAccountId (string) --

      The account ID for the owner of the S3 bucket.

    • inclusionPrefixes (list) --

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

      • (string) --

  • salesforceConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your Salesforce data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

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

      • hostUrl (string) -- [REQUIRED]

        The Salesforce host URL or instance URL.

  • sharePointConfiguration (dict) --

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

    • crawlerConfiguration (dict) --

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

      • filterConfiguration (dict) --

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

        • patternObjectFilter (dict) --

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

          • filters (list) -- [REQUIRED]

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

            • (dict) --

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

              • exclusionFilters (list) --

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

                • (string) --

              • inclusionFilters (list) --

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

                • (string) --

              • objectType (string) -- [REQUIRED]

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

        • type (string) -- [REQUIRED]

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

    • sourceConfiguration (dict) -- [REQUIRED]

      The endpoint information to connect to your SharePoint data source.

      • authType (string) -- [REQUIRED]

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

      • credentialsSecretArn (string) -- [REQUIRED]

        The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

      • domain (string) -- [REQUIRED]

        The domain of your SharePoint instance or site URL/URLs.

      • hostType (string) -- [REQUIRED]

        The supported host type, whether online/cloud or server/on-premises.

      • siteUrls (list) -- [REQUIRED]

        A list of one or more SharePoint site URLs.

        • (string) --

      • tenantId (string) --

        The identifier of your Microsoft 365 tenant.

  • type (string) -- [REQUIRED]

    The type of data source.

  • webConfiguration (dict) --

    The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

    • crawlerConfiguration (dict) --

      The Web Crawler configuration details for the web data source.

      • crawlerLimits (dict) --

        The configuration of crawl limits for the web URLs.

        • rateLimit (integer) --

          The max rate at which pages are crawled, up to 300 per minute per host.

      • exclusionFilters (list) --

        A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

        • (string) --

      • inclusionFilters (list) --

        A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

        • (string) --

      • scope (string) --

        The scope of what is crawled for your URLs.

        You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

    • sourceConfiguration (dict) -- [REQUIRED]

      The source configuration details for the web data source.

      • urlConfiguration (dict) -- [REQUIRED]

        The configuration of the URL/URLs.

        • seedUrls (list) --

          One or more seed or starting point URLs.

          • (dict) --

            The seed or starting point URL. You should be authorized to crawl the URL.

            • url (string) --

              A seed or starting point URL.

type dataSourceId:

string

param dataSourceId:

[REQUIRED]

The unique identifier of the data source.

type description:

string

param description:

Specifies a new description for the data source.

type knowledgeBaseId:

string

param knowledgeBaseId:

[REQUIRED]

The unique identifier of the knowledge base for the data source.

type name:

string

param name:

[REQUIRED]

Specifies a new name for the data source.

type serverSideEncryptionConfiguration:

dict

param serverSideEncryptionConfiguration:

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.

type vectorIngestionConfiguration:

dict

param vectorIngestionConfiguration:

Contains details about how to ingest the documents in the data source.

  • chunkingConfiguration (dict) --

    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.

    • chunkingStrategy (string) -- [REQUIRED]

      Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

      • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

      • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

      • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

      • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

    • fixedSizeChunkingConfiguration (dict) --

      Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens to include in a chunk.

      • overlapPercentage (integer) -- [REQUIRED]

        The percentage of overlap between adjacent chunks of a data source.

    • hierarchicalChunkingConfiguration (dict) --

      Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

      • levelConfigurations (list) -- [REQUIRED]

        Token settings for each layer.

        • (dict) --

          Token settings for a layer in a hierarchical chunking configuration.

          • maxTokens (integer) -- [REQUIRED]

            The maximum number of tokens that a chunk can contain in this layer.

      • overlapTokens (integer) -- [REQUIRED]

        The number of tokens to repeat across chunks in the same layer.

    • semanticChunkingConfiguration (dict) --

      Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

      • breakpointPercentileThreshold (integer) -- [REQUIRED]

        The dissimilarity threshold for splitting chunks.

      • bufferSize (integer) -- [REQUIRED]

        The buffer size.

      • maxTokens (integer) -- [REQUIRED]

        The maximum number of tokens that a chunk can contain.

  • customTransformationConfiguration (dict) --

    A custom document transformer for parsed data source documents.

    • intermediateStorage (dict) -- [REQUIRED]

      An S3 bucket path for input and output objects.

      • s3Location (dict) -- [REQUIRED]

        An S3 bucket path.

        • uri (string) -- [REQUIRED]

          The location's URI. For example, s3://my-bucket/chunk-processor/.

    • transformations (list) -- [REQUIRED]

      A Lambda function that processes documents.

      • (dict) --

        A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to POST_CHUNKING.

        • stepToApply (string) -- [REQUIRED]

          When the service applies the transformation.

        • transformationFunction (dict) -- [REQUIRED]

          A Lambda function that processes documents.

          • transformationLambdaConfiguration (dict) -- [REQUIRED]

            The Lambda function.

            • lambdaArn (string) -- [REQUIRED]

              The function's ARN identifier.

  • parsingConfiguration (dict) --

    A custom parser for data source documents.

    • bedrockFoundationModelConfiguration (dict) --

      Settings for a foundation model used to parse documents for a data source.

      • modelArn (string) -- [REQUIRED]

        The model's ARN.

      • parsingPrompt (dict) --

        Instructions for interpreting the contents of a document.

        • parsingPromptText (string) -- [REQUIRED]

          Instructions for interpreting the contents of a document.

    • parsingStrategy (string) -- [REQUIRED]

      The parsing strategy for the data source.

rtype:

dict

returns:

Response Syntax

{
    'dataSource': {
        'createdAt': datetime(2015, 1, 1),
        'dataDeletionPolicy': 'RETAIN'|'DELETE',
        'dataSourceConfiguration': {
            'confluenceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'BASIC'|'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostType': 'SAAS',
                    'hostUrl': 'string'
                }
            },
            's3Configuration': {
                'bucketArn': 'string',
                'bucketOwnerAccountId': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            },
            'salesforceConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'hostUrl': 'string'
                }
            },
            'sharePointConfiguration': {
                'crawlerConfiguration': {
                    'filterConfiguration': {
                        'patternObjectFilter': {
                            'filters': [
                                {
                                    'exclusionFilters': [
                                        'string',
                                    ],
                                    'inclusionFilters': [
                                        'string',
                                    ],
                                    'objectType': 'string'
                                },
                            ]
                        },
                        'type': 'PATTERN'
                    }
                },
                'sourceConfiguration': {
                    'authType': 'OAUTH2_CLIENT_CREDENTIALS',
                    'credentialsSecretArn': 'string',
                    'domain': 'string',
                    'hostType': 'ONLINE',
                    'siteUrls': [
                        'string',
                    ],
                    'tenantId': 'string'
                }
            },
            'type': 'S3'|'WEB'|'CONFLUENCE'|'SALESFORCE'|'SHAREPOINT',
            'webConfiguration': {
                'crawlerConfiguration': {
                    'crawlerLimits': {
                        'rateLimit': 123
                    },
                    'exclusionFilters': [
                        'string',
                    ],
                    'inclusionFilters': [
                        'string',
                    ],
                    'scope': 'HOST_ONLY'|'SUBDOMAINS'
                },
                'sourceConfiguration': {
                    'urlConfiguration': {
                        'seedUrls': [
                            {
                                'url': 'string'
                            },
                        ]
                    }
                }
            }
        },
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'knowledgeBaseId': 'string',
        'name': 'string',
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'status': 'AVAILABLE'|'DELETING'|'DELETE_UNSUCCESSFUL',
        'updatedAt': datetime(2015, 1, 1),
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE'|'HIERARCHICAL'|'SEMANTIC',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                },
                'hierarchicalChunkingConfiguration': {
                    'levelConfigurations': [
                        {
                            'maxTokens': 123
                        },
                    ],
                    'overlapTokens': 123
                },
                'semanticChunkingConfiguration': {
                    'breakpointPercentileThreshold': 123,
                    'bufferSize': 123,
                    'maxTokens': 123
                }
            },
            'customTransformationConfiguration': {
                'intermediateStorage': {
                    's3Location': {
                        'uri': 'string'
                    }
                },
                'transformations': [
                    {
                        'stepToApply': 'POST_CHUNKING',
                        'transformationFunction': {
                            'transformationLambdaConfiguration': {
                                'lambdaArn': 'string'
                            }
                        }
                    },
                ]
            },
            'parsingConfiguration': {
                'bedrockFoundationModelConfiguration': {
                    'modelArn': 'string',
                    'parsingPrompt': {
                        'parsingPromptText': 'string'
                    }
                },
                'parsingStrategy': 'BEDROCK_FOUNDATION_MODEL'
            }
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      Contains details about the data source.

      • createdAt (datetime) --

        The time at which the data source was created.

      • dataDeletionPolicy (string) --

        The data deletion policy for the data source.

      • dataSourceConfiguration (dict) --

        The connection configuration for the data source.

        • confluenceConfiguration (dict) --

          The configuration information to connect to Confluence as your data source.

          • crawlerConfiguration (dict) --

            The configuration of the Confluence content. For example, configuring specific types of Confluence content.

            • filterConfiguration (dict) --

              The configuration of filtering the Confluence content. For example, configuring regular expression patterns to include or exclude certain content.

              • patternObjectFilter (dict) --

                The configuration of filtering certain objects or content types of the data source.

                • filters (list) --

                  The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                  • (dict) --

                    The specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters (list) --

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • inclusionFilters (list) --

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • objectType (string) --

                      The supported object type or content type of the data source.

              • type (string) --

                The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Confluence data source.

            • authType (string) --

              The supported authentication type to authenticate and connect to your Confluence instance.

            • credentialsSecretArn (string) --

              The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Confluence connection configuration.

            • hostType (string) --

              The supported host type, whether online/cloud or server/on-premises.

            • hostUrl (string) --

              The Confluence host URL or instance URL.

        • s3Configuration (dict) --

          The configuration information to connect to Amazon S3 as your data source.

          • bucketArn (string) --

            The Amazon Resource Name (ARN) of the S3 bucket that contains your data.

          • bucketOwnerAccountId (string) --

            The account ID for the owner of the S3 bucket.

          • inclusionPrefixes (list) --

            A list of S3 prefixes to include certain files or content. For more information, see Organizing objects using prefixes.

            • (string) --

        • salesforceConfiguration (dict) --

          The configuration information to connect to Salesforce as your data source.

          • crawlerConfiguration (dict) --

            The configuration of the Salesforce content. For example, configuring specific types of Salesforce content.

            • filterConfiguration (dict) --

              The configuration of filtering the Salesforce content. For example, configuring regular expression patterns to include or exclude certain content.

              • patternObjectFilter (dict) --

                The configuration of filtering certain objects or content types of the data source.

                • filters (list) --

                  The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                  • (dict) --

                    The specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters (list) --

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • inclusionFilters (list) --

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • objectType (string) --

                      The supported object type or content type of the data source.

              • type (string) --

                The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

          • sourceConfiguration (dict) --

            The endpoint information to connect to your Salesforce data source.

            • authType (string) --

              The supported authentication type to authenticate and connect to your Salesforce instance.

            • credentialsSecretArn (string) --

              The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see Salesforce connection configuration.

            • hostUrl (string) --

              The Salesforce host URL or instance URL.

        • sharePointConfiguration (dict) --

          The configuration information to connect to SharePoint as your data source.

          • crawlerConfiguration (dict) --

            The configuration of the SharePoint content. For example, configuring specific types of SharePoint content.

            • filterConfiguration (dict) --

              The configuration of filtering the SharePoint content. For example, configuring regular expression patterns to include or exclude certain content.

              • patternObjectFilter (dict) --

                The configuration of filtering certain objects or content types of the data source.

                • filters (list) --

                  The configuration of specific filters applied to your data source content. You can filter out or include certain content.

                  • (dict) --

                    The specific filters applied to your data source content. You can filter out or include certain content.

                    • exclusionFilters (list) --

                      A list of one or more exclusion regular expression patterns to exclude certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • inclusionFilters (list) --

                      A list of one or more inclusion regular expression patterns to include certain object types that adhere to the pattern. If you specify an inclusion and exclusion filter/pattern and both match a document, the exclusion filter takes precedence and the document isn’t crawled.

                      • (string) --

                    • objectType (string) --

                      The supported object type or content type of the data source.

              • type (string) --

                The type of filtering that you want to apply to certain objects or content of the data source. For example, the PATTERN type is regular expression patterns you can apply to filter your content.

          • sourceConfiguration (dict) --

            The endpoint information to connect to your SharePoint data source.

            • authType (string) --

              The supported authentication type to authenticate and connect to your SharePoint site/sites.

            • credentialsSecretArn (string) --

              The Amazon Resource Name of an Secrets Manager secret that stores your authentication credentials for your SharePoint site/sites. For more information on the key-value pairs that must be included in your secret, depending on your authentication type, see SharePoint connection configuration.

            • domain (string) --

              The domain of your SharePoint instance or site URL/URLs.

            • hostType (string) --

              The supported host type, whether online/cloud or server/on-premises.

            • siteUrls (list) --

              A list of one or more SharePoint site URLs.

              • (string) --

            • tenantId (string) --

              The identifier of your Microsoft 365 tenant.

        • type (string) --

          The type of data source.

        • webConfiguration (dict) --

          The configuration of web URLs to crawl for your data source. You should be authorized to crawl the URLs.

          • crawlerConfiguration (dict) --

            The Web Crawler configuration details for the web data source.

            • crawlerLimits (dict) --

              The configuration of crawl limits for the web URLs.

              • rateLimit (integer) --

                The max rate at which pages are crawled, up to 300 per minute per host.

            • exclusionFilters (list) --

              A list of one or more exclusion regular expression patterns to exclude certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • (string) --

            • inclusionFilters (list) --

              A list of one or more inclusion regular expression patterns to include certain URLs. If you specify an inclusion and exclusion filter/pattern and both match a URL, the exclusion filter takes precedence and the web content of the URL isn’t crawled.

              • (string) --

            • scope (string) --

              The scope of what is crawled for your URLs.

              You can choose to crawl only web pages that belong to the same host or primary domain. For example, only web pages that contain the seed URL "https://docs.aws.amazon.com/bedrock/latest/userguide/" and no other domains. You can choose to include sub domains in addition to the host or primary domain. For example, web pages that contain "aws.amazon.com" can also include sub domain "docs.aws.amazon.com".

          • sourceConfiguration (dict) --

            The source configuration details for the web data source.

            • urlConfiguration (dict) --

              The configuration of the URL/URLs.

              • seedUrls (list) --

                One or more seed or starting point URLs.

                • (dict) --

                  The seed or starting point URL. You should be authorized to crawl the URL.

                  • url (string) --

                    A seed or starting point URL.

      • dataSourceId (string) --

        The unique identifier of the data source.

      • description (string) --

        The description of the data source.

      • failureReasons (list) --

        The detailed reasons on the failure to delete a data source.

        • (string) --

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source belongs.

      • name (string) --

        The name of the data source.

      • serverSideEncryptionConfiguration (dict) --

        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.

      • status (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.

      • updatedAt (datetime) --

        The time at which the data source was last updated.

      • vectorIngestionConfiguration (dict) --

        Contains details about how to ingest the documents in the data source.

        • chunkingConfiguration (dict) --

          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.

          • chunkingStrategy (string) --

            Knowledge base can split your source data into chunks. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

            • FIXED_SIZE – Amazon Bedrock splits your source data into chunks of the approximate size that you set in the fixedSizeChunkingConfiguration.

            • HIERARCHICAL – Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

            • SEMANTIC – Split documents into chunks based on groups of similar content derived with natural language processing.

            • NONE – Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.

          • fixedSizeChunkingConfiguration (dict) --

            Configurations for when you choose fixed-size chunking. If you set the chunkingStrategy as NONE, exclude this field.

            • maxTokens (integer) --

              The maximum number of tokens to include in a chunk.

            • overlapPercentage (integer) --

              The percentage of overlap between adjacent chunks of a data source.

          • hierarchicalChunkingConfiguration (dict) --

            Settings for hierarchical document chunking for a data source. Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

            • levelConfigurations (list) --

              Token settings for each layer.

              • (dict) --

                Token settings for a layer in a hierarchical chunking configuration.

                • maxTokens (integer) --

                  The maximum number of tokens that a chunk can contain in this layer.

            • overlapTokens (integer) --

              The number of tokens to repeat across chunks in the same layer.

          • semanticChunkingConfiguration (dict) --

            Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.

            • breakpointPercentileThreshold (integer) --

              The dissimilarity threshold for splitting chunks.

            • bufferSize (integer) --

              The buffer size.

            • maxTokens (integer) --

              The maximum number of tokens that a chunk can contain.

        • customTransformationConfiguration (dict) --

          A custom document transformer for parsed data source documents.

          • intermediateStorage (dict) --

            An S3 bucket path for input and output objects.

            • s3Location (dict) --

              An S3 bucket path.

              • uri (string) --

                The location's URI. For example, s3://my-bucket/chunk-processor/.

          • transformations (list) --

            A Lambda function that processes documents.

            • (dict) --

              A custom processing step for documents moving through a data source ingestion pipeline. To process documents after they have been converted into chunks, set the step to apply to POST_CHUNKING.

              • stepToApply (string) --

                When the service applies the transformation.

              • transformationFunction (dict) --

                A Lambda function that processes documents.

                • transformationLambdaConfiguration (dict) --

                  The Lambda function.

                  • lambdaArn (string) --

                    The function's ARN identifier.

        • parsingConfiguration (dict) --

          A custom parser for data source documents.

          • bedrockFoundationModelConfiguration (dict) --

            Settings for a foundation model used to parse documents for a data source.

            • modelArn (string) --

              The model's ARN.

            • parsingPrompt (dict) --

              Instructions for interpreting the contents of a document.

              • parsingPromptText (string) --

                Instructions for interpreting the contents of a document.

          • parsingStrategy (string) --

            The parsing strategy for the data source.