Skip to content

Bedrock Agentcore Control  >  Operations  >  update_dataset_examples

update_dataset_examples

Operation

update_dataset_examples async

update_dataset_examples(input: UpdateDatasetExamplesInput, plugins: list[Plugin] | None = None) -> UpdateDatasetExamplesOutput

Updates 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).

Parameters:

Name Type Description Default
input UpdateDatasetExamplesInput

An instance of UpdateDatasetExamplesInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
UpdateDatasetExamplesOutput

An instance of UpdateDatasetExamplesOutput.

Input

UpdateDatasetExamplesInput dataclass

Dataclass for UpdateDatasetExamplesInput structure.

Attributes

client_token class-attribute instance-attribute
client_token: str | None = None

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

dataset_id class-attribute instance-attribute
dataset_id: str | None = None

The unique identifier of the dataset.

examples class-attribute instance-attribute
examples: list[Document] | None = None

Examples to update. Each element is a JSON object containing a required exampleId field identifying the existing example, plus the replacement fields. Maximum 1000 examples per call.

Output

UpdateDatasetExamplesOutput dataclass

Dataclass for UpdateDatasetExamplesOutput structure.

Attributes

dataset_arn instance-attribute
dataset_arn: str

The Amazon Resource Name (ARN) of the dataset.

dataset_id instance-attribute
dataset_id: str

The unique identifier of the dataset.

status instance-attribute
status: DatasetStatus

The current status of the dataset.

updated_at instance-attribute
updated_at: datetime

The timestamp when the examples were updated.

updated_count instance-attribute
updated_count: int

The number of examples updated.