Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Manage dataset versions
Use CreateDatasetVersion to publish the current Draft as an immutable numbered version. The Draft persists unchanged after publishing — draftStatus changes from MODIFIED to UNMODIFIED.
CreateDatasetVersion
The following examples show how to publish a version:
Example
- AgentCore CLI
-
-
agentcore eval dataset publish --id <DATASET_ID>
The command returns the new datasetVersion while the dataset is still UPDATING. Run agentcore eval dataset get --id <DATASET_ID> --version <VERSION> until the status is ACTIVE before you download the version.
- AgentCore SDK
-
-
from bedrock_agentcore.evaluation import DatasetClient
client = DatasetClient(region_name="us-west-2")
ds = client.create_dataset_version_and_wait(datasetId="my-dataset-id")
print(f"Published, draftStatus: {ds.get('draftStatus')}")
-
Amazon SDK
-
-
import boto3
client = boto3.client('bedrock-agentcore-control')
client.create_dataset_version(datasetId='my-dataset-id')
-
Amazon CLI
-
-
aws bedrock-agentcore-control create-dataset-version \
--dataset-id my-dataset-id
ListDatasetVersions
Returns published versions sorted newest first. Each version summary includes datasetVersion, exampleCount, and createdAt.
The following examples show how to list versions:
Example
- AgentCore SDK
-
-
from bedrock_agentcore.evaluation import DatasetClient
client = DatasetClient(region_name="us-west-2")
resp = client.list_dataset_versions(datasetId="my-dataset-id")
for v in resp["versions"]:
print(f" Version {v['datasetVersion']}: {v['exampleCount']} examples")
-
Amazon SDK
-
-
import boto3
client = boto3.client('bedrock-agentcore-control')
resp = client.list_dataset_versions(datasetId='my-dataset-id')
for v in resp['versions']:
print(f" Version {v['datasetVersion']}: {v['exampleCount']} examples")
-
Amazon CLI
-
-
aws bedrock-agentcore-control list-dataset-versions \
--dataset-id my-dataset-id