diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts index b7d9cad8e857..b7bdab38b4f5 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts @@ -200,6 +200,10 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * enableTrace: true || false, * inputText: "STRING_VALUE", * memoryId: "STRING_VALUE", + * streamingConfigurations: { // StreamingConfigurations + * streamFinalResponse: true || false, + * applyGuardrailInterval: Number("int"), + * }, * }; * const command = new InvokeAgentCommand(input); * const response = await client.send(command); @@ -566,6 +570,12 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // traceId: "STRING_VALUE", * // failureReason: "STRING_VALUE", * // }, + * // customOrchestrationTrace: { // CustomOrchestrationTrace + * // traceId: "STRING_VALUE", + * // event: { // CustomOrchestrationTraceEvent + * // text: "STRING_VALUE", + * // }, + * // }, * // }, * // agentId: "STRING_VALUE", * // agentAliasId: "STRING_VALUE", diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts index cfadf08d345d..039c196eed3b 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts @@ -620,6 +620,12 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons * // traceId: "STRING_VALUE", * // failureReason: "STRING_VALUE", * // }, + * // customOrchestrationTrace: { // CustomOrchestrationTrace + * // traceId: "STRING_VALUE", + * // event: { // CustomOrchestrationTraceEvent + * // text: "STRING_VALUE", + * // }, + * // }, * // }, * // }, * // returnControl: { // InlineAgentReturnControlPayload diff --git a/clients/client-bedrock-agent-runtime/src/models/models_0.ts b/clients/client-bedrock-agent-runtime/src/models/models_0.ts index ba16d57bd4de..bc851435f035 100644 --- a/clients/client-bedrock-agent-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts @@ -1876,6 +1876,30 @@ export namespace InvocationResultMember { }; } +/** + *

+ * Configurations for streaming. + *

+ * @public + */ +export interface StreamingConfigurations { + /** + *

+ * Specifies whether to enable streaming for the final response. This is set to false by default. + *

+ * @public + */ + streamFinalResponse?: boolean | undefined; + + /** + *

+ * The guardrail interval to apply as response is generated. + *

+ * @public + */ + applyGuardrailInterval?: number | undefined; +} + /** *

Contains information about where the text with a citation begins and ends in the generated output.

*

This data type is used in the following API operations:

@@ -2534,6 +2558,46 @@ export interface ReturnControlPayload { invocationId?: string | undefined; } +/** + *

+ * The event in the custom orchestration sequence. + *

+ * @public + */ +export interface CustomOrchestrationTraceEvent { + /** + *

+ * The text that prompted the event at this step. + *

+ * @public + */ + text?: string | undefined; +} + +/** + *

+ * The trace behavior for the custom orchestration. + *

+ * @public + */ +export interface CustomOrchestrationTrace { + /** + *

+ * The unique identifier of the trace. + *

+ * @public + */ + traceId?: string | undefined; + + /** + *

+ * The trace event details used with the custom orchestration. + *

+ * @public + */ + event?: CustomOrchestrationTraceEvent | undefined; +} + /** *

Contains information about the failure of the interaction.

* @public @@ -3819,6 +3883,7 @@ export namespace PreProcessingTrace { * @public */ export type Trace = + | Trace.CustomOrchestrationTraceMember | Trace.FailureTraceMember | Trace.GuardrailTraceMember | Trace.OrchestrationTraceMember @@ -3840,6 +3905,7 @@ export namespace Trace { orchestrationTrace?: never; postProcessingTrace?: never; failureTrace?: never; + customOrchestrationTrace?: never; $unknown?: never; } @@ -3853,6 +3919,7 @@ export namespace Trace { orchestrationTrace?: never; postProcessingTrace?: never; failureTrace?: never; + customOrchestrationTrace?: never; $unknown?: never; } @@ -3866,6 +3933,7 @@ export namespace Trace { orchestrationTrace: OrchestrationTrace; postProcessingTrace?: never; failureTrace?: never; + customOrchestrationTrace?: never; $unknown?: never; } @@ -3879,6 +3947,7 @@ export namespace Trace { orchestrationTrace?: never; postProcessingTrace: PostProcessingTrace; failureTrace?: never; + customOrchestrationTrace?: never; $unknown?: never; } @@ -3892,6 +3961,23 @@ export namespace Trace { orchestrationTrace?: never; postProcessingTrace?: never; failureTrace: FailureTrace; + customOrchestrationTrace?: never; + $unknown?: never; + } + + /** + *

+ * Details about the custom orchestration step in which the agent determines the order in which actions are executed. + *

+ * @public + */ + export interface CustomOrchestrationTraceMember { + guardrailTrace?: never; + preProcessingTrace?: never; + orchestrationTrace?: never; + postProcessingTrace?: never; + failureTrace?: never; + customOrchestrationTrace: CustomOrchestrationTrace; $unknown?: never; } @@ -3904,6 +3990,7 @@ export namespace Trace { orchestrationTrace?: never; postProcessingTrace?: never; failureTrace?: never; + customOrchestrationTrace?: never; $unknown: [string, any]; } @@ -3913,6 +4000,7 @@ export namespace Trace { orchestrationTrace: (value: OrchestrationTrace) => T; postProcessingTrace: (value: PostProcessingTrace) => T; failureTrace: (value: FailureTrace) => T; + customOrchestrationTrace: (value: CustomOrchestrationTrace) => T; _: (name: string, value: any) => T; } @@ -3922,6 +4010,8 @@ export namespace Trace { if (value.orchestrationTrace !== undefined) return visitor.orchestrationTrace(value.orchestrationTrace); if (value.postProcessingTrace !== undefined) return visitor.postProcessingTrace(value.postProcessingTrace); if (value.failureTrace !== undefined) return visitor.failureTrace(value.failureTrace); + if (value.customOrchestrationTrace !== undefined) + return visitor.customOrchestrationTrace(value.customOrchestrationTrace); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -6893,6 +6983,14 @@ export interface InvokeAgentRequest { * @public */ memoryId?: string | undefined; + + /** + *

+ * Specifies the configurations for streaming. + *

+ * @public + */ + streamingConfigurations?: StreamingConfigurations | undefined; } /** @@ -7246,6 +7344,21 @@ export const ReturnControlPayloadFilterSensitiveLog = (obj: ReturnControlPayload }), }); +/** + * @internal + */ +export const CustomOrchestrationTraceEventFilterSensitiveLog = (obj: CustomOrchestrationTraceEvent): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const CustomOrchestrationTraceFilterSensitiveLog = (obj: CustomOrchestrationTrace): any => ({ + ...obj, + ...(obj.event && { event: SENSITIVE_STRING }), +}); + /** * @internal */ @@ -7539,6 +7652,7 @@ export const TraceFilterSensitiveLog = (obj: Trace): any => { if (obj.orchestrationTrace !== undefined) return { orchestrationTrace: SENSITIVE_STRING }; if (obj.postProcessingTrace !== undefined) return { postProcessingTrace: SENSITIVE_STRING }; if (obj.failureTrace !== undefined) return { failureTrace: SENSITIVE_STRING }; + if (obj.customOrchestrationTrace !== undefined) return { customOrchestrationTrace: SENSITIVE_STRING }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts index ee9871c159ee..3872d0692f56 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -137,6 +137,7 @@ import { S3ObjectFile, ServiceQuotaExceededException, SessionState, + StreamingConfigurations, TextInferenceConfig, TextPrompt, ThrottlingException, @@ -211,6 +212,7 @@ export const se_InvokeAgentCommand = async ( inputText: [], memoryId: [], sessionState: (_) => se_SessionState(_, context), + streamingConfigurations: (_) => _json(_), }) ); b.m("POST").h(headers).b(body); @@ -1663,6 +1665,8 @@ const se_SessionState = (input: SessionState, context: __SerdeContext): any => { // se_StopSequences omitted. +// se_StreamingConfigurations omitted. + /** * serializeAws_restJson1TextInferenceConfig */ @@ -1737,6 +1741,10 @@ const de_Citations = (output: any, context: __SerdeContext): Citation[] => { // de_ContentMap omitted. +// de_CustomOrchestrationTrace omitted. + +// de_CustomOrchestrationTraceEvent omitted. + // de_FailureTrace omitted. /** @@ -2318,6 +2326,11 @@ const de_RetrievedReferences = (output: any, context: __SerdeContext): Retrieved * deserializeAws_restJson1Trace */ const de_Trace = (output: any, context: __SerdeContext): Trace => { + if (output.customOrchestrationTrace != null) { + return { + customOrchestrationTrace: _json(output.customOrchestrationTrace), + }; + } if (output.failureTrace != null) { return { failureTrace: _json(output.failureTrace), diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json index c4aa5f5844e3..6bdc072757ad 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json @@ -1432,6 +1432,42 @@ } } }, + "com.amazonaws.bedrockagentruntime#CustomOrchestrationTrace": { + "type": "structure", + "members": { + "traceId": { + "target": "com.amazonaws.bedrockagentruntime#TraceId", + "traits": { + "smithy.api#documentation": "

\n The unique identifier of the trace. \n

" + } + }, + "event": { + "target": "com.amazonaws.bedrockagentruntime#CustomOrchestrationTraceEvent", + "traits": { + "smithy.api#documentation": "

\n The trace event details used with the custom orchestration.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

\n The trace behavior for the custom orchestration. \n

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#CustomOrchestrationTraceEvent": { + "type": "structure", + "members": { + "text": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

\n The text that prompted the event at this step.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

\n The event in the custom orchestration sequence.\n

", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagentruntime#DateTimestamp": { "type": "timestamp", "traits": { @@ -4066,6 +4102,12 @@ "traits": { "smithy.api#documentation": "

The unique identifier of the agent memory.

" } + }, + "streamingConfigurations": { + "target": "com.amazonaws.bedrockagentruntime#StreamingConfigurations", + "traits": { + "smithy.api#documentation": "

\n Specifies the configurations for streaming.\n

" + } } }, "traits": { @@ -7002,6 +7044,30 @@ } } }, + "com.amazonaws.bedrockagentruntime#StreamingConfigurations": { + "type": "structure", + "members": { + "streamFinalResponse": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

\n Specifies whether to enable streaming for the final response. This is set to false by default.\n

" + } + }, + "applyGuardrailInterval": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

\n The guardrail interval to apply as response is generated.\n

", + "smithy.api#range": { + "min": 1 + } + } + } + }, + "traits": { + "smithy.api#documentation": "

\n Configurations for streaming.\n

" + } + }, "com.amazonaws.bedrockagentruntime#SummaryText": { "type": "string", "traits": { @@ -7166,6 +7232,12 @@ "traits": { "smithy.api#documentation": "

Contains information about the failure of the interaction.

" } + }, + "customOrchestrationTrace": { + "target": "com.amazonaws.bedrockagentruntime#CustomOrchestrationTrace", + "traits": { + "smithy.api#documentation": "

\n Details about the custom orchestration step in which the agent determines the order in which actions are executed. \n

" + } } }, "traits": {