AgentsforBedrock / Client / create_data_source

create_data_source#

AgentsforBedrock.Client.create_data_source(**kwargs)#

Create a new data source

See also: AWS API Documentation

Request Syntax

response = client.create_data_source(
    knowledgeBaseId='string',
    clientToken='string',
    name='string',
    description='string',
    dataSourceConfiguration={
        'type': 'S3',
        's3Configuration': {
            'bucketArn': 'string',
            'inclusionPrefixes': [
                'string',
            ]
        }
    },
    serverSideEncryptionConfiguration={
        'kmsKeyArn': 'string'
    },
    vectorIngestionConfiguration={
        'chunkingConfiguration': {
            'chunkingStrategy': 'FIXED_SIZE'|'NONE',
            'fixedSizeChunkingConfiguration': {
                'maxTokens': 123,
                'overlapPercentage': 123
            }
        }
    }
)
Parameters:
  • knowledgeBaseId (string) –

    [REQUIRED]

    Identifier for a resource.

  • clientToken (string) –

    Client specified token used for idempotency checks

    This field is autopopulated if not provided.

  • name (string) –

    [REQUIRED]

    Name for a resource.

  • description (string) – Description of the Resource.

  • dataSourceConfiguration (dict) –

    [REQUIRED]

    Specifies a raw data source location to ingest.

    • type (string) – [REQUIRED]

      The type of the data source location.

    • s3Configuration (dict) –

      Configures an S3 data source location.

      • bucketArn (string) – [REQUIRED]

        A S3 bucket ARN

      • inclusionPrefixes (list) –

        A list of S3 prefixes.

        • (string) –

          Prefix for s3 object.

  • serverSideEncryptionConfiguration (dict) –

    Server-side encryption configuration.

    • kmsKeyArn (string) –

      A KMS key ARN

  • vectorIngestionConfiguration (dict) –

    Configures ingestion for a vector knowledge base

    • chunkingConfiguration (dict) –

      Configures chunking strategy

      • chunkingStrategy (string) – [REQUIRED]

        The type of chunking strategy

      • fixedSizeChunkingConfiguration (dict) –

        Configures fixed size chunking strategy

        • maxTokens (integer) – [REQUIRED]

          The maximum number of tokens per chunk.

        • overlapPercentage (integer) – [REQUIRED]

          The overlap percentage between adjacent chunks.

Return type:

dict

Returns:

Response Syntax

{
    'dataSource': {
        'knowledgeBaseId': 'string',
        'dataSourceId': 'string',
        'name': 'string',
        'status': 'AVAILABLE'|'DELETING',
        'description': 'string',
        'dataSourceConfiguration': {
            'type': 'S3',
            's3Configuration': {
                'bucketArn': 'string',
                'inclusionPrefixes': [
                    'string',
                ]
            }
        },
        'serverSideEncryptionConfiguration': {
            'kmsKeyArn': 'string'
        },
        'vectorIngestionConfiguration': {
            'chunkingConfiguration': {
                'chunkingStrategy': 'FIXED_SIZE'|'NONE',
                'fixedSizeChunkingConfiguration': {
                    'maxTokens': 123,
                    'overlapPercentage': 123
                }
            }
        },
        'createdAt': datetime(2015, 1, 1),
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • dataSource (dict) –

      Contains the information of a data source.

      • knowledgeBaseId (string) –

        Identifier for a resource.

      • dataSourceId (string) –

        Identifier for a resource.

      • name (string) –

        Name for a resource.

      • status (string) –

        The status of a data source.

      • description (string) –

        Description of the Resource.

      • dataSourceConfiguration (dict) –

        Specifies a raw data source location to ingest.

        • type (string) –

          The type of the data source location.

        • s3Configuration (dict) –

          Configures an S3 data source location.

          • bucketArn (string) –

            A S3 bucket ARN

          • inclusionPrefixes (list) –

            A list of S3 prefixes.

            • (string) –

              Prefix for s3 object.

      • serverSideEncryptionConfiguration (dict) –

        Server-side encryption configuration.

        • kmsKeyArn (string) –

          A KMS key ARN

      • vectorIngestionConfiguration (dict) –

        Configures ingestion for a vector knowledge base

        • chunkingConfiguration (dict) –

          Configures chunking strategy

          • chunkingStrategy (string) –

            The type of chunking strategy

          • fixedSizeChunkingConfiguration (dict) –

            Configures fixed size chunking strategy

            • maxTokens (integer) –

              The maximum number of tokens per chunk.

            • overlapPercentage (integer) –

              The overlap percentage between adjacent chunks.

      • createdAt (datetime) –

        Time Stamp.

      • updatedAt (datetime) –

        Time Stamp.

Exceptions

  • AgentsforBedrock.Client.exceptions.ThrottlingException

  • AgentsforBedrock.Client.exceptions.AccessDeniedException

  • AgentsforBedrock.Client.exceptions.ValidationException

  • AgentsforBedrock.Client.exceptions.InternalServerException

  • AgentsforBedrock.Client.exceptions.ResourceNotFoundException

  • AgentsforBedrock.Client.exceptions.ConflictException

  • AgentsforBedrock.Client.exceptions.ServiceQuotaExceededException