Skip to main content

dataset_examples

Creates, updates, deletes, gets or lists a dataset_examples resource.

Overview

Namedataset_examples
TypeResource
Idaws.bedrock_agentcore_control.dataset_examples

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
exampleobjectPaginated example content. Each element is a JSON object containing at least an exampleId field plus the schema-specific content fields.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_dataset_examplesselectdataset_id, regiondatasetVersion, maxResults, nextTokenReturns paginated examples from the dataset. The server embeds the resolved version in the pagination token. Once pagination begins, all subsequent pages are pinned to that version regardless of concurrent mutations.
add_dataset_examplesupdatedataset_id, region, sourceAdds examples to the dataset's DRAFT. All examples are validated against the dataset's schema type before any writes occur. If any example fails validation, the entire batch is rejected (all-or-nothing semantics).
update_dataset_examplesupdatedataset_id, region, examplesUpdates multiple existing examples in-place on DRAFT. All examples are validated against the dataset's schema type before any writes occur. If any example fails validation, the entire batch is rejected (all-or-nothing semantics).
delete_dataset_examplesdeletedataset_id, regionDeletes specific examples by ID from DRAFT. All example IDs are validated before any deletes occur. If any ID does not exist in DRAFT, the entire batch is rejected (all-or-nothing semantics).

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
dataset_idstringThe unique identifier of the dataset.
regionstringAWS region (default: us-east-1)
datasetVersionstringVersion to paginate: "DRAFT" or a version number. Defaults to DRAFT if absent. Only used on the first request; for subsequent pages, the version is extracted from the pagination token.
maxResultsintegerMaximum number of examples to return per page.
nextTokenstringThe token for the next page of results.

SELECT examples

Returns paginated examples from the dataset. The server embeds the resolved version in the pagination token. Once pagination begins, all subsequent pages are pinned to that version regardless of concurrent mutations.

SELECT
example
FROM aws.bedrock_agentcore_control.dataset_examples
WHERE dataset_id = '{{ dataset_id }}' -- required
AND region = '{{ region }}' -- required
AND datasetVersion = '{{ datasetVersion }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

UPDATE examples

Adds examples to the dataset's DRAFT. All examples are validated against the dataset's schema type before any writes occur. If any example fails validation, the entire batch is rejected (all-or-nothing semantics).

UPDATE aws.bedrock_agentcore_control.dataset_examples
SET
clientToken = '{{ clientToken }}',
source = '{{ source }}'
WHERE
dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
AND source = '{{ source }}' --required
RETURNING
added_count,
dataset_arn,
dataset_id,
example_ids,
status,
updated_at;

DELETE examples

Deletes specific examples by ID from DRAFT. All example IDs are validated before any deletes occur. If any ID does not exist in DRAFT, the entire batch is rejected (all-or-nothing semantics).

DELETE FROM aws.bedrock_agentcore_control.dataset_examples
WHERE dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
;