createAIWorkloadConfig method

Future<CreateAIWorkloadConfigResponse> createAIWorkloadConfig({
  1. required String aIWorkloadConfigName,
  2. AIWorkloadConfigs? aIWorkloadConfigs,
  3. AIDatasetConfig? datasetConfig,
  4. List<Tag>? tags,
})

Creates a reusable AI workload configuration that defines datasets, data sources, and benchmark tool settings for consistent performance testing of generative AI inference deployments on Amazon SageMaker AI.

May throw ResourceInUse. May throw ResourceLimitExceeded.

Parameter aIWorkloadConfigName : The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.

Parameter aIWorkloadConfigs : The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.

Parameter datasetConfig : The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.

Parameter tags : The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.

Implementation

Future<CreateAIWorkloadConfigResponse> createAIWorkloadConfig({
  required String aIWorkloadConfigName,
  AIWorkloadConfigs? aIWorkloadConfigs,
  AIDatasetConfig? datasetConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateAIWorkloadConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AIWorkloadConfigName': aIWorkloadConfigName,
      if (aIWorkloadConfigs != null) 'AIWorkloadConfigs': aIWorkloadConfigs,
      if (datasetConfig != null) 'DatasetConfig': datasetConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAIWorkloadConfigResponse.fromJson(jsonResponse.body);
}