Skip to content

Commit c69abf3

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): Custom Orchestration and Streaming configurations API release for AWSBedrockAgents.
1 parent c1ea3a8 commit c69abf3

File tree

5 files changed

+215
-0
lines changed

5 files changed

+215
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
200200
* enableTrace: true || false,
201201
* inputText: "STRING_VALUE",
202202
* memoryId: "STRING_VALUE",
203+
* streamingConfigurations: { // StreamingConfigurations
204+
* streamFinalResponse: true || false,
205+
* applyGuardrailInterval: Number("int"),
206+
* },
203207
* };
204208
* const command = new InvokeAgentCommand(input);
205209
* const response = await client.send(command);
@@ -566,6 +570,12 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
566570
* // traceId: "STRING_VALUE",
567571
* // failureReason: "STRING_VALUE",
568572
* // },
573+
* // customOrchestrationTrace: { // CustomOrchestrationTrace
574+
* // traceId: "STRING_VALUE",
575+
* // event: { // CustomOrchestrationTraceEvent
576+
* // text: "STRING_VALUE",
577+
* // },
578+
* // },
569579
* // },
570580
* // agentId: "STRING_VALUE",
571581
* // agentAliasId: "STRING_VALUE",

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,12 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
620620
* // traceId: "STRING_VALUE",
621621
* // failureReason: "STRING_VALUE",
622622
* // },
623+
* // customOrchestrationTrace: { // CustomOrchestrationTrace
624+
* // traceId: "STRING_VALUE",
625+
* // event: { // CustomOrchestrationTraceEvent
626+
* // text: "STRING_VALUE",
627+
* // },
628+
* // },
623629
* // },
624630
* // },
625631
* // returnControl: { // InlineAgentReturnControlPayload

clients/client-bedrock-agent-runtime/src/models/models_0.ts

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,30 @@ export namespace InvocationResultMember {
18761876
};
18771877
}
18781878

1879+
/**
1880+
* <p>
1881+
* Configurations for streaming.
1882+
* </p>
1883+
* @public
1884+
*/
1885+
export interface StreamingConfigurations {
1886+
/**
1887+
* <p>
1888+
* Specifies whether to enable streaming for the final response. This is set to <code>false</code> by default.
1889+
* </p>
1890+
* @public
1891+
*/
1892+
streamFinalResponse?: boolean | undefined;
1893+
1894+
/**
1895+
* <p>
1896+
* The guardrail interval to apply as response is generated.
1897+
* </p>
1898+
* @public
1899+
*/
1900+
applyGuardrailInterval?: number | undefined;
1901+
}
1902+
18791903
/**
18801904
* <p>Contains information about where the text with a citation begins and ends in the generated output.</p>
18811905
* <p>This data type is used in the following API operations:</p>
@@ -2534,6 +2558,46 @@ export interface ReturnControlPayload {
25342558
invocationId?: string | undefined;
25352559
}
25362560

2561+
/**
2562+
* <p>
2563+
* The event in the custom orchestration sequence.
2564+
* </p>
2565+
* @public
2566+
*/
2567+
export interface CustomOrchestrationTraceEvent {
2568+
/**
2569+
* <p>
2570+
* The text that prompted the event at this step.
2571+
* </p>
2572+
* @public
2573+
*/
2574+
text?: string | undefined;
2575+
}
2576+
2577+
/**
2578+
* <p>
2579+
* The trace behavior for the custom orchestration.
2580+
* </p>
2581+
* @public
2582+
*/
2583+
export interface CustomOrchestrationTrace {
2584+
/**
2585+
* <p>
2586+
* The unique identifier of the trace.
2587+
* </p>
2588+
* @public
2589+
*/
2590+
traceId?: string | undefined;
2591+
2592+
/**
2593+
* <p>
2594+
* The trace event details used with the custom orchestration.
2595+
* </p>
2596+
* @public
2597+
*/
2598+
event?: CustomOrchestrationTraceEvent | undefined;
2599+
}
2600+
25372601
/**
25382602
* <p>Contains information about the failure of the interaction.</p>
25392603
* @public
@@ -3819,6 +3883,7 @@ export namespace PreProcessingTrace {
38193883
* @public
38203884
*/
38213885
export type Trace =
3886+
| Trace.CustomOrchestrationTraceMember
38223887
| Trace.FailureTraceMember
38233888
| Trace.GuardrailTraceMember
38243889
| Trace.OrchestrationTraceMember
@@ -3840,6 +3905,7 @@ export namespace Trace {
38403905
orchestrationTrace?: never;
38413906
postProcessingTrace?: never;
38423907
failureTrace?: never;
3908+
customOrchestrationTrace?: never;
38433909
$unknown?: never;
38443910
}
38453911

@@ -3853,6 +3919,7 @@ export namespace Trace {
38533919
orchestrationTrace?: never;
38543920
postProcessingTrace?: never;
38553921
failureTrace?: never;
3922+
customOrchestrationTrace?: never;
38563923
$unknown?: never;
38573924
}
38583925

@@ -3866,6 +3933,7 @@ export namespace Trace {
38663933
orchestrationTrace: OrchestrationTrace;
38673934
postProcessingTrace?: never;
38683935
failureTrace?: never;
3936+
customOrchestrationTrace?: never;
38693937
$unknown?: never;
38703938
}
38713939

@@ -3879,6 +3947,7 @@ export namespace Trace {
38793947
orchestrationTrace?: never;
38803948
postProcessingTrace: PostProcessingTrace;
38813949
failureTrace?: never;
3950+
customOrchestrationTrace?: never;
38823951
$unknown?: never;
38833952
}
38843953

@@ -3892,6 +3961,23 @@ export namespace Trace {
38923961
orchestrationTrace?: never;
38933962
postProcessingTrace?: never;
38943963
failureTrace: FailureTrace;
3964+
customOrchestrationTrace?: never;
3965+
$unknown?: never;
3966+
}
3967+
3968+
/**
3969+
* <p>
3970+
* Details about the custom orchestration step in which the agent determines the order in which actions are executed.
3971+
* </p>
3972+
* @public
3973+
*/
3974+
export interface CustomOrchestrationTraceMember {
3975+
guardrailTrace?: never;
3976+
preProcessingTrace?: never;
3977+
orchestrationTrace?: never;
3978+
postProcessingTrace?: never;
3979+
failureTrace?: never;
3980+
customOrchestrationTrace: CustomOrchestrationTrace;
38953981
$unknown?: never;
38963982
}
38973983

@@ -3904,6 +3990,7 @@ export namespace Trace {
39043990
orchestrationTrace?: never;
39053991
postProcessingTrace?: never;
39063992
failureTrace?: never;
3993+
customOrchestrationTrace?: never;
39073994
$unknown: [string, any];
39083995
}
39093996

@@ -3913,6 +4000,7 @@ export namespace Trace {
39134000
orchestrationTrace: (value: OrchestrationTrace) => T;
39144001
postProcessingTrace: (value: PostProcessingTrace) => T;
39154002
failureTrace: (value: FailureTrace) => T;
4003+
customOrchestrationTrace: (value: CustomOrchestrationTrace) => T;
39164004
_: (name: string, value: any) => T;
39174005
}
39184006

@@ -3922,6 +4010,8 @@ export namespace Trace {
39224010
if (value.orchestrationTrace !== undefined) return visitor.orchestrationTrace(value.orchestrationTrace);
39234011
if (value.postProcessingTrace !== undefined) return visitor.postProcessingTrace(value.postProcessingTrace);
39244012
if (value.failureTrace !== undefined) return visitor.failureTrace(value.failureTrace);
4013+
if (value.customOrchestrationTrace !== undefined)
4014+
return visitor.customOrchestrationTrace(value.customOrchestrationTrace);
39254015
return visitor._(value.$unknown[0], value.$unknown[1]);
39264016
};
39274017
}
@@ -6893,6 +6983,14 @@ export interface InvokeAgentRequest {
68936983
* @public
68946984
*/
68956985
memoryId?: string | undefined;
6986+
6987+
/**
6988+
* <p>
6989+
* Specifies the configurations for streaming.
6990+
* </p>
6991+
* @public
6992+
*/
6993+
streamingConfigurations?: StreamingConfigurations | undefined;
68966994
}
68976995

68986996
/**
@@ -7246,6 +7344,21 @@ export const ReturnControlPayloadFilterSensitiveLog = (obj: ReturnControlPayload
72467344
}),
72477345
});
72487346

7347+
/**
7348+
* @internal
7349+
*/
7350+
export const CustomOrchestrationTraceEventFilterSensitiveLog = (obj: CustomOrchestrationTraceEvent): any => ({
7351+
...obj,
7352+
});
7353+
7354+
/**
7355+
* @internal
7356+
*/
7357+
export const CustomOrchestrationTraceFilterSensitiveLog = (obj: CustomOrchestrationTrace): any => ({
7358+
...obj,
7359+
...(obj.event && { event: SENSITIVE_STRING }),
7360+
});
7361+
72497362
/**
72507363
* @internal
72517364
*/
@@ -7539,6 +7652,7 @@ export const TraceFilterSensitiveLog = (obj: Trace): any => {
75397652
if (obj.orchestrationTrace !== undefined) return { orchestrationTrace: SENSITIVE_STRING };
75407653
if (obj.postProcessingTrace !== undefined) return { postProcessingTrace: SENSITIVE_STRING };
75417654
if (obj.failureTrace !== undefined) return { failureTrace: SENSITIVE_STRING };
7655+
if (obj.customOrchestrationTrace !== undefined) return { customOrchestrationTrace: SENSITIVE_STRING };
75427656
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
75437657
};
75447658

clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ import {
137137
S3ObjectFile,
138138
ServiceQuotaExceededException,
139139
SessionState,
140+
StreamingConfigurations,
140141
TextInferenceConfig,
141142
TextPrompt,
142143
ThrottlingException,
@@ -211,6 +212,7 @@ export const se_InvokeAgentCommand = async (
211212
inputText: [],
212213
memoryId: [],
213214
sessionState: (_) => se_SessionState(_, context),
215+
streamingConfigurations: (_) => _json(_),
214216
})
215217
);
216218
b.m("POST").h(headers).b(body);
@@ -1663,6 +1665,8 @@ const se_SessionState = (input: SessionState, context: __SerdeContext): any => {
16631665

16641666
// se_StopSequences omitted.
16651667

1668+
// se_StreamingConfigurations omitted.
1669+
16661670
/**
16671671
* serializeAws_restJson1TextInferenceConfig
16681672
*/
@@ -1737,6 +1741,10 @@ const de_Citations = (output: any, context: __SerdeContext): Citation[] => {
17371741

17381742
// de_ContentMap omitted.
17391743

1744+
// de_CustomOrchestrationTrace omitted.
1745+
1746+
// de_CustomOrchestrationTraceEvent omitted.
1747+
17401748
// de_FailureTrace omitted.
17411749

17421750
/**
@@ -2318,6 +2326,11 @@ const de_RetrievedReferences = (output: any, context: __SerdeContext): Retrieved
23182326
* deserializeAws_restJson1Trace
23192327
*/
23202328
const de_Trace = (output: any, context: __SerdeContext): Trace => {
2329+
if (output.customOrchestrationTrace != null) {
2330+
return {
2331+
customOrchestrationTrace: _json(output.customOrchestrationTrace),
2332+
};
2333+
}
23212334
if (output.failureTrace != null) {
23222335
return {
23232336
failureTrace: _json(output.failureTrace),

codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,42 @@
14321432
}
14331433
}
14341434
},
1435+
"com.amazonaws.bedrockagentruntime#CustomOrchestrationTrace": {
1436+
"type": "structure",
1437+
"members": {
1438+
"traceId": {
1439+
"target": "com.amazonaws.bedrockagentruntime#TraceId",
1440+
"traits": {
1441+
"smithy.api#documentation": "<p>\n The unique identifier of the trace. \n </p>"
1442+
}
1443+
},
1444+
"event": {
1445+
"target": "com.amazonaws.bedrockagentruntime#CustomOrchestrationTraceEvent",
1446+
"traits": {
1447+
"smithy.api#documentation": "<p>\n The trace event details used with the custom orchestration.\n </p>"
1448+
}
1449+
}
1450+
},
1451+
"traits": {
1452+
"smithy.api#documentation": "<p>\n The trace behavior for the custom orchestration. \n </p>",
1453+
"smithy.api#sensitive": {}
1454+
}
1455+
},
1456+
"com.amazonaws.bedrockagentruntime#CustomOrchestrationTraceEvent": {
1457+
"type": "structure",
1458+
"members": {
1459+
"text": {
1460+
"target": "smithy.api#String",
1461+
"traits": {
1462+
"smithy.api#documentation": "<p>\n The text that prompted the event at this step.\n </p>"
1463+
}
1464+
}
1465+
},
1466+
"traits": {
1467+
"smithy.api#documentation": "<p>\n The event in the custom orchestration sequence.\n </p>",
1468+
"smithy.api#sensitive": {}
1469+
}
1470+
},
14351471
"com.amazonaws.bedrockagentruntime#DateTimestamp": {
14361472
"type": "timestamp",
14371473
"traits": {
@@ -4066,6 +4102,12 @@
40664102
"traits": {
40674103
"smithy.api#documentation": "<p>The unique identifier of the agent memory.</p>"
40684104
}
4105+
},
4106+
"streamingConfigurations": {
4107+
"target": "com.amazonaws.bedrockagentruntime#StreamingConfigurations",
4108+
"traits": {
4109+
"smithy.api#documentation": "<p>\n Specifies the configurations for streaming.\n </p>"
4110+
}
40694111
}
40704112
},
40714113
"traits": {
@@ -7002,6 +7044,30 @@
70027044
}
70037045
}
70047046
},
7047+
"com.amazonaws.bedrockagentruntime#StreamingConfigurations": {
7048+
"type": "structure",
7049+
"members": {
7050+
"streamFinalResponse": {
7051+
"target": "smithy.api#Boolean",
7052+
"traits": {
7053+
"smithy.api#default": false,
7054+
"smithy.api#documentation": "<p>\n Specifies whether to enable streaming for the final response. This is set to <code>false</code> by default.\n </p>"
7055+
}
7056+
},
7057+
"applyGuardrailInterval": {
7058+
"target": "smithy.api#Integer",
7059+
"traits": {
7060+
"smithy.api#documentation": "<p>\n The guardrail interval to apply as response is generated.\n </p>",
7061+
"smithy.api#range": {
7062+
"min": 1
7063+
}
7064+
}
7065+
}
7066+
},
7067+
"traits": {
7068+
"smithy.api#documentation": "<p>\n Configurations for streaming.\n </p>"
7069+
}
7070+
},
70057071
"com.amazonaws.bedrockagentruntime#SummaryText": {
70067072
"type": "string",
70077073
"traits": {
@@ -7166,6 +7232,12 @@
71667232
"traits": {
71677233
"smithy.api#documentation": "<p>Contains information about the failure of the interaction.</p>"
71687234
}
7235+
},
7236+
"customOrchestrationTrace": {
7237+
"target": "com.amazonaws.bedrockagentruntime#CustomOrchestrationTrace",
7238+
"traits": {
7239+
"smithy.api#documentation": "<p>\n Details about the custom orchestration step in which the agent determines the order in which actions are executed. \n </p>"
7240+
}
71697241
}
71707242
},
71717243
"traits": {

0 commit comments

Comments
 (0)