Skip to content

Commit 6847057

Browse files
This release of the SDK has the API and documentation for the createcustommodel API. This feature lets you copy a Amazon SageMaker trained Amazon Nova model into Amazon Bedrock for inference.
1 parent a076d88 commit 6847057

27 files changed

+2090
-94
lines changed

docgenerator/AWSSDKDocSamples/Bedrock.GeneratedSamples.extra.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,23 @@
1919
</example>
2020
</value>
2121
</doc>
22+
<doc>
23+
<members>
24+
<member name="M:Amazon.Bedrock.IAmazonBedrock.CreateCustomModel(Amazon.Bedrock.Model.CreateCustomModelRequest)" />
25+
<member name="M:Amazon.Bedrock.AmazonBedrockClient.CreateCustomModel(Amazon.Bedrock.Model.CreateCustomModelRequest)" />
26+
<member name="T:Amazon.Bedrock.Model.CreateCustomModelRequest" />
27+
<member name="T:Amazon.Bedrock.Model.CreateCustomModelResponse" />
28+
</members>
29+
<value>
30+
<example>
31+
<para>
32+
33+
</para>
34+
<code
35+
title="Successful CreateCustomModel API call"
36+
source=".\AWSSDKDocSamples\Bedrock\Bedrock.GeneratedSamples.cs"
37+
region="example-1" />
38+
</example>
39+
</value>
40+
</doc>
2241
</docs>

docgenerator/AWSSDKDocSamples/Bedrock/Bedrock.GeneratedSamples.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,35 @@ public void BedrockBatchDeleteEvaluationJob()
3030
#endregion
3131
}
3232

33+
public void BedrockCreateCustomModel()
34+
{
35+
#region example-1
36+
37+
var client = new AmazonBedrockClient();
38+
var response = client.CreateCustomModel(new CreateCustomModelRequest
39+
{
40+
ClientRequestToken = "foo",
41+
ModelKmsKeyArn = "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
42+
ModelName = "SampleModel",
43+
ModelSourceConfig = new ModelDataSource { S3DataSource = new S3DataSource { S3Uri = "s3://my-bucket/folder" } },
44+
ModelTags = new List<Tag> {
45+
new Tag {
46+
Key = "foo",
47+
Value = "foo"
48+
},
49+
new Tag {
50+
Key = "foo",
51+
Value = "foo"
52+
}
53+
},
54+
RoleArn = "arn:aws:iam::123456789012:role/SampleRole"
55+
});
56+
57+
string modelArn = response.ModelArn;
58+
59+
#endregion
60+
}
61+
3362

3463
# region ISample Members
3564
public virtual void Run()

generator/ServiceModels/bedrock/bedrock-2023-04-20.api.json

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@
3131
{"shape":"ThrottlingException"}
3232
]
3333
},
34+
"CreateCustomModel":{
35+
"name":"CreateCustomModel",
36+
"http":{
37+
"method":"POST",
38+
"requestUri":"/custom-models/create-custom-model",
39+
"responseCode":200
40+
},
41+
"input":{"shape":"CreateCustomModelRequest"},
42+
"output":{"shape":"CreateCustomModelResponse"},
43+
"errors":[
44+
{"shape":"ResourceNotFoundException"},
45+
{"shape":"AccessDeniedException"},
46+
{"shape":"ValidationException"},
47+
{"shape":"ConflictException"},
48+
{"shape":"InternalServerException"},
49+
{"shape":"TooManyTagsException"},
50+
{"shape":"ServiceQuotaExceededException"},
51+
{"shape":"ThrottlingException"}
52+
]
53+
},
3454
"CreateEvaluationJob":{
3555
"name":"CreateEvaluationJob",
3656
"http":{
@@ -1290,6 +1310,31 @@
12901310
"type":"string",
12911311
"pattern":".*[a-z]{1,20}/.{1,20}.*"
12921312
},
1313+
"CreateCustomModelRequest":{
1314+
"type":"structure",
1315+
"required":[
1316+
"modelName",
1317+
"modelSourceConfig"
1318+
],
1319+
"members":{
1320+
"modelName":{"shape":"CustomModelName"},
1321+
"modelSourceConfig":{"shape":"ModelDataSource"},
1322+
"modelKmsKeyArn":{"shape":"KmsKeyArn"},
1323+
"roleArn":{"shape":"RoleArn"},
1324+
"modelTags":{"shape":"TagList"},
1325+
"clientRequestToken":{
1326+
"shape":"IdempotencyToken",
1327+
"idempotencyToken":true
1328+
}
1329+
}
1330+
},
1331+
"CreateCustomModelResponse":{
1332+
"type":"structure",
1333+
"required":["modelArn"],
1334+
"members":{
1335+
"modelArn":{"shape":"ModelArn"}
1336+
}
1337+
},
12931338
"CreateEvaluationJobRequest":{
12941339
"type":"structure",
12951340
"required":[
@@ -1656,7 +1701,7 @@
16561701
"type":"string",
16571702
"max":1011,
16581703
"min":20,
1659-
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}/[a-z0-9]{12}"
1704+
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:custom-model/(imported|[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}/[a-z0-9]{12})"
16601705
},
16611706
"CustomModelName":{
16621707
"type":"string",
@@ -1680,7 +1725,8 @@
16801725
"baseModelArn":{"shape":"ModelArn"},
16811726
"baseModelName":{"shape":"ModelName"},
16821727
"customizationType":{"shape":"CustomizationType"},
1683-
"ownerAccountId":{"shape":"AccountId"}
1728+
"ownerAccountId":{"shape":"AccountId"},
1729+
"modelStatus":{"shape":"ModelStatus"}
16841730
}
16851731
},
16861732
"CustomModelSummaryList":{
@@ -1710,7 +1756,8 @@
17101756
"enum":[
17111757
"FINE_TUNING",
17121758
"CONTINUED_PRE_TRAINING",
1713-
"DISTILLATION"
1759+
"DISTILLATION",
1760+
"IMPORTED"
17141761
]
17151762
},
17161763
"DataProcessingDetails":{
@@ -2398,10 +2445,6 @@
23982445
"required":[
23992446
"modelArn",
24002447
"modelName",
2401-
"jobArn",
2402-
"baseModelArn",
2403-
"trainingDataConfig",
2404-
"outputDataConfig",
24052448
"creationTime"
24062449
],
24072450
"members":{
@@ -2419,7 +2462,9 @@
24192462
"trainingMetrics":{"shape":"TrainingMetrics"},
24202463
"validationMetrics":{"shape":"ValidationMetrics"},
24212464
"creationTime":{"shape":"Timestamp"},
2422-
"customizationConfig":{"shape":"CustomizationConfig"}
2465+
"customizationConfig":{"shape":"CustomizationConfig"},
2466+
"modelStatus":{"shape":"ModelStatus"},
2467+
"failureMessage":{"shape":"ErrorMessage"}
24232468
}
24242469
},
24252470
"GetEvaluationJobRequest":{
@@ -2674,8 +2719,8 @@
26742719
"clientRequestToken":{"shape":"IdempotencyToken"},
26752720
"roleArn":{"shape":"RoleArn"},
26762721
"status":{"shape":"ModelCustomizationJobStatus"},
2677-
"failureMessage":{"shape":"ErrorMessage"},
26782722
"statusDetails":{"shape":"StatusDetails"},
2723+
"failureMessage":{"shape":"ErrorMessage"},
26792724
"creationTime":{"shape":"Timestamp"},
26802725
"lastModifiedTime":{"shape":"Timestamp"},
26812726
"endTime":{"shape":"Timestamp"},
@@ -3948,6 +3993,11 @@
39483993
"shape":"Boolean",
39493994
"location":"querystring",
39503995
"locationName":"isOwned"
3996+
},
3997+
"modelStatus":{
3998+
"shape":"ModelStatus",
3999+
"location":"querystring",
4000+
"locationName":"modelStatus"
39514001
}
39524002
}
39534003
},
@@ -4585,7 +4635,7 @@
45854635
"type":"string",
45864636
"max":1011,
45874637
"min":20,
4588-
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}(([:][a-z0-9-]{1,63}){0,2})?/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}))"
4638+
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/((imported)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))(([:][a-z0-9-]{1,63}){0,2})?/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}))"
45894639
},
45904640
"ModelCopyJobArn":{
45914641
"type":"string",
@@ -4682,8 +4732,8 @@
46824732
"baseModelArn":{"shape":"ModelArn"},
46834733
"jobName":{"shape":"JobName"},
46844734
"status":{"shape":"ModelCustomizationJobStatus"},
4685-
"lastModifiedTime":{"shape":"Timestamp"},
46864735
"statusDetails":{"shape":"StatusDetails"},
4736+
"lastModifiedTime":{"shape":"Timestamp"},
46874737
"creationTime":{"shape":"Timestamp"},
46884738
"endTime":{"shape":"Timestamp"},
46894739
"customModelArn":{"shape":"CustomModelArn"},
@@ -4712,7 +4762,7 @@
47124762
"type":"string",
47134763
"max":2048,
47144764
"min":1,
4715-
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}(([:][a-z0-9-]{1,63}){0,2})?/[a-z0-9]{12})|(:foundation-model/([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})))|(([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2}))|(([0-9a-zA-Z][_-]?)+)"
4765+
"pattern":"arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/((imported)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))(([:][a-z0-9-]{1,63}){0,2})?/[a-z0-9]{12})|(:foundation-model/([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})))|(([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2}))|(([0-9a-zA-Z][_-]?)+)"
47164766
},
47174767
"ModelImportJobArn":{
47184768
"type":"string",
@@ -4891,6 +4941,14 @@
48914941
"min":0,
48924942
"pattern":".*arn:aws:sagemaker:.*:hub-content/SageMakerPublicHub/Model/.*"
48934943
},
4944+
"ModelStatus":{
4945+
"type":"string",
4946+
"enum":[
4947+
"Active",
4948+
"Creating",
4949+
"Failed"
4950+
]
4951+
},
48944952
"NonBlankString":{
48954953
"type":"string",
48964954
"pattern":"[\\s\\S]*"
@@ -5546,7 +5604,7 @@
55465604
"type":"string",
55475605
"max":1011,
55485606
"min":20,
5549-
"pattern":".*(^[a-zA-Z0-9][a-zA-Z0-9\\-]*$)|(^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:([0-9]{12}|)((:(fine-tuning-job|model-customization-job|custom-model)/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}(/[a-z0-9]{12})$)|(:guardrail/[a-z0-9]+$)|(:automated-reasoning-policy/[a-zA-Z0-9]+(:[a-zA-Z0-9]+)?$)|(:(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+$)|(:(provisioned-model|model-invocation-job|model-evaluation-job|evaluation-job|model-import-job|imported-model|async-invoke|provisioned-model-v2|provisioned-model-reservation|prompt-router)/[a-z0-9]{12}$))).*"
5607+
"pattern":".*(^[a-zA-Z0-9][a-zA-Z0-9\\-]*$)|(^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:custom-model/([a-z0-9-]{1,63}[.][a-z0-9-]{1,63}(([:][a-z0-9-]{1,63}){0,2})?|imported)/[a-z0-9]{12}$)|(^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:([0-9]{12}|)((:(fine-tuning-job|model-customization-job)/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}(/[a-z0-9]{12})$)|(:guardrail/[a-z0-9]+$)|(:automated-reasoning-policy/[a-zA-Z0-9]+(:[a-zA-Z0-9]+)?$)|(:(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+$)|(:(provisioned-model|model-invocation-job|model-evaluation-job|evaluation-job|model-import-job|imported-model|async-invoke|provisioned-model-v2|provisioned-model-reservation|prompt-router|custom-model-deployment)/[a-z0-9]{12}$))).*"
55505608
},
55515609
"TeacherModelConfig":{
55525610
"type":"structure",

0 commit comments

Comments
 (0)