BedrockAgentCoreControl / Client / create_dataset
create_dataset¶
- BedrockAgentCoreControl.Client.create_dataset(**kwargs)¶
Creates a new dataset resource asynchronously. Returns immediately with status CREATING. Poll
GetDatasetuntil status transitions to ACTIVE or CREATE_FAILED.See also: AWS API Documentation
Request Syntax
response = client.create_dataset( clientToken='string', datasetName='string', description='string', source={ 'inlineExamples': { 'examples': [ {...}|[...]|123|123.4|'string'|True|None, ] }, 's3Source': { 's3Uri': 'string' } }, schemaType='AGENTCORE_EVALUATION_PREDEFINED_V1'|'AGENTCORE_EVALUATION_SIMULATED_V1', kmsKeyArn='string', tags={ 'string': 'string' } )
- Parameters:
clientToken (string) –
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.
This field is autopopulated if not provided.
datasetName (string) –
[REQUIRED]
Human-readable name for the dataset. Must be unique within the account. Immutable after creation.
description (string) – A description of the dataset.
source (dict) –
[REQUIRED]
Source of initial examples. Provide either inline examples or an S3 URI pointing to a JSONL file.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
inlineExamples,s3Source.inlineExamples (dict) –
Inline examples provided directly in the request body.
examples (list) – [REQUIRED]
Examples to add. Each example is assigned an auto-generated UUID.
(document) –
s3Source (dict) –
Amazon S3 URI pointing to a JSONL file in the customer’s bucket.
s3Uri (string) – [REQUIRED]
Amazon S3 URI of the JSONL file (for example,
s3://my-bucket/path/to/examples.jsonl).
schemaType (string) –
[REQUIRED]
Versioned schema type governing the structure of examples. Immutable after creation.
kmsKeyArn (string) – Optional KMS key ARN for server-side encryption on service Amazon S3 writes.
tags (dict) –
A map of tag keys and values to assign to the dataset.
(string) –
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'datasetArn': 'string', 'datasetId': 'string', 'status': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED', 'createdAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
datasetArn (string) –
The Amazon Resource Name (ARN) of the created dataset.
datasetId (string) –
The unique identifier of the created dataset.
status (string) –
Always CREATING immediately after this call. Poll
GetDatasetuntil status transitions to ACTIVE or CREATE_FAILED.createdAt (datetime) –
The timestamp when the dataset was created.
Exceptions
BedrockAgentCoreControl.Client.exceptions.ServiceQuotaExceededExceptionBedrockAgentCoreControl.Client.exceptions.ValidationExceptionBedrockAgentCoreControl.Client.exceptions.ConflictExceptionBedrockAgentCoreControl.Client.exceptions.AccessDeniedExceptionBedrockAgentCoreControl.Client.exceptions.ThrottlingExceptionBedrockAgentCoreControl.Client.exceptions.InternalServerException