Skip to content

Commit 95e9dd3

Browse files
Add a 'reason' field to InternalServerException
1 parent dd68f58 commit 95e9dd3

12 files changed

+74
-13
lines changed

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.api.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,8 @@
17771777
"InternalServerException":{
17781778
"type":"structure",
17791779
"members":{
1780-
"message":{"shape":"NonBlankString"}
1780+
"message":{"shape":"NonBlankString"},
1781+
"reason":{"shape":"String"}
17811782
},
17821783
"error":{"httpStatusCode":500},
17831784
"exception":true,

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.docs.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"Rerank": "<p>Reranks the relevance of sources based on queries. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html\">Improve the relevance of query responses with a reranker model</a>.</p>",
1313
"Retrieve": "<p>Queries a knowledge base and retrieves information from it.</p>",
1414
"RetrieveAndGenerate": "<p>Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html\">inference profile</a>. The response only cites sources that are relevant to the query.</p>",
15-
"RetrieveAndGenerateStream": "<p>Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p> </note>"
15+
"RetrieveAndGenerateStream": "<p>Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p> </note> <p>This operation requires permission for the <code> bedrock:RetrieveAndGenerate</code> action.</p>"
1616
},
1717
"shapes": {
1818
"APISchema": {
@@ -2600,6 +2600,7 @@
26002600
"InlineAgentReturnControlPayload$invocationId": "<p>The identifier of the action group invocation. </p>",
26012601
"InlineSessionState$invocationId": "<p> The identifier of the invocation of an action. This value must match the <code>invocationId</code> returned in the <code>InvokeInlineAgent</code> response for the action whose results are provided in the <code>returnControlInvocationResults</code> field. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html\">Return control to the agent developer</a>. </p>",
26022602
"InputFile$name": "<p>The name of the source file.</p>",
2603+
"InternalServerException$reason": "<p>The reason for the exception. If the reason is <code>BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE</code>, the model invocation service is unavailable. Retry your request.</p>",
26032604
"OutputFile$name": "<p>The name of the file containing response from code interpreter.</p>",
26042605
"Parameter$name": "<p>The name of the parameter.</p>",
26052606
"Parameter$type": "<p>The type of the parameter.</p>",

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.normal.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
{"shape":"AccessDeniedException"},
254254
{"shape":"ServiceQuotaExceededException"}
255255
],
256-
"documentation":"<p>Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p> </note>"
256+
"documentation":"<p>Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeModelWithResponseStream</code>.</p> </note> <p>This operation requires permission for the <code> bedrock:RetrieveAndGenerate</code> action.</p>"
257257
}
258258
},
259259
"shapes":{
@@ -2666,7 +2666,11 @@
26662666
"InternalServerException":{
26672667
"type":"structure",
26682668
"members":{
2669-
"message":{"shape":"NonBlankString"}
2669+
"message":{"shape":"NonBlankString"},
2670+
"reason":{
2671+
"shape":"String",
2672+
"documentation":"<p>The reason for the exception. If the reason is <code>BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE</code>, the model invocation service is unavailable. Retry your request.</p>"
2673+
}
26702674
},
26712675
"documentation":"<p>An internal server error occurred. Retry your request.</p>",
26722676
"error":{"httpStatusCode":500},

sdk/src/Services/BedrockAgentRuntime/Generated/Model/Internal/MarshallTransformations/InternalServerExceptionUnmarshaller.cs

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ public InternalServerException Unmarshall(JsonUnmarshallerContext context, Amazo
6565
int targetDepth = context.CurrentDepth;
6666
while (context.ReadAtDepth(targetDepth))
6767
{
68+
if (context.TestExpression("reason", targetDepth))
69+
{
70+
var unmarshaller = StringUnmarshaller.Instance;
71+
unmarshalledObject.Reason = unmarshaller.Unmarshall(context);
72+
continue;
73+
}
6874
}
6975

7076
return unmarshalledObject;

sdk/src/Services/BedrockAgentRuntime/Generated/Model/InternalServerException.cs

+22
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace Amazon.BedrockAgentRuntime.Model
3737
#endif
3838
public partial class InternalServerException : AmazonBedrockAgentRuntimeException
3939
{
40+
private string _reason;
4041

4142
/// <summary>
4243
/// Constructs a new InternalServerException with the specified error
@@ -98,6 +99,7 @@ public InternalServerException(string message, Amazon.Runtime.ErrorType errorTyp
9899
protected InternalServerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
99100
: base(info, context)
100101
{
102+
this.Reason = (string)info.GetValue("Reason", typeof(string));
101103
}
102104

103105
/// <summary>
@@ -118,8 +120,28 @@ protected InternalServerException(System.Runtime.Serialization.SerializationInfo
118120
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
119121
{
120122
base.GetObjectData(info, context);
123+
info.AddValue("Reason", this.Reason);
121124
}
122125
#endif
123126

127+
/// <summary>
128+
/// Gets and sets the property Reason.
129+
/// <para>
130+
/// The reason for the exception. If the reason is <c>BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE</c>,
131+
/// the model invocation service is unavailable. Retry your request.
132+
/// </para>
133+
/// </summary>
134+
public string Reason
135+
{
136+
get { return this._reason; }
137+
set { this._reason = value; }
138+
}
139+
140+
// Check to see if Reason property is set
141+
internal bool IsSetReason()
142+
{
143+
return this._reason != null;
144+
}
145+
124146
}
125147
}

sdk/src/Services/BedrockAgentRuntime/Generated/Model/RetrieveAndGenerateStreamRequest.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ namespace Amazon.BedrockAgentRuntime.Model
3838
/// <para>
3939
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
4040
/// </para>
41-
/// </note>
41+
/// </note>
42+
/// <para>
43+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
44+
/// </para>
4245
/// </summary>
4346
public partial class RetrieveAndGenerateStreamRequest : AmazonBedrockAgentRuntimeRequest
4447
{

sdk/src/Services/BedrockAgentRuntime/Generated/_bcl35/AmazonBedrockAgentRuntimeClient.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,10 @@ public virtual RetrieveAndGenerateResponse EndRetrieveAndGenerate(IAsyncResult a
12381238
/// <para>
12391239
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
12401240
/// </para>
1241-
/// </note>
1241+
/// </note>
1242+
/// <para>
1243+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1244+
/// </para>
12421245
/// </summary>
12431246
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
12441247
///

sdk/src/Services/BedrockAgentRuntime/Generated/_bcl35/IAmazonBedrockAgentRuntime.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,10 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl
880880
/// <para>
881881
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
882882
/// </para>
883-
/// </note>
883+
/// </note>
884+
/// <para>
885+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
886+
/// </para>
884887
/// </summary>
885888
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
886889
///

sdk/src/Services/BedrockAgentRuntime/Generated/_bcl45/AmazonBedrockAgentRuntimeClient.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,10 @@ public virtual RetrieveAndGenerateResponse RetrieveAndGenerate(RetrieveAndGenera
15331533
/// <para>
15341534
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
15351535
/// </para>
1536-
/// </note>
1536+
/// </note>
1537+
/// <para>
1538+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1539+
/// </para>
15371540
/// </summary>
15381541
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
15391542
///
@@ -1588,7 +1591,10 @@ public virtual RetrieveAndGenerateStreamResponse RetrieveAndGenerateStream(Retri
15881591
/// <para>
15891592
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
15901593
/// </para>
1591-
/// </note>
1594+
/// </note>
1595+
/// <para>
1596+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1597+
/// </para>
15921598
/// </summary>
15931599
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
15941600
/// <param name="cancellationToken">

sdk/src/Services/BedrockAgentRuntime/Generated/_bcl45/IAmazonBedrockAgentRuntime.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,10 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl
11821182
/// <para>
11831183
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
11841184
/// </para>
1185-
/// </note>
1185+
/// </note>
1186+
/// <para>
1187+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1188+
/// </para>
11861189
/// </summary>
11871190
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
11881191
///
@@ -1231,7 +1234,10 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl
12311234
/// <para>
12321235
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
12331236
/// </para>
1234-
/// </note>
1237+
/// </note>
1238+
/// <para>
1239+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1240+
/// </para>
12351241
/// </summary>
12361242
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
12371243
/// <param name="cancellationToken">

sdk/src/Services/BedrockAgentRuntime/Generated/_netstandard/AmazonBedrockAgentRuntimeClient.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,10 @@ internal virtual RetrieveAndGenerateStreamResponse RetrieveAndGenerateStream(Ret
10531053
/// <para>
10541054
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
10551055
/// </para>
1056-
/// </note>
1056+
/// </note>
1057+
/// <para>
1058+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
1059+
/// </para>
10571060
/// </summary>
10581061
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
10591062
/// <param name="cancellationToken">

sdk/src/Services/BedrockAgentRuntime/Generated/_netstandard/IAmazonBedrockAgentRuntime.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,10 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl
659659
/// <para>
660660
/// The CLI doesn't support streaming operations in Amazon Bedrock, including <c>InvokeModelWithResponseStream</c>.
661661
/// </para>
662-
/// </note>
662+
/// </note>
663+
/// <para>
664+
/// This operation requires permission for the <c> bedrock:RetrieveAndGenerate</c> action.
665+
/// </para>
663666
/// </summary>
664667
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerateStream service method.</param>
665668
/// <param name="cancellationToken">

0 commit comments

Comments
 (0)