Agents for Amazon Bedrock

2024/03/27 - Agents for Amazon Bedrock - 3 updated api methods

Changes  This changes introduces metadata documents statistics and also updates the documentation for bedrock agent.

GetIngestionJob (updated) Link ¶
Changes (response)
{'ingestionJob': {'statistics': {'numberOfMetadataDocumentsModified': 'long',
                                 'numberOfMetadataDocumentsScanned': 'long'}}}

Gets information about a ingestion job, in which a data source is added to a knowledge base.

See also: AWS API Documentation

Request Syntax

client.get_ingestion_job(
    dataSourceId='string',
    ingestionJobId='string',
    knowledgeBaseId='string'
)
type dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source in the ingestion job.

type ingestionJobId

string

param ingestionJobId

[REQUIRED]

The unique identifier of the ingestion job.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base for which the ingestion job applies.

rtype

dict

returns

Response Syntax

{
    'ingestionJob': {
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'ingestionJobId': 'string',
        'knowledgeBaseId': 'string',
        'startedAt': datetime(2015, 1, 1),
        'statistics': {
            'numberOfDocumentsDeleted': 123,
            'numberOfDocumentsFailed': 123,
            'numberOfDocumentsScanned': 123,
            'numberOfMetadataDocumentsModified': 123,
            'numberOfMetadataDocumentsScanned': 123,
            'numberOfModifiedDocumentsIndexed': 123,
            'numberOfNewDocumentsIndexed': 123
        },
        'status': 'STARTING'|'IN_PROGRESS'|'COMPLETE'|'FAILED',
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ingestionJob (dict) --

      Contains details about the ingestion job.

      • dataSourceId (string) --

        The unique identifier of the ingested data source.

      • description (string) --

        The description of the ingestion job.

      • failureReasons (list) --

        A list of reasons that the ingestion job failed.

        • (string) --

      • ingestionJobId (string) --

        The unique identifier of the ingestion job.

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source is being added.

      • startedAt (datetime) --

        The time at which the ingestion job started.

      • statistics (dict) --

        Contains statistics about the ingestion job.

        • numberOfDocumentsDeleted (integer) --

          The number of source documents that was deleted.

        • numberOfDocumentsFailed (integer) --

          The number of source documents that failed to be ingested.

        • numberOfDocumentsScanned (integer) --

          The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

        • numberOfMetadataDocumentsModified (integer) --

          The number of metadata files that were updated or deleted.

        • numberOfMetadataDocumentsScanned (integer) --

          The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

        • numberOfModifiedDocumentsIndexed (integer) --

          The number of modified source documents in the data source that were successfully indexed.

        • numberOfNewDocumentsIndexed (integer) --

          The number of new source documents in the data source that were successfully indexed.

      • status (string) --

        The status of the ingestion job.

      • updatedAt (datetime) --

        The time at which the ingestion job was last updated.

ListIngestionJobs (updated) Link ¶
Changes (response)
{'ingestionJobSummaries': {'statistics': {'numberOfMetadataDocumentsModified': 'long',
                                          'numberOfMetadataDocumentsScanned': 'long'}}}

Lists the ingestion jobs for a data source and information about each of them.

See also: AWS API Documentation

Request Syntax

client.list_ingestion_jobs(
    dataSourceId='string',
    filters=[
        {
            'attribute': 'STATUS',
            'operator': 'EQ',
            'values': [
                'string',
            ]
        },
    ],
    knowledgeBaseId='string',
    maxResults=123,
    nextToken='string',
    sortBy={
        'attribute': 'STATUS'|'STARTED_AT',
        'order': 'ASCENDING'|'DESCENDING'
    }
)
type dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source for which to return ingestion jobs.

type filters

list

param filters

Contains a definition of a filter for which to filter the results.

  • (dict) --

    Defines a filter by which to filter the results.

    • attribute (string) -- [REQUIRED]

      The attribute by which to filter the results.

    • operator (string) -- [REQUIRED]

      The operation to carry out between the attribute and the values.

    • values (list) -- [REQUIRED]

      A list of values for the attribute.

      • (string) --

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

The unique identifier of the knowledge base for which to return ingestion jobs.

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 sortBy

dict

param sortBy

Contains details about how to sort the results.

  • attribute (string) -- [REQUIRED]

    The attribute by which to sort the results.

  • order (string) -- [REQUIRED]

    The order by which to sort the results.

rtype

dict

returns

Response Syntax

{
    'ingestionJobSummaries': [
        {
            'dataSourceId': 'string',
            'description': 'string',
            'ingestionJobId': 'string',
            'knowledgeBaseId': 'string',
            'startedAt': datetime(2015, 1, 1),
            'statistics': {
                'numberOfDocumentsDeleted': 123,
                'numberOfDocumentsFailed': 123,
                'numberOfDocumentsScanned': 123,
                'numberOfMetadataDocumentsModified': 123,
                'numberOfMetadataDocumentsScanned': 123,
                'numberOfModifiedDocumentsIndexed': 123,
                'numberOfNewDocumentsIndexed': 123
            },
            'status': 'STARTING'|'IN_PROGRESS'|'COMPLETE'|'FAILED',
            'updatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • ingestionJobSummaries (list) --

      A list of objects, each of which contains information about an ingestion job.

      • (dict) --

        Contains details about an ingestion job.

        • dataSourceId (string) --

          The unique identifier of the data source in the ingestion job.

        • description (string) --

          The description of the ingestion job.

        • ingestionJobId (string) --

          The unique identifier of the ingestion job.

        • knowledgeBaseId (string) --

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

        • startedAt (datetime) --

          The time at which the ingestion job was started.

        • statistics (dict) --

          Contains statistics for the ingestion job.

          • numberOfDocumentsDeleted (integer) --

            The number of source documents that was deleted.

          • numberOfDocumentsFailed (integer) --

            The number of source documents that failed to be ingested.

          • numberOfDocumentsScanned (integer) --

            The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

          • numberOfMetadataDocumentsModified (integer) --

            The number of metadata files that were updated or deleted.

          • numberOfMetadataDocumentsScanned (integer) --

            The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

          • numberOfModifiedDocumentsIndexed (integer) --

            The number of modified source documents in the data source that were successfully indexed.

          • numberOfNewDocumentsIndexed (integer) --

            The number of new source documents in the data source that were successfully indexed.

        • status (string) --

          The status of the ingestion job.

        • updatedAt (datetime) --

          The time at which the ingestion job was last updated.

    • nextToken (string) --

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

StartIngestionJob (updated) Link ¶
Changes (response)
{'ingestionJob': {'statistics': {'numberOfMetadataDocumentsModified': 'long',
                                 'numberOfMetadataDocumentsScanned': 'long'}}}

Begins an ingestion job, in which a data source is added to a knowledge base.

See also: AWS API Documentation

Request Syntax

client.start_ingestion_job(
    clientToken='string',
    dataSourceId='string',
    description='string',
    knowledgeBaseId='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 dataSourceId

string

param dataSourceId

[REQUIRED]

The unique identifier of the data source to ingest.

type description

string

param description

A description of the ingestion job.

type knowledgeBaseId

string

param knowledgeBaseId

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'ingestionJob': {
        'dataSourceId': 'string',
        'description': 'string',
        'failureReasons': [
            'string',
        ],
        'ingestionJobId': 'string',
        'knowledgeBaseId': 'string',
        'startedAt': datetime(2015, 1, 1),
        'statistics': {
            'numberOfDocumentsDeleted': 123,
            'numberOfDocumentsFailed': 123,
            'numberOfDocumentsScanned': 123,
            'numberOfMetadataDocumentsModified': 123,
            'numberOfMetadataDocumentsScanned': 123,
            'numberOfModifiedDocumentsIndexed': 123,
            'numberOfNewDocumentsIndexed': 123
        },
        'status': 'STARTING'|'IN_PROGRESS'|'COMPLETE'|'FAILED',
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ingestionJob (dict) --

      An object containing information about the ingestion job.

      • dataSourceId (string) --

        The unique identifier of the ingested data source.

      • description (string) --

        The description of the ingestion job.

      • failureReasons (list) --

        A list of reasons that the ingestion job failed.

        • (string) --

      • ingestionJobId (string) --

        The unique identifier of the ingestion job.

      • knowledgeBaseId (string) --

        The unique identifier of the knowledge base to which the data source is being added.

      • startedAt (datetime) --

        The time at which the ingestion job started.

      • statistics (dict) --

        Contains statistics about the ingestion job.

        • numberOfDocumentsDeleted (integer) --

          The number of source documents that was deleted.

        • numberOfDocumentsFailed (integer) --

          The number of source documents that failed to be ingested.

        • numberOfDocumentsScanned (integer) --

          The total number of source documents that were scanned. Includes new, updated, and unchanged documents.

        • numberOfMetadataDocumentsModified (integer) --

          The number of metadata files that were updated or deleted.

        • numberOfMetadataDocumentsScanned (integer) --

          The total number of metadata files that were scanned. Includes new, updated, and unchanged files.

        • numberOfModifiedDocumentsIndexed (integer) --

          The number of modified source documents in the data source that were successfully indexed.

        • numberOfNewDocumentsIndexed (integer) --

          The number of new source documents in the data source that were successfully indexed.

      • status (string) --

        The status of the ingestion job.

      • updatedAt (datetime) --

        The time at which the ingestion job was last updated.