Skip to content

Commit 8cc6104

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): bedrock agents now supports long term memory and performance configs. Invokeflow supports performance configs. RetrieveAndGenerate performance configs
1 parent e4e1078 commit 8cc6104

File tree

9 files changed

+466
-29
lines changed

9 files changed

+466
-29
lines changed

clients/client-bedrock-agent-runtime/src/commands/DeleteAgentMemoryCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface DeleteAgentMemoryCommandOutput extends DeleteAgentMemoryRespons
4343
* agentId: "STRING_VALUE", // required
4444
* agentAliasId: "STRING_VALUE", // required
4545
* memoryId: "STRING_VALUE",
46+
* sessionId: "STRING_VALUE",
4647
* };
4748
* const command = new DeleteAgentMemoryCommand(input);
4849
* const response = await client.send(command);

clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts

+41-6
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
4949
* <p>To activate trace enablement, turn <code>enableTrace</code> to <code>true</code>. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events">Trace enablement</a>.</p>
5050
* </li>
5151
* <li>
52+
* <p>To stream agent responses, make sure that only orchestration prompt is enabled. Agent streaming is not supported for the following steps:
53+
* </p>
54+
* <ul>
55+
* <li>
56+
* <p>
57+
* <code>Pre-processing</code>
58+
* </p>
59+
* </li>
60+
* <li>
61+
* <p>
62+
* <code>Post-processing</code>
63+
* </p>
64+
* </li>
65+
* <li>
66+
* <p>Agent with 1 Knowledge base and <code>User Input</code> not enabled</p>
67+
* </li>
68+
* </ul>
69+
* </li>
70+
* <li>
5271
* <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p>
5372
* </li>
5473
* <li>
@@ -91,13 +110,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
91110
* httpMethod: "STRING_VALUE",
92111
* apiPath: "STRING_VALUE",
93112
* confirmationState: "CONFIRM" || "DENY",
113+
* responseState: "FAILURE" || "REPROMPT",
114+
* httpStatusCode: Number("int"),
94115
* responseBody: { // ResponseBody
95116
* "<keys>": { // ContentBody
96117
* body: "STRING_VALUE",
97118
* },
98119
* },
99-
* httpStatusCode: Number("int"),
100-
* responseState: "FAILURE" || "REPROMPT",
101120
* agentId: "STRING_VALUE",
102121
* },
103122
* functionResult: { // FunctionResult
@@ -251,6 +270,11 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
251270
* enableTrace: true || false,
252271
* inputText: "STRING_VALUE",
253272
* memoryId: "STRING_VALUE",
273+
* bedrockModelConfigurations: { // BedrockModelConfigurations
274+
* performanceConfig: { // PerformanceConfiguration
275+
* latency: "standard" || "optimized",
276+
* },
277+
* },
254278
* streamingConfigurations: { // StreamingConfigurations
255279
* streamFinalResponse: true || false,
256280
* applyGuardrailInterval: Number("int"),
@@ -535,13 +559,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
535559
* // httpMethod: "STRING_VALUE",
536560
* // apiPath: "STRING_VALUE",
537561
* // confirmationState: "CONFIRM" || "DENY",
562+
* // responseState: "FAILURE" || "REPROMPT",
563+
* // httpStatusCode: Number("int"),
538564
* // responseBody: { // ResponseBody
539565
* // "<keys>": { // ContentBody
540566
* // body: "STRING_VALUE",
541567
* // },
542568
* // },
543-
* // httpStatusCode: Number("int"),
544-
* // responseState: "FAILURE" || "REPROMPT",
545569
* // agentId: "STRING_VALUE",
546570
* // },
547571
* // functionResult: { // FunctionResult
@@ -798,13 +822,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
798822
* // httpMethod: "STRING_VALUE",
799823
* // apiPath: "STRING_VALUE",
800824
* // confirmationState: "CONFIRM" || "DENY",
825+
* // responseState: "FAILURE" || "REPROMPT",
826+
* // httpStatusCode: Number("int"),
801827
* // responseBody: {
802828
* // "<keys>": {
803829
* // body: "STRING_VALUE",
804830
* // },
805831
* // },
806-
* // httpStatusCode: Number("int"),
807-
* // responseState: "FAILURE" || "REPROMPT",
808832
* // agentId: "STRING_VALUE",
809833
* // },
810834
* // functionResult: {
@@ -1074,6 +1098,9 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
10741098
* // message: "STRING_VALUE",
10751099
* // resourceName: "STRING_VALUE",
10761100
* // },
1101+
* // modelNotReadyException: { // ModelNotReadyException
1102+
* // message: "STRING_VALUE",
1103+
* // },
10771104
* // files: { // FilePart
10781105
* // files: [ // OutputFiles
10791106
* // { // OutputFile
@@ -1112,6 +1139,14 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
11121139
* @throws {@link InternalServerException} (server fault)
11131140
* <p>An internal server error occurred. Retry your request.</p>
11141141
*
1142+
* @throws {@link ModelNotReadyException} (client fault)
1143+
* <p>
1144+
* The model specified in the request is not ready to serve inference requests. The AWS SDK
1145+
* will automatically retry the operation up to 5 times. For information about configuring
1146+
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
1147+
* reference guide.
1148+
* </p>
1149+
*
11151150
* @throws {@link ResourceNotFoundException} (client fault)
11161151
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
11171152
*

clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataB
6060
* },
6161
* ],
6262
* enableTrace: true || false,
63+
* modelPerformanceConfiguration: { // ModelPerformanceConfiguration
64+
* performanceConfig: { // PerformanceConfiguration
65+
* latency: "standard" || "optimized",
66+
* },
67+
* },
6368
* };
6469
* const command = new InvokeFlowCommand(input);
6570
* const response = await client.send(command);

clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
8989
* httpMethod: "STRING_VALUE",
9090
* apiPath: "STRING_VALUE",
9191
* confirmationState: "CONFIRM" || "DENY",
92+
* responseState: "FAILURE" || "REPROMPT",
93+
* httpStatusCode: Number("int"),
9294
* responseBody: { // ResponseBody
9395
* "<keys>": { // ContentBody
9496
* body: "STRING_VALUE",
9597
* },
9698
* },
97-
* httpStatusCode: Number("int"),
98-
* responseState: "FAILURE" || "REPROMPT",
9999
* agentId: "STRING_VALUE",
100100
* },
101101
* functionResult: { // FunctionResult
@@ -293,6 +293,11 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
293293
* ],
294294
* overrideLambda: "STRING_VALUE",
295295
* },
296+
* bedrockModelConfigurations: { // InlineBedrockModelConfigurations
297+
* performanceConfig: { // PerformanceConfiguration
298+
* latency: "standard" || "optimized",
299+
* },
300+
* },
296301
* };
297302
* const command = new InvokeInlineAgentCommand(input);
298303
* const response = await client.send(command);
@@ -572,13 +577,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
572577
* // httpMethod: "STRING_VALUE",
573578
* // apiPath: "STRING_VALUE",
574579
* // confirmationState: "CONFIRM" || "DENY",
580+
* // responseState: "FAILURE" || "REPROMPT",
581+
* // httpStatusCode: Number("int"),
575582
* // responseBody: { // ResponseBody
576583
* // "<keys>": { // ContentBody
577584
* // body: "STRING_VALUE",
578585
* // },
579586
* // },
580-
* // httpStatusCode: Number("int"),
581-
* // responseState: "FAILURE" || "REPROMPT",
582587
* // agentId: "STRING_VALUE",
583588
* // },
584589
* // functionResult: { // FunctionResult
@@ -835,13 +840,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
835840
* // httpMethod: "STRING_VALUE",
836841
* // apiPath: "STRING_VALUE",
837842
* // confirmationState: "CONFIRM" || "DENY",
843+
* // responseState: "FAILURE" || "REPROMPT",
844+
* // httpStatusCode: Number("int"),
838845
* // responseBody: {
839846
* // "<keys>": {
840847
* // body: "STRING_VALUE",
841848
* // },
842849
* // },
843-
* // httpStatusCode: Number("int"),
844-
* // responseState: "FAILURE" || "REPROMPT",
845850
* // agentId: "STRING_VALUE",
846851
* // },
847852
* // functionResult: {

clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts

+9
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
170170
* additionalModelRequestFields: {
171171
* "<keys>": "DOCUMENT_VALUE",
172172
* },
173+
* performanceConfig: { // PerformanceConfiguration
174+
* latency: "standard" || "optimized",
175+
* },
173176
* },
174177
* orchestrationConfiguration: { // OrchestrationConfiguration
175178
* promptTemplate: {
@@ -191,6 +194,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
191194
* queryTransformationConfiguration: { // QueryTransformationConfiguration
192195
* type: "QUERY_DECOMPOSITION", // required
193196
* },
197+
* performanceConfig: {
198+
* latency: "standard" || "optimized",
199+
* },
194200
* },
195201
* },
196202
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
@@ -229,6 +235,9 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
229235
* additionalModelRequestFields: {
230236
* "<keys>": "DOCUMENT_VALUE",
231237
* },
238+
* performanceConfig: {
239+
* latency: "standard" || "optimized",
240+
* },
232241
* },
233242
* },
234243
* },

clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts

+9
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
173173
* additionalModelRequestFields: {
174174
* "<keys>": "DOCUMENT_VALUE",
175175
* },
176+
* performanceConfig: { // PerformanceConfiguration
177+
* latency: "standard" || "optimized",
178+
* },
176179
* },
177180
* orchestrationConfiguration: { // OrchestrationConfiguration
178181
* promptTemplate: {
@@ -194,6 +197,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
194197
* queryTransformationConfiguration: { // QueryTransformationConfiguration
195198
* type: "QUERY_DECOMPOSITION", // required
196199
* },
200+
* performanceConfig: {
201+
* latency: "standard" || "optimized",
202+
* },
197203
* },
198204
* },
199205
* externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration
@@ -232,6 +238,9 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
232238
* additionalModelRequestFields: {
233239
* "<keys>": "DOCUMENT_VALUE",
234240
* },
241+
* performanceConfig: {
242+
* latency: "standard" || "optimized",
243+
* },
235244
* },
236245
* },
237246
* },

0 commit comments

Comments
 (0)