Skip to content

Commit 5d6ce60

Browse files
Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier.
1 parent fa5ea35 commit 5d6ce60

File tree

12 files changed

+47
-44
lines changed

12 files changed

+47
-44
lines changed

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.api.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"type":"string",
8888
"max":2048,
8989
"min":1,
90-
"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]{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})|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([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][_-]?)+)$"
90+
"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]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$"
9191
},
9292
"InvokeModelRequest":{
9393
"type":"structure",
@@ -257,6 +257,7 @@
257257
"chunk":{"shape":"PayloadPart"},
258258
"internalServerException":{"shape":"InternalServerException"},
259259
"modelStreamErrorException":{"shape":"ModelStreamErrorException"},
260+
"modelTimeoutException":{"shape":"ModelTimeoutException"},
260261
"throttlingException":{"shape":"ThrottlingException"},
261262
"validationException":{"shape":"ValidationException"}
262263
},

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.docs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"version": "2.0",
33
"service": "<p>Describes the API operations for running inference using Bedrock models.</p>",
44
"operations": {
5-
"InvokeModel": "<p>Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.</p> <p>For more information about invoking models, see Using the API in the <a href=\"https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf\">Bedrock User Guide</a>.</p> <p>For example requests, see Examples (after the Errors section).</p>",
6-
"InvokeModelWithResponseStream": "<p>Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.</p> <p>For more information about invoking models, see Using the API in the <a href=\"https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf\">Bedrock User Guide</a>.</p> <p>For an example request and response, see Examples (after the Errors section).</p>"
5+
"InvokeModel": "<p>Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For example requests, see Examples (after the Errors section).</p>",
6+
"InvokeModelWithResponseStream": "<p>Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For an example request and response, see Examples (after the Errors section).</p>"
77
},
88
"shapes": {
99
"AccessDeniedException": {
@@ -82,6 +82,7 @@
8282
"ModelTimeoutException": {
8383
"base": "<p>The request took too long to process. Processing time exceeded the model timeout length.</p>",
8484
"refs": {
85+
"ResponseStream$modelTimeoutException": null
8586
}
8687
},
8788
"NonBlankString": {

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.normal.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{"shape":"ServiceQuotaExceededException"},
3333
{"shape":"ModelErrorException"}
3434
],
35-
"documentation":"<p>Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.</p> <p>For more information about invoking models, see Using the API in the <a href=\"https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf\">Bedrock User Guide</a>.</p> <p>For example requests, see Examples (after the Errors section).</p>"
35+
"documentation":"<p>Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For example requests, see Examples (after the Errors section).</p>"
3636
},
3737
"InvokeModelWithResponseStream":{
3838
"name":"InvokeModelWithResponseStream",
@@ -55,7 +55,7 @@
5555
{"shape":"ServiceQuotaExceededException"},
5656
{"shape":"ModelErrorException"}
5757
],
58-
"documentation":"<p>Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.</p> <p>For more information about invoking models, see Using the API in the <a href=\"https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf\">Bedrock User Guide</a>.</p> <p>For an example request and response, see Examples (after the Errors section).</p>"
58+
"documentation":"<p>Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html\">Run inference</a> in the Bedrock User Guide.</p> <p>For an example request and response, see Examples (after the Errors section).</p>"
5959
}
6060
},
6161
"shapes":{
@@ -91,7 +91,7 @@
9191
"type":"string",
9292
"max":2048,
9393
"min":1,
94-
"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]{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})|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([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][_-]?)+)$"
94+
"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]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$"
9595
},
9696
"InvokeModelRequest":{
9797
"type":"structure",
@@ -305,6 +305,7 @@
305305
},
306306
"internalServerException":{"shape":"InternalServerException"},
307307
"modelStreamErrorException":{"shape":"ModelStreamErrorException"},
308+
"modelTimeoutException":{"shape":"ModelTimeoutException"},
308309
"throttlingException":{"shape":"ThrottlingException"},
309310
"validationException":{"shape":"ValidationException"}
310311
},

sdk/code-analysis/ServiceAnalysis/BedrockRuntime/Generated/PropertyValueRules.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<property>Amazon.BedrockRuntime.Model.InvokeModelRequest.ModelId</property>
1010
<min>1</min>
1111
<max>2048</max>
12-
<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]{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})|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([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][_-]?)+)$</pattern>
12+
<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]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$</pattern>
1313
</property-value-rule>
1414
<property-value-rule>
1515
<property>Amazon.BedrockRuntime.Model.InvokeModelResponse.Body</property>
@@ -25,7 +25,7 @@
2525
<property>Amazon.BedrockRuntime.Model.InvokeModelWithResponseStreamRequest.ModelId</property>
2626
<min>1</min>
2727
<max>2048</max>
28-
<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]{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})|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([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][_-]?)+)$</pattern>
28+
<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]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$</pattern>
2929
</property-value-rule>
3030
<property-value-rule>
3131
<property>Amazon.BedrockRuntime.Model.ModelErrorException.OriginalStatusCode</property>

sdk/src/Services/BedrockRuntime/Generated/Model/InvokeModelRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace Amazon.BedrockRuntime.Model
3636
///
3737
///
3838
/// <para>
39-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
40-
/// User Guide</a>.
39+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
40+
/// inference</a> in the Bedrock User Guide.
4141
/// </para>
4242
///
4343
/// <para>

sdk/src/Services/BedrockRuntime/Generated/Model/InvokeModelWithResponseStreamRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ namespace Amazon.BedrockRuntime.Model
3535
///
3636
///
3737
/// <para>
38-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
39-
/// User Guide</a>.
38+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
39+
/// inference</a> in the Bedrock User Guide.
4040
/// </para>
4141
///
4242
/// <para>

sdk/src/Services/BedrockRuntime/Generated/_bcl35/AmazonBedrockRuntimeClient.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ protected override void Dispose(bool disposing)
254254
///
255255
///
256256
/// <para>
257-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
258-
/// User Guide</a>.
257+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
258+
/// inference</a> in the Bedrock User Guide.
259259
/// </para>
260260
///
261261
/// <para>
@@ -346,8 +346,8 @@ public virtual InvokeModelResponse EndInvokeModel(IAsyncResult asyncResult)
346346
///
347347
///
348348
/// <para>
349-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
350-
/// User Guide</a>.
349+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
350+
/// inference</a> in the Bedrock User Guide.
351351
/// </para>
352352
///
353353
/// <para>

sdk/src/Services/BedrockRuntime/Generated/_bcl35/IAmazonBedrockRuntime.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
4848
///
4949
///
5050
/// <para>
51-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
52-
/// User Guide</a>.
51+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
52+
/// inference</a> in the Bedrock User Guide.
5353
/// </para>
5454
///
5555
/// <para>
@@ -126,8 +126,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
126126
///
127127
///
128128
/// <para>
129-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
130-
/// User Guide</a>.
129+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
130+
/// inference</a> in the Bedrock User Guide.
131131
/// </para>
132132
///
133133
/// <para>

sdk/src/Services/BedrockRuntime/Generated/_bcl45/AmazonBedrockRuntimeClient.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ protected override void Dispose(bool disposing)
257257
///
258258
///
259259
/// <para>
260-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
261-
/// User Guide</a>.
260+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
261+
/// inference</a> in the Bedrock User Guide.
262262
/// </para>
263263
///
264264
/// <para>
@@ -313,8 +313,8 @@ public virtual InvokeModelResponse InvokeModel(InvokeModelRequest request)
313313
///
314314
///
315315
/// <para>
316-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
317-
/// User Guide</a>.
316+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
317+
/// inference</a> in the Bedrock User Guide.
318318
/// </para>
319319
///
320320
/// <para>
@@ -375,8 +375,8 @@ public virtual InvokeModelResponse InvokeModel(InvokeModelRequest request)
375375
///
376376
///
377377
/// <para>
378-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
379-
/// User Guide</a>.
378+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
379+
/// inference</a> in the Bedrock User Guide.
380380
/// </para>
381381
///
382382
/// <para>
@@ -433,8 +433,8 @@ public virtual InvokeModelWithResponseStreamResponse InvokeModelWithResponseStre
433433
///
434434
///
435435
/// <para>
436-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
437-
/// User Guide</a>.
436+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
437+
/// inference</a> in the Bedrock User Guide.
438438
/// </para>
439439
///
440440
/// <para>

sdk/src/Services/BedrockRuntime/Generated/_bcl45/IAmazonBedrockRuntime.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
4848
///
4949
///
5050
/// <para>
51-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
52-
/// User Guide</a>.
51+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
52+
/// inference</a> in the Bedrock User Guide.
5353
/// </para>
5454
///
5555
/// <para>
@@ -98,8 +98,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
9898
///
9999
///
100100
/// <para>
101-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
102-
/// User Guide</a>.
101+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
102+
/// inference</a> in the Bedrock User Guide.
103103
/// </para>
104104
///
105105
/// <para>
@@ -153,8 +153,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
153153
///
154154
///
155155
/// <para>
156-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
157-
/// User Guide</a>.
156+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
157+
/// inference</a> in the Bedrock User Guide.
158158
/// </para>
159159
///
160160
/// <para>
@@ -205,8 +205,8 @@ public partial interface IAmazonBedrockRuntime : IAmazonService, IDisposable
205205
///
206206
///
207207
/// <para>
208-
/// For more information about invoking models, see Using the API in the <a href="https://d2eo22ngex1n9g.cloudfront.net/Documentation/BedrockUserGuide.pdf">Bedrock
209-
/// User Guide</a>.
208+
/// For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run
209+
/// inference</a> in the Bedrock User Guide.
210210
/// </para>
211211
///
212212
/// <para>

0 commit comments

Comments
 (0)