From f2f40c1eb43c28f98802f825ea9839de5a79a0ce Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 10 Jul 2024 18:50:48 +0000 Subject: [PATCH] feat(client-bedrock-agent-runtime): Introduces query decomposition, enhanced Agents integration with Knowledge bases, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources for end-to-end solutions. --- .../client-bedrock-agent-runtime/README.md | 24 + .../src/BedrockAgentRuntime.ts | 56 + .../src/BedrockAgentRuntimeClient.ts | 19 +- .../src/commands/DeleteAgentMemoryCommand.ts | 113 ++ .../src/commands/GetAgentMemoryCommand.ts | 129 ++ .../src/commands/InvokeAgentCommand.ts | 138 +- .../src/commands/InvokeFlowCommand.ts | 175 ++ .../commands/RetrieveAndGenerateCommand.ts | 19 +- .../src/commands/RetrieveCommand.ts | 14 +- .../src/commands/index.ts | 3 + .../src/models/models_0.ts | 1763 ++++++++++++++--- .../src/pagination/GetAgentMemoryPaginator.ts | 24 + .../src/pagination/index.ts | 1 + .../src/protocols/Aws_restJson1.ts | 493 ++++- .../aws-models/bedrock-agent-runtime.json | 1395 ++++++++++++- 15 files changed, 4023 insertions(+), 343 deletions(-) create mode 100644 clients/client-bedrock-agent-runtime/src/commands/DeleteAgentMemoryCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/GetAgentMemoryCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/pagination/GetAgentMemoryPaginator.ts diff --git a/clients/client-bedrock-agent-runtime/README.md b/clients/client-bedrock-agent-runtime/README.md index 6fed0ae45b724..0edd48d0c8f34 100644 --- a/clients/client-bedrock-agent-runtime/README.md +++ b/clients/client-bedrock-agent-runtime/README.md @@ -203,6 +203,22 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +DeleteAgentMemory + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/DeleteAgentMemoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/DeleteAgentMemoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/DeleteAgentMemoryCommandOutput/) + +
+
+ +GetAgentMemory + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/GetAgentMemoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetAgentMemoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetAgentMemoryCommandOutput/) + +
InvokeAgent @@ -210,6 +226,14 @@ InvokeAgent [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/InvokeAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeAgentCommandOutput/) +
+
+ +InvokeFlow + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/InvokeFlowCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeFlowCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeFlowCommandOutput/) +
diff --git a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts index 8368b3adbfd50..cc762f8bf4cfa 100644 --- a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts +++ b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts @@ -3,7 +3,18 @@ import { createAggregatedClient } from "@smithy/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; import { BedrockAgentRuntimeClient, BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient"; +import { + DeleteAgentMemoryCommand, + DeleteAgentMemoryCommandInput, + DeleteAgentMemoryCommandOutput, +} from "./commands/DeleteAgentMemoryCommand"; +import { + GetAgentMemoryCommand, + GetAgentMemoryCommandInput, + GetAgentMemoryCommandOutput, +} from "./commands/GetAgentMemoryCommand"; import { InvokeAgentCommand, InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand"; +import { InvokeFlowCommand, InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand"; import { RetrieveAndGenerateCommand, RetrieveAndGenerateCommandInput, @@ -12,12 +23,46 @@ import { import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand"; const commands = { + DeleteAgentMemoryCommand, + GetAgentMemoryCommand, InvokeAgentCommand, + InvokeFlowCommand, RetrieveCommand, RetrieveAndGenerateCommand, }; export interface BedrockAgentRuntime { + /** + * @see {@link DeleteAgentMemoryCommand} + */ + deleteAgentMemory( + args: DeleteAgentMemoryCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteAgentMemory( + args: DeleteAgentMemoryCommandInput, + cb: (err: any, data?: DeleteAgentMemoryCommandOutput) => void + ): void; + deleteAgentMemory( + args: DeleteAgentMemoryCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAgentMemoryCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentMemoryCommand} + */ + getAgentMemory( + args: GetAgentMemoryCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAgentMemory(args: GetAgentMemoryCommandInput, cb: (err: any, data?: GetAgentMemoryCommandOutput) => void): void; + getAgentMemory( + args: GetAgentMemoryCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentMemoryCommandOutput) => void + ): void; + /** * @see {@link InvokeAgentCommand} */ @@ -29,6 +74,17 @@ export interface BedrockAgentRuntime { cb: (err: any, data?: InvokeAgentCommandOutput) => void ): void; + /** + * @see {@link InvokeFlowCommand} + */ + invokeFlow(args: InvokeFlowCommandInput, options?: __HttpHandlerOptions): Promise; + invokeFlow(args: InvokeFlowCommandInput, cb: (err: any, data?: InvokeFlowCommandOutput) => void): void; + invokeFlow( + args: InvokeFlowCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InvokeFlowCommandOutput) => void + ): void; + /** * @see {@link RetrieveCommand} */ diff --git a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts index 26195d9fade08..2c8ba4029e7bb 100644 --- a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts +++ b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts @@ -59,7 +59,10 @@ import { HttpAuthSchemeResolvedConfig, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider"; +import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from "./commands/DeleteAgentMemoryCommand"; +import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "./commands/GetAgentMemoryCommand"; import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand"; +import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand"; import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput, @@ -79,12 +82,24 @@ export { __Client }; /** * @public */ -export type ServiceInputTypes = InvokeAgentCommandInput | RetrieveAndGenerateCommandInput | RetrieveCommandInput; +export type ServiceInputTypes = + | DeleteAgentMemoryCommandInput + | GetAgentMemoryCommandInput + | InvokeAgentCommandInput + | InvokeFlowCommandInput + | RetrieveAndGenerateCommandInput + | RetrieveCommandInput; /** * @public */ -export type ServiceOutputTypes = InvokeAgentCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveCommandOutput; +export type ServiceOutputTypes = + | DeleteAgentMemoryCommandOutput + | GetAgentMemoryCommandOutput + | InvokeAgentCommandOutput + | InvokeFlowCommandOutput + | RetrieveAndGenerateCommandOutput + | RetrieveCommandOutput; /** * @public diff --git a/clients/client-bedrock-agent-runtime/src/commands/DeleteAgentMemoryCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/DeleteAgentMemoryCommand.ts new file mode 100644 index 0000000000000..9a8f12a8b6982 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/DeleteAgentMemoryCommand.ts @@ -0,0 +1,113 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../BedrockAgentRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteAgentMemoryRequest, DeleteAgentMemoryResponse } from "../models/models_0"; +import { de_DeleteAgentMemoryCommand, se_DeleteAgentMemoryCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteAgentMemoryCommand}. + */ +export interface DeleteAgentMemoryCommandInput extends DeleteAgentMemoryRequest {} +/** + * @public + * + * The output of {@link DeleteAgentMemoryCommand}. + */ +export interface DeleteAgentMemoryCommandOutput extends DeleteAgentMemoryResponse, __MetadataBearer {} + +/** + *

Deletes memory from the specified memory identifier.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, DeleteAgentMemoryCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, DeleteAgentMemoryCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // DeleteAgentMemoryRequest + * agentId: "STRING_VALUE", // required + * agentAliasId: "STRING_VALUE", // required + * memoryId: "STRING_VALUE", + * }; + * const command = new DeleteAgentMemoryCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteAgentMemoryCommandInput - {@link DeleteAgentMemoryCommandInput} + * @returns {@link DeleteAgentMemoryCommandOutput} + * @see {@link DeleteAgentMemoryCommandInput} for command's `input` shape. + * @see {@link DeleteAgentMemoryCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions. Check your permissions and retry your request.

+ * + * @throws {@link BadGatewayException} (server fault) + *

There was an issue with a dependency due to a server issue. Retry your request.

+ * + * @throws {@link ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your request.

+ * + * @throws {@link DependencyFailedException} (client fault) + *

There was an issue with a dependency. Check the resource configurations and retry the request.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentRuntimeServiceException} + *

Base exception class for all service exceptions from BedrockAgentRuntime service.

+ * + * @public + */ +export class DeleteAgentMemoryCommand extends $Command + .classBuilder< + DeleteAgentMemoryCommandInput, + DeleteAgentMemoryCommandOutput, + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentRunTimeService", "DeleteAgentMemory", {}) + .n("BedrockAgentRuntimeClient", "DeleteAgentMemoryCommand") + .f(void 0, void 0) + .ser(se_DeleteAgentMemoryCommand) + .de(de_DeleteAgentMemoryCommand) + .build() {} diff --git a/clients/client-bedrock-agent-runtime/src/commands/GetAgentMemoryCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/GetAgentMemoryCommand.ts new file mode 100644 index 0000000000000..d2e57fd0f763a --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/GetAgentMemoryCommand.ts @@ -0,0 +1,129 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../BedrockAgentRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetAgentMemoryRequest, GetAgentMemoryResponse } from "../models/models_0"; +import { de_GetAgentMemoryCommand, se_GetAgentMemoryCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetAgentMemoryCommand}. + */ +export interface GetAgentMemoryCommandInput extends GetAgentMemoryRequest {} +/** + * @public + * + * The output of {@link GetAgentMemoryCommand}. + */ +export interface GetAgentMemoryCommandOutput extends GetAgentMemoryResponse, __MetadataBearer {} + +/** + *

Gets the sessions stored in the memory of the agent.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, GetAgentMemoryCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, GetAgentMemoryCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // GetAgentMemoryRequest + * nextToken: "STRING_VALUE", + * maxItems: Number("int"), + * agentId: "STRING_VALUE", // required + * agentAliasId: "STRING_VALUE", // required + * memoryType: "SESSION_SUMMARY", // required + * memoryId: "STRING_VALUE", // required + * }; + * const command = new GetAgentMemoryCommand(input); + * const response = await client.send(command); + * // { // GetAgentMemoryResponse + * // nextToken: "STRING_VALUE", + * // memoryContents: [ // Memories + * // { // Memory Union: only one key present + * // sessionSummary: { // MemorySessionSummary + * // memoryId: "STRING_VALUE", + * // sessionId: "STRING_VALUE", + * // sessionStartTime: new Date("TIMESTAMP"), + * // sessionExpiryTime: new Date("TIMESTAMP"), + * // summaryText: "STRING_VALUE", + * // }, + * // }, + * // ], + * // }; + * + * ``` + * + * @param GetAgentMemoryCommandInput - {@link GetAgentMemoryCommandInput} + * @returns {@link GetAgentMemoryCommandOutput} + * @see {@link GetAgentMemoryCommandInput} for command's `input` shape. + * @see {@link GetAgentMemoryCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions. Check your permissions and retry your request.

+ * + * @throws {@link BadGatewayException} (server fault) + *

There was an issue with a dependency due to a server issue. Retry your request.

+ * + * @throws {@link ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your request.

+ * + * @throws {@link DependencyFailedException} (client fault) + *

There was an issue with a dependency. Check the resource configurations and retry the request.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentRuntimeServiceException} + *

Base exception class for all service exceptions from BedrockAgentRuntime service.

+ * + * @public + */ +export class GetAgentMemoryCommand extends $Command + .classBuilder< + GetAgentMemoryCommandInput, + GetAgentMemoryCommandOutput, + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentRunTimeService", "GetAgentMemory", {}) + .n("BedrockAgentRuntimeClient", "GetAgentMemoryCommand") + .f(void 0, void 0) + .ser(se_GetAgentMemoryCommand) + .de(de_GetAgentMemoryCommand) + .build() {} diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts index 044a572a59b28..b681588d2716b 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts @@ -38,7 +38,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat /** * - *

The CLI doesn't support InvokeAgent.

+ *

The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeAgent.

*
*

Sends a prompt for the agent to process and respond to. Note the following fields for the request:

*
    @@ -111,6 +111,85 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * }, * ], * invocationId: "STRING_VALUE", + * files: [ // InputFiles + * { // InputFile + * name: "STRING_VALUE", // required + * source: { // FileSource + * sourceType: "S3" || "BYTE_CONTENT", // required + * s3Location: { // S3ObjectFile + * uri: "STRING_VALUE", // required + * }, + * byteContent: { // ByteContentFile + * mediaType: "STRING_VALUE", // required + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required + * }, + * }, + * useCase: "CODE_INTERPRETER" || "CHAT", // required + * }, + * ], + * knowledgeBaseConfigurations: [ // KnowledgeBaseConfigurations + * { // KnowledgeBaseConfiguration + * knowledgeBaseId: "STRING_VALUE", // required + * retrievalConfiguration: { // KnowledgeBaseRetrievalConfiguration + * vectorSearchConfiguration: { // KnowledgeBaseVectorSearchConfiguration + * numberOfResults: Number("int"), + * overrideSearchType: "HYBRID" || "SEMANTIC", + * filter: { // RetrievalFilter Union: only one key present + * equals: { // FilterAttribute + * key: "STRING_VALUE", // required + * value: "DOCUMENT_VALUE", // required + * }, + * notEquals: { + * key: "STRING_VALUE", // required + * value: "DOCUMENT_VALUE", // required + * }, + * greaterThan: { + * key: "STRING_VALUE", // required + * value: "DOCUMENT_VALUE", // required + * }, + * greaterThanOrEquals: { + * key: "STRING_VALUE", // required + * value: "DOCUMENT_VALUE", // required + * }, + * lessThan: { + * key: "STRING_VALUE", // required + * value: "DOCUMENT_VALUE", // required + * }, + * lessThanOrEquals: "", + * in: "", + * notIn: "", + * startsWith: "", + * listContains: "", + * stringContains: "", + * andAll: [ // RetrievalFilterList + * {// Union: only one key present + * equals: "", + * notEquals: "", + * greaterThan: "", + * greaterThanOrEquals: "", + * lessThan: "", + * lessThanOrEquals: "", + * in: "", + * notIn: "", + * startsWith: "", + * listContains: "", + * stringContains: "", + * andAll: [ + * "", + * ], + * orAll: [ + * "", + * ], + * }, + * ], + * orAll: [ + * "", + * ], + * }, + * }, + * }, + * }, + * ], * }, * agentId: "STRING_VALUE", // required * agentAliasId: "STRING_VALUE", // required @@ -118,6 +197,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * endSession: true || false, * enableTrace: true || false, * inputText: "STRING_VALUE", + * memoryId: "STRING_VALUE", * }; * const command = new InvokeAgentCommand(input); * const response = await client.send(command); @@ -143,10 +223,22 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // text: "STRING_VALUE", // required * // }, * // location: { // RetrievalResultLocation - * // type: "S3", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required * // s3Location: { // RetrievalResultS3Location * // uri: "STRING_VALUE", * // }, + * // webLocation: { // RetrievalResultWebLocation + * // url: "STRING_VALUE", + * // }, + * // confluenceLocation: { // RetrievalResultConfluenceLocation + * // url: "STRING_VALUE", + * // }, + * // salesforceLocation: { // RetrievalResultSalesforceLocation + * // url: "STRING_VALUE", + * // }, + * // sharePointLocation: { // RetrievalResultSharePointLocation + * // url: "STRING_VALUE", + * // }, * // }, * // metadata: { // RetrievalResultMetadata * // "": "DOCUMENT_VALUE", @@ -308,7 +400,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // }, * // invocationInput: { // InvocationInput * // traceId: "STRING_VALUE", - * // invocationType: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "FINISH", + * // invocationType: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "FINISH" || "ACTION_GROUP_CODE_INTERPRETER", * // actionGroupInvocationInput: { // ActionGroupInvocationInput * // actionGroupName: "STRING_VALUE", * // verb: "STRING_VALUE", @@ -332,11 +424,19 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // }, * // }, * // function: "STRING_VALUE", + * // executionType: "LAMBDA" || "RETURN_CONTROL", + * // invocationId: "STRING_VALUE", * // }, * // knowledgeBaseLookupInput: { // KnowledgeBaseLookupInput * // text: "STRING_VALUE", * // knowledgeBaseId: "STRING_VALUE", * // }, + * // codeInterpreterInvocationInput: { // CodeInterpreterInvocationInput + * // code: "STRING_VALUE", + * // files: [ // Files + * // "STRING_VALUE", + * // ], + * // }, * // }, * // observation: { // Observation * // traceId: "STRING_VALUE", @@ -351,10 +451,22 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // text: "STRING_VALUE", // required * // }, * // location: { - * // type: "S3", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required * // s3Location: { * // uri: "STRING_VALUE", * // }, + * // webLocation: { + * // url: "STRING_VALUE", + * // }, + * // confluenceLocation: { + * // url: "STRING_VALUE", + * // }, + * // salesforceLocation: { + * // url: "STRING_VALUE", + * // }, + * // sharePointLocation: { + * // url: "STRING_VALUE", + * // }, * // }, * // metadata: { * // "": "DOCUMENT_VALUE", @@ -369,6 +481,14 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // text: "STRING_VALUE", * // source: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "PARSER", * // }, + * // codeInterpreterInvocationOutput: { // CodeInterpreterInvocationOutput + * // executionOutput: "STRING_VALUE", + * // executionError: "STRING_VALUE", + * // files: [ + * // "STRING_VALUE", + * // ], + * // executionTimeout: true || false, + * // }, * // }, * // modelInvocationInput: { * // traceId: "STRING_VALUE", @@ -491,9 +611,19 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat * // message: "STRING_VALUE", * // resourceName: "STRING_VALUE", * // }, + * // files: { // FilePart + * // files: [ // OutputFiles + * // { // OutputFile + * // name: "STRING_VALUE", + * // type: "STRING_VALUE", + * // bytes: new Uint8Array(), + * // }, + * // ], + * // }, * // }, * // contentType: "STRING_VALUE", // required * // sessionId: "STRING_VALUE", // required + * // memoryId: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts new file mode 100644 index 0000000000000..e18572a4ac852 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts @@ -0,0 +1,175 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../BedrockAgentRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + InvokeFlowRequest, + InvokeFlowRequestFilterSensitiveLog, + InvokeFlowResponse, + InvokeFlowResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_InvokeFlowCommand, se_InvokeFlowCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InvokeFlowCommand}. + */ +export interface InvokeFlowCommandInput extends InvokeFlowRequest {} +/** + * @public + * + * The output of {@link InvokeFlowCommand}. + */ +export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataBearer {} + +/** + *

    Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

    + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, InvokeFlowCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, InvokeFlowCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // InvokeFlowRequest + * flowIdentifier: "STRING_VALUE", // required + * flowAliasIdentifier: "STRING_VALUE", // required + * inputs: [ // FlowInputs // required + * { // FlowInput + * nodeName: "STRING_VALUE", // required + * nodeOutputName: "STRING_VALUE", // required + * content: { // FlowInputContent Union: only one key present + * document: "DOCUMENT_VALUE", + * }, + * }, + * ], + * }; + * const command = new InvokeFlowCommand(input); + * const response = await client.send(command); + * // { // InvokeFlowResponse + * // responseStream: { // FlowResponseStream Union: only one key present + * // flowOutputEvent: { // FlowOutputEvent + * // nodeName: "STRING_VALUE", // required + * // nodeType: "FlowInputNode" || "FlowOutputNode" || "LambdaFunctionNode" || "KnowledgeBaseNode" || "PromptNode" || "ConditionNode" || "LexNode", // required + * // content: { // FlowOutputContent Union: only one key present + * // document: "DOCUMENT_VALUE", + * // }, + * // }, + * // flowCompletionEvent: { // FlowCompletionEvent + * // completionReason: "SUCCESS", // required + * // }, + * // internalServerException: { // InternalServerException + * // message: "STRING_VALUE", + * // }, + * // validationException: { // ValidationException + * // message: "STRING_VALUE", + * // }, + * // resourceNotFoundException: { // ResourceNotFoundException + * // message: "STRING_VALUE", + * // }, + * // serviceQuotaExceededException: { // ServiceQuotaExceededException + * // message: "STRING_VALUE", + * // }, + * // throttlingException: { // ThrottlingException + * // message: "STRING_VALUE", + * // }, + * // accessDeniedException: { // AccessDeniedException + * // message: "STRING_VALUE", + * // }, + * // conflictException: { // ConflictException + * // message: "STRING_VALUE", + * // }, + * // dependencyFailedException: { // DependencyFailedException + * // message: "STRING_VALUE", + * // resourceName: "STRING_VALUE", + * // }, + * // badGatewayException: { // BadGatewayException + * // message: "STRING_VALUE", + * // resourceName: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param InvokeFlowCommandInput - {@link InvokeFlowCommandInput} + * @returns {@link InvokeFlowCommandOutput} + * @see {@link InvokeFlowCommandInput} for command's `input` shape. + * @see {@link InvokeFlowCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

    The request is denied because of missing access permissions. Check your permissions and retry your request.

    + * + * @throws {@link BadGatewayException} (server fault) + *

    There was an issue with a dependency due to a server issue. Retry your request.

    + * + * @throws {@link ConflictException} (client fault) + *

    There was a conflict performing an operation. Resolve the conflict and retry your request.

    + * + * @throws {@link DependencyFailedException} (client fault) + *

    There was an issue with a dependency. Check the resource configurations and retry the request.

    + * + * @throws {@link InternalServerException} (server fault) + *

    An internal server error occurred. Retry your request.

    + * + * @throws {@link ResourceNotFoundException} (client fault) + *

    The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

    + * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

    The number of requests exceeds the service quota. Resubmit your request later.

    + * + * @throws {@link ThrottlingException} (client fault) + *

    The number of requests exceeds the limit. Resubmit your request later.

    + * + * @throws {@link ValidationException} (client fault) + *

    Input validation failed. Check your request parameters and retry the request.

    + * + * @throws {@link BedrockAgentRuntimeServiceException} + *

    Base exception class for all service exceptions from BedrockAgentRuntime service.

    + * + * @public + */ +export class InvokeFlowCommand extends $Command + .classBuilder< + InvokeFlowCommandInput, + InvokeFlowCommandOutput, + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentRunTimeService", "InvokeFlow", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("BedrockAgentRuntimeClient", "InvokeFlowCommand") + .f(InvokeFlowRequestFilterSensitiveLog, InvokeFlowResponseFilterSensitiveLog) + .ser(se_InvokeFlowCommand) + .de(de_InvokeFlowCommand) + .build() {} diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts index 4c546a62ad3e1..fdbfb3a31ac05 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts @@ -134,6 +134,11 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes * "": "DOCUMENT_VALUE", * }, * }, + * orchestrationConfiguration: { // OrchestrationConfiguration + * queryTransformationConfiguration: { // QueryTransformationConfiguration + * type: "QUERY_DECOMPOSITION", // required + * }, + * }, * }, * externalSourcesConfiguration: { // ExternalSourcesRetrieveAndGenerateConfiguration * modelArn: "STRING_VALUE", // required @@ -202,10 +207,22 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes * // text: "STRING_VALUE", // required * // }, * // location: { // RetrievalResultLocation - * // type: "S3", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required * // s3Location: { // RetrievalResultS3Location * // uri: "STRING_VALUE", * // }, + * // webLocation: { // RetrievalResultWebLocation + * // url: "STRING_VALUE", + * // }, + * // confluenceLocation: { // RetrievalResultConfluenceLocation + * // url: "STRING_VALUE", + * // }, + * // salesforceLocation: { // RetrievalResultSalesforceLocation + * // url: "STRING_VALUE", + * // }, + * // sharePointLocation: { // RetrievalResultSharePointLocation + * // url: "STRING_VALUE", + * // }, * // }, * // metadata: { // RetrievalResultMetadata * // "": "DOCUMENT_VALUE", diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts index f289389afd596..0b85da4dba5b9 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts @@ -118,10 +118,22 @@ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBeare * // text: "STRING_VALUE", // required * // }, * // location: { // RetrievalResultLocation - * // type: "S3", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required * // s3Location: { // RetrievalResultS3Location * // uri: "STRING_VALUE", * // }, + * // webLocation: { // RetrievalResultWebLocation + * // url: "STRING_VALUE", + * // }, + * // confluenceLocation: { // RetrievalResultConfluenceLocation + * // url: "STRING_VALUE", + * // }, + * // salesforceLocation: { // RetrievalResultSalesforceLocation + * // url: "STRING_VALUE", + * // }, + * // sharePointLocation: { // RetrievalResultSharePointLocation + * // url: "STRING_VALUE", + * // }, * // }, * // score: Number("double"), * // metadata: { // RetrievalResultMetadata diff --git a/clients/client-bedrock-agent-runtime/src/commands/index.ts b/clients/client-bedrock-agent-runtime/src/commands/index.ts index 63aba081cf07f..58f87c23227c4 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/index.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/index.ts @@ -1,4 +1,7 @@ // smithy-typescript generated code +export * from "./DeleteAgentMemoryCommand"; +export * from "./GetAgentMemoryCommand"; export * from "./InvokeAgentCommand"; +export * from "./InvokeFlowCommand"; export * from "./RetrieveAndGenerateCommand"; export * from "./RetrieveCommand"; 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 82c45c92d2ffa..7a5ccde9b1dae 100644 --- a/clients/client-bedrock-agent-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts @@ -25,6 +25,20 @@ export class AccessDeniedException extends __BaseException { } } +/** + * @public + * @enum + */ +export const ExecutionType = { + LAMBDA: "LAMBDA", + RETURN_CONTROL: "RETURN_CONTROL", +} as const; + +/** + * @public + */ +export type ExecutionType = (typeof ExecutionType)[keyof typeof ExecutionType]; + /** *

    A parameter for the API request or function.

    * @public @@ -101,6 +115,18 @@ export interface ActionGroupInvocationInput { * @public */ function?: string; + + /** + *

    How fulfillment of the action is handled. For more information, see Handling fulfillment of the action.

    + * @public + */ + executionType?: ExecutionType; + + /** + *

    The unique identifier of the invocation. Only returned if the executionType is RETURN_CONTROL.

    + * @public + */ + invocationId?: string; } /** @@ -166,48 +192,808 @@ export class ConflictException extends __BaseException { *

    There was an issue with a dependency. Check the resource configurations and retry the request.

    * @public */ -export class DependencyFailedException extends __BaseException { - readonly name: "DependencyFailedException" = "DependencyFailedException"; - readonly $fault: "client" = "client"; +export class DependencyFailedException extends __BaseException { + readonly name: "DependencyFailedException" = "DependencyFailedException"; + readonly $fault: "client" = "client"; + /** + *

    The name of the dependency that caused the issue, such as Amazon Bedrock, Lambda, or STS.

    + * @public + */ + resourceName?: string; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "DependencyFailedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, DependencyFailedException.prototype); + this.resourceName = opts.resourceName; + } +} + +/** + *

    An internal server error occurred. Retry your request.

    + * @public + */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + } +} + +/** + *

    Contains information about an input into the flow.

    + *

    This data type is used in the following API operations:

    + * + * @public + */ +export type FlowInputContent = FlowInputContent.DocumentMember | FlowInputContent.$UnknownMember; + +/** + * @public + */ +export namespace FlowInputContent { + /** + *

    The input for the flow input node.

    + * @public + */ + export interface DocumentMember { + document: __DocumentType; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + document?: never; + $unknown: [string, any]; + } + + export interface Visitor { + document: (value: __DocumentType) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: FlowInputContent, visitor: Visitor): T => { + if (value.document !== undefined) return visitor.document(value.document); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + *

    Contains information about an input into the flow and what to do with it.

    + *

    This data type is used in the following API operations:

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

    A name for the input of the flow input node.

    + * @public + */ + nodeName: string | undefined; + + /** + *

    A name for the output of the flow input node.

    + * @public + */ + nodeOutputName: string | undefined; + + /** + *

    Contains information about an input into the flow.

    + * @public + */ + content: FlowInputContent | undefined; +} + +/** + * @public + */ +export interface InvokeFlowRequest { + /** + *

    The unique identifier of the flow.

    + * @public + */ + flowIdentifier: string | undefined; + + /** + *

    The unique identifier of the flow alias.

    + * @public + */ + flowAliasIdentifier: string | undefined; + + /** + *

    A list of objects, each containing information about an input into the flow.

    + * @public + */ + inputs: FlowInput[] | undefined; +} + +/** + * @public + * @enum + */ +export const FlowCompletionReason = { + SUCCESS: "SUCCESS", +} as const; + +/** + * @public + */ +export type FlowCompletionReason = (typeof FlowCompletionReason)[keyof typeof FlowCompletionReason]; + +/** + *

    Contains information about why a flow completed.

    + *

    This data type is used in the following API operations:

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

    The reason that the flow completed.

    + * @public + */ + completionReason: FlowCompletionReason | undefined; +} + +/** + *

    Contains information about the output node.

    + *

    This data type is used in the following API operations:

    + * + * @public + */ +export type FlowOutputContent = FlowOutputContent.DocumentMember | FlowOutputContent.$UnknownMember; + +/** + * @public + */ +export namespace FlowOutputContent { + /** + *

    A name for the output of the flow.

    + * @public + */ + export interface DocumentMember { + document: __DocumentType; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + document?: never; + $unknown: [string, any]; + } + + export interface Visitor { + document: (value: __DocumentType) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: FlowOutputContent, visitor: Visitor): T => { + if (value.document !== undefined) return visitor.document(value.document); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + * @enum + */ +export const NodeType = { + CONDITION_NODE: "ConditionNode", + FLOW_INPUT_NODE: "FlowInputNode", + FLOW_OUTPUT_NODE: "FlowOutputNode", + KNOWLEDGE_BASE_NODE: "KnowledgeBaseNode", + LAMBDA_FUNCTION_NODE: "LambdaFunctionNode", + LEX_NODE: "LexNode", + PROMPT_NODE: "PromptNode", +} as const; + +/** + * @public + */ +export type NodeType = (typeof NodeType)[keyof typeof NodeType]; + +/** + *

    Contains information about an output from flow invoction.

    + *

    This data type is used in the following API operations:

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

    The name of the node to which input was provided.

    + * @public + */ + nodeName: string | undefined; + + /** + *

    The type of node to which input was provided.

    + * @public + */ + nodeType: NodeType | undefined; + + /** + *

    The output of the node.

    + * @public + */ + content: FlowOutputContent | undefined; +} + +/** + *

    The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

    + * @public + */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} + +/** + *

    The number of requests exceeds the service quota. Resubmit your request later.

    + * @public + */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + } +} + +/** + *

    The number of requests exceeds the limit. Resubmit your request later.

    + * @public + */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + } +} + +/** + *

    Input validation failed. Check your request parameters and retry the request.

    + * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + } +} + +/** + *

    The output of the flow.

    + *

    This data type is used in the following API operations:

    + * + * @public + */ +export type FlowResponseStream = + | FlowResponseStream.AccessDeniedExceptionMember + | FlowResponseStream.BadGatewayExceptionMember + | FlowResponseStream.ConflictExceptionMember + | FlowResponseStream.DependencyFailedExceptionMember + | FlowResponseStream.FlowCompletionEventMember + | FlowResponseStream.FlowOutputEventMember + | FlowResponseStream.InternalServerExceptionMember + | FlowResponseStream.ResourceNotFoundExceptionMember + | FlowResponseStream.ServiceQuotaExceededExceptionMember + | FlowResponseStream.ThrottlingExceptionMember + | FlowResponseStream.ValidationExceptionMember + | FlowResponseStream.$UnknownMember; + +/** + * @public + */ +export namespace FlowResponseStream { + /** + *

    Contains information about an output from flow invocation.

    + * @public + */ + export interface FlowOutputEventMember { + flowOutputEvent: FlowOutputEvent; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    Contains information about why the flow completed.

    + * @public + */ + export interface FlowCompletionEventMember { + flowOutputEvent?: never; + flowCompletionEvent: FlowCompletionEvent; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    An internal server error occurred. Retry your request.

    + * @public + */ + export interface InternalServerExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException: InternalServerException; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    Input validation failed. Check your request parameters and retry the request.

    + * @public + */ + export interface ValidationExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException: ValidationException; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

    + * @public + */ + export interface ResourceNotFoundExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException: ResourceNotFoundException; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    The number of requests exceeds the service quota. Resubmit your request later.

    + * @public + */ + export interface ServiceQuotaExceededExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException: ServiceQuotaExceededException; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    The number of requests exceeds the limit. Resubmit your request later.

    + * @public + */ + export interface ThrottlingExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException: ThrottlingException; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    The request is denied because of missing access permissions. Check your permissions and retry your request.

    + * @public + */ + export interface AccessDeniedExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException: AccessDeniedException; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    There was a conflict performing an operation. Resolve the conflict and retry your request.

    + * @public + */ + export interface ConflictExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException: ConflictException; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    There was an issue with a dependency. Check the resource configurations and retry the request.

    + * @public + */ + export interface DependencyFailedExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException: DependencyFailedException; + badGatewayException?: never; + $unknown?: never; + } + + /** + *

    There was an issue with a dependency due to a server issue. Retry your request.

    + * @public + */ + export interface BadGatewayExceptionMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException: BadGatewayException; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + flowOutputEvent?: never; + flowCompletionEvent?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + $unknown: [string, any]; + } + + export interface Visitor { + flowOutputEvent: (value: FlowOutputEvent) => T; + flowCompletionEvent: (value: FlowCompletionEvent) => T; + internalServerException: (value: InternalServerException) => T; + validationException: (value: ValidationException) => T; + resourceNotFoundException: (value: ResourceNotFoundException) => T; + serviceQuotaExceededException: (value: ServiceQuotaExceededException) => T; + throttlingException: (value: ThrottlingException) => T; + accessDeniedException: (value: AccessDeniedException) => T; + conflictException: (value: ConflictException) => T; + dependencyFailedException: (value: DependencyFailedException) => T; + badGatewayException: (value: BadGatewayException) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: FlowResponseStream, visitor: Visitor): T => { + if (value.flowOutputEvent !== undefined) return visitor.flowOutputEvent(value.flowOutputEvent); + if (value.flowCompletionEvent !== undefined) return visitor.flowCompletionEvent(value.flowCompletionEvent); + if (value.internalServerException !== undefined) + return visitor.internalServerException(value.internalServerException); + if (value.validationException !== undefined) return visitor.validationException(value.validationException); + if (value.resourceNotFoundException !== undefined) + return visitor.resourceNotFoundException(value.resourceNotFoundException); + if (value.serviceQuotaExceededException !== undefined) + return visitor.serviceQuotaExceededException(value.serviceQuotaExceededException); + if (value.throttlingException !== undefined) return visitor.throttlingException(value.throttlingException); + if (value.accessDeniedException !== undefined) return visitor.accessDeniedException(value.accessDeniedException); + if (value.conflictException !== undefined) return visitor.conflictException(value.conflictException); + if (value.dependencyFailedException !== undefined) + return visitor.dependencyFailedException(value.dependencyFailedException); + if (value.badGatewayException !== undefined) return visitor.badGatewayException(value.badGatewayException); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface InvokeFlowResponse { + /** + *

    The output of the flow, returned as a stream. If there's an error, the error is returned.

    + * @public + */ + responseStream: AsyncIterable | undefined; +} + +/** + *

    The property contains the file to chat with, along with its attributes.

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

    The MIME type of data contained in the file used for chat.

    + * @public + */ + mediaType: string | undefined; + + /** + *

    The byte value of the file to attach, encoded as Base-64 string. The maximum size of all files that is attached is 10MB. You can attach a maximum of 5 files.

    + * @public + */ + data: Uint8Array | undefined; +} + +/** + *

    Contains details of the s3 object where the source file is located.

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

    The uri of the s3 object.

    + * @public + */ + uri: string | undefined; +} + +/** + * @public + * @enum + */ +export const FileSourceType = { + BYTE_CONTENT: "BYTE_CONTENT", + S3: "S3", +} as const; + +/** + * @public + */ +export type FileSourceType = (typeof FileSourceType)[keyof typeof FileSourceType]; + +/** + *

    The source file of the content contained in the wrapper object.

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

    The source type of the files to attach.

    + * @public + */ + sourceType: FileSourceType | undefined; + + /** + *

    The s3 location of the files to attach.

    + * @public + */ + s3Location?: S3ObjectFile; + + /** + *

    The data and the text of the attached files.

    + * @public + */ + byteContent?: ByteContentFile; +} + +/** + * @public + * @enum + */ +export const FileUseCase = { + CHAT: "CHAT", + CODE_INTERPRETER: "CODE_INTERPRETER", +} as const; + +/** + * @public + */ +export type FileUseCase = (typeof FileUseCase)[keyof typeof FileUseCase]; + +/** + *

    Contains details of the source files.

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

    The name of the source file.

    + * @public + */ + name: string | undefined; + + /** + *

    Specifies where the files are located.

    + * @public + */ + source: FileSource | undefined; + + /** + *

    Specifies how the source files will be used by the code interpreter.

    + * @public + */ + useCase: FileUseCase | undefined; +} + +/** + *

    Specifies the name that the metadata attribute must match and the value to which to compare the value of the metadata attribute. For more information, see Query configurations.

    + *

    This data type is used in the following API operations:

    + * + * @public + */ +export interface FilterAttribute { /** - *

    The name of the dependency that caused the issue, such as Amazon Bedrock, Lambda, or STS.

    + *

    The name that the metadata attribute must match.

    * @public */ - resourceName?: string; + key: string | undefined; /** - * @internal + *

    The value to whcih to compare the value of the metadata attribute.

    + * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "DependencyFailedException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, DependencyFailedException.prototype); - this.resourceName = opts.resourceName; - } + value: __DocumentType | undefined; } /** - *

    An internal server error occurred. Retry your request.

    * @public + * @enum */ -export class InternalServerException extends __BaseException { - readonly name: "InternalServerException" = "InternalServerException"; - readonly $fault: "server" = "server"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts, - }); - Object.setPrototypeOf(this, InternalServerException.prototype); - } -} +export const SearchType = { + HYBRID: "HYBRID", + SEMANTIC: "SEMANTIC", +} as const; + +/** + * @public + */ +export type SearchType = (typeof SearchType)[keyof typeof SearchType]; /** *

    Contains the body of the API response.

    @@ -391,92 +1177,6 @@ export namespace InvocationResultMember { }; } -/** - *

    Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Control session context.

    - * @public - */ -export interface SessionState { - /** - *

    Contains attributes that persist across a session and the values of those attributes.

    - * @public - */ - sessionAttributes?: Record; - - /** - *

    Contains attributes that persist across a prompt and the values of those attributes. These attributes replace the $prompt_session_attributes$ placeholder variable in the orchestration prompt template. For more information, see Prompt template placeholder variables.

    - * @public - */ - promptSessionAttributes?: Record; - - /** - *

    Contains information about the results from the action group invocation. For more information, see Return control to the agent developer and Control session context.

    - * - *

    If you include this field, the inputText field will be ignored.

    - *
    - * @public - */ - returnControlInvocationResults?: InvocationResultMember[]; - - /** - *

    The identifier of the invocation of an action. This value must match the invocationId returned in the InvokeAgent response for the action whose results are provided in the returnControlInvocationResults field. For more information, see Return control to the agent developer and Control session context.

    - * @public - */ - invocationId?: string; -} - -/** - * @public - */ -export interface InvokeAgentRequest { - /** - *

    Contains parameters that specify various attributes of the session. For more information, see Control session context.

    - * - *

    If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

    - *
    - * @public - */ - sessionState?: SessionState; - - /** - *

    The unique identifier of the agent to use.

    - * @public - */ - agentId: string | undefined; - - /** - *

    The alias of the agent to use.

    - * @public - */ - agentAliasId: string | undefined; - - /** - *

    The unique identifier of the session. Use the same value across requests to continue the same conversation.

    - * @public - */ - sessionId: string | undefined; - - /** - *

    Specifies whether to end the session with the agent or not.

    - * @public - */ - endSession?: boolean; - - /** - *

    Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see Trace enablement.

    - * @public - */ - enableTrace?: boolean; - - /** - *

    The prompt text to send the agent.

    - * - *

    If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

    - *
    - * @public - */ - inputText?: string; -} - /** *

    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:

    @@ -586,7 +1286,19 @@ export interface RetrievalResultContent { } /** - *

    Contains the S3 location of the data source.

    + *

    The Confluence data source location.

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

    The Confluence host URL for the data source location.

    + * @public + */ + url?: string; +} + +/** + *

    The S3 data source location.

    *

    This data type is used in the following API operations:

    *
      *
    • @@ -606,18 +1318,46 @@ export interface RetrievalResultContent { */ export interface RetrievalResultS3Location { /** - *

      The S3 URI of the data source.

      + *

      The S3 URI for the data source location.

      * @public */ uri?: string; } +/** + *

      The Salesforce data source location.

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

      The Salesforce host URL for the data source location.

      + * @public + */ + url?: string; +} + +/** + *

      The SharePoint data source location.

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

      The SharePoint site URL for the data source location.

      + * @public + */ + url?: string; +} + /** * @public * @enum */ export const RetrievalResultLocationType = { + CONFLUENCE: "CONFLUENCE", S3: "S3", + SALESFORCE: "SALESFORCE", + SHAREPOINT: "SHAREPOINT", + WEB: "WEB", } as const; /** @@ -627,7 +1367,19 @@ export type RetrievalResultLocationType = (typeof RetrievalResultLocationType)[keyof typeof RetrievalResultLocationType]; /** - *

      Contains information about the location of the data source.

      + *

      The web URL/URLs data source location.

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

      The web URL/URLs for the data source location.

      + * @public + */ + url?: string; +} + +/** + *

      Contains information about the data source location.

      *

      This data type is used in the following API operations:

      *
        *
      • @@ -647,16 +1399,40 @@ export type RetrievalResultLocationType = */ export interface RetrievalResultLocation { /** - *

        The type of the location of the data source.

        + *

        The type of data source location.

        * @public */ type: RetrievalResultLocationType | undefined; /** - *

        Contains the S3 location of the data source.

        + *

        The S3 data source location.

        * @public */ s3Location?: RetrievalResultS3Location; + + /** + *

        The web URL/URLs data source location.

        + * @public + */ + webLocation?: RetrievalResultWebLocation; + + /** + *

        The Confluence data source location.

        + * @public + */ + confluenceLocation?: RetrievalResultConfluenceLocation; + + /** + *

        The Salesforce data source location.

        + * @public + */ + salesforceLocation?: RetrievalResultSalesforceLocation; + + /** + *

        The SharePoint data source location.

        + * @public + */ + sharePointLocation?: RetrievalResultSharePointLocation; } /** @@ -754,23 +1530,39 @@ export interface PayloadPart { } /** - *

        The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

        + *

        Contains details of the response from code interpreter.

        * @public */ -export class ResourceNotFoundException extends __BaseException { - readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; - readonly $fault: "client" = "client"; +export interface OutputFile { /** - * @internal + *

        The name of the file containing response from code interpreter.

        + * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceNotFoundException.prototype); - } + name?: string; + + /** + *

        The type of file that contains response from the code interpreter.

        + * @public + */ + type?: string; + + /** + *

        The byte count of files that contains response from code interpreter.

        + * @public + */ + bytes?: Uint8Array; +} + +/** + *

        Contains intermediate response for code interpreter if any files have been generated.

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

        Files containing intermediate response for the user.

        + * @public + */ + files?: OutputFile[]; } /** @@ -1017,58 +1809,18 @@ export namespace InvocationInputMember { *
      * @public */ -export interface ReturnControlPayload { - /** - *

      A list of objects that contain information about the parameters and inputs that need to be sent into the API operation or function, based on what the agent determines from its session with the user.

      - * @public - */ - invocationInputs?: InvocationInputMember[]; - - /** - *

      The identifier of the action group invocation.

      - * @public - */ - invocationId?: string; -} - -/** - *

      The number of requests exceeds the service quota. Resubmit your request later.

      - * @public - */ -export class ServiceQuotaExceededException extends __BaseException { - readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ServiceQuotaExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); - } -} - -/** - *

      The number of requests exceeds the limit. Resubmit your request later.

      - * @public - */ -export class ThrottlingException extends __BaseException { - readonly name: "ThrottlingException" = "ThrottlingException"; - readonly $fault: "client" = "client"; +export interface ReturnControlPayload { /** - * @internal + *

      A list of objects that contain information about the parameters and inputs that need to be sent into the API operation or function, based on what the agent determines from its session with the user.

      + * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ThrottlingException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ThrottlingException.prototype); - } + invocationInputs?: InvocationInputMember[]; + + /** + *

      The identifier of the action group invocation.

      + * @public + */ + invocationId?: string; } /** @@ -1526,12 +2278,31 @@ export interface GuardrailTrace { outputAssessments?: GuardrailAssessment[]; } +/** + *

      Contains information about the code interpreter being invoked.

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

      The code for the code interpreter to use.

      + * @public + */ + code?: string; + + /** + *

      Files that are uploaded for code interpreter to use.

      + * @public + */ + files?: string[]; +} + /** * @public * @enum */ export const InvocationType = { ACTION_GROUP: "ACTION_GROUP", + ACTION_GROUP_CODE_INTERPRETER: "ACTION_GROUP_CODE_INTERPRETER", FINISH: "FINISH", KNOWLEDGE_BASE: "KNOWLEDGE_BASE", } as const; @@ -1587,6 +2358,12 @@ export interface InvocationInput { * @public */ knowledgeBaseLookupInput?: KnowledgeBaseLookupInput; + + /** + *

      Contains information about the code interpreter to be invoked.

      + * @public + */ + codeInterpreterInvocationInput?: CodeInterpreterInvocationInput; } /** @@ -1714,6 +2491,36 @@ export interface ModelInvocationInput { parserMode?: CreationMode; } +/** + *

      Contains the JSON-formatted string returned by the API invoked by the code interpreter.

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

      Contains the successful output returned from code execution

      + * @public + */ + executionOutput?: string; + + /** + *

      Contains the error returned from code execution.

      + * @public + */ + executionError?: string; + + /** + *

      Contains output files, if generated by code execution.

      + * @public + */ + files?: string[]; + + /** + *

      Indicates if the execution of the code timed out.

      + * @public + */ + executionTimeout?: boolean; +} + /** *

      Contains details about the response to the user.

      * @public @@ -1850,6 +2657,12 @@ export interface Observation { * @public */ repromptResponse?: RepromptResponse; + + /** + *

      Contains the JSON-formatted string returned by the API invoked by the code interpreter.

      + * @public + */ + codeInterpreterInvocationOutput?: CodeInterpreterInvocationOutput; } /** @@ -2318,26 +3131,6 @@ export interface TracePart { trace?: Trace; } -/** - *

      Input validation failed. Check your request parameters and retry the request.

      - * @public - */ -export class ValidationException extends __BaseException { - readonly name: "ValidationException" = "ValidationException"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ValidationException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ValidationException.prototype); - } -} - /** *

      The response from invoking the agent and associated citations and trace information.

      * @public @@ -2348,6 +3141,7 @@ export type ResponseStream = | ResponseStream.ChunkMember | ResponseStream.ConflictExceptionMember | ResponseStream.DependencyFailedExceptionMember + | ResponseStream.FilesMember | ResponseStream.InternalServerExceptionMember | ResponseStream.ResourceNotFoundExceptionMember | ResponseStream.ReturnControlMember @@ -2378,6 +3172,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2398,6 +3193,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2418,6 +3214,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2438,6 +3235,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2458,6 +3256,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2478,6 +3277,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2498,6 +3298,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2518,6 +3319,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2538,6 +3340,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2558,6 +3361,7 @@ export namespace ResponseStream { conflictException: ConflictException; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2578,6 +3382,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException: DependencyFailedException; badGatewayException?: never; + files?: never; $unknown?: never; } @@ -2598,6 +3403,28 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException: BadGatewayException; + files?: never; + $unknown?: never; + } + + /** + *

      Contains intermediate response for code interpreter if any files have been generated.

      + * @public + */ + export interface FilesMember { + chunk?: never; + trace?: never; + returnControl?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + files: FilePart; $unknown?: never; } @@ -2617,6 +3444,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + files?: never; $unknown: [string, any]; } @@ -2633,6 +3461,7 @@ export namespace ResponseStream { conflictException: (value: ConflictException) => T; dependencyFailedException: (value: DependencyFailedException) => T; badGatewayException: (value: BadGatewayException) => T; + files: (value: FilePart) => T; _: (name: string, value: any) => T; } @@ -2653,6 +3482,7 @@ export namespace ResponseStream { if (value.dependencyFailedException !== undefined) return visitor.dependencyFailedException(value.dependencyFailedException); if (value.badGatewayException !== undefined) return visitor.badGatewayException(value.badGatewayException); + if (value.files !== undefined) return visitor.files(value.files); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -2678,6 +3508,189 @@ export interface InvokeAgentResponse { * @public */ sessionId: string | undefined; + + /** + *

      The unique identifier of the agent memory.

      + * @public + */ + memoryId?: string; +} + +/** + * @public + */ +export interface DeleteAgentMemoryRequest { + /** + *

      The unique identifier of the agent to which the alias belongs.

      + * @public + */ + agentId: string | undefined; + + /** + *

      The unique identifier of an alias of an agent.

      + * @public + */ + agentAliasId: string | undefined; + + /** + *

      The unique identifier of the memory.

      + * @public + */ + memoryId?: string; +} + +/** + * @public + */ +export interface DeleteAgentMemoryResponse {} + +/** + * @public + * @enum + */ +export const MemoryType = { + SESSION_SUMMARY: "SESSION_SUMMARY", +} as const; + +/** + * @public + */ +export type MemoryType = (typeof MemoryType)[keyof typeof MemoryType]; + +/** + * @public + */ +export interface GetAgentMemoryRequest { + /** + *

      If the total number of results is greater than the maxItems value provided in the request, enter the token returned + * in the nextToken field in the response in this field to return the next batch of results.

      + * @public + */ + nextToken?: string; + + /** + *

      The maximum number of items to return in the response. If the total number of results is greater + * than this value, use the token returned in the response in the nextToken field when making another + * request to return the next batch of results.

      + * @public + */ + maxItems?: number; + + /** + *

      The unique identifier of the agent to which the alias belongs.

      + * @public + */ + agentId: string | undefined; + + /** + *

      The unique identifier of an alias of an agent.

      + * @public + */ + agentAliasId: string | undefined; + + /** + *

      The type of memory.

      + * @public + */ + memoryType: MemoryType | undefined; + + /** + *

      The unique identifier of the memory.

      + * @public + */ + memoryId: string | undefined; +} + +/** + *

      Contains details of a session summary.

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

      The unique identifier of the memory where the session summary is stored.

      + * @public + */ + memoryId?: string; + + /** + *

      The identifier for this session.

      + * @public + */ + sessionId?: string; + + /** + *

      The start time for this session.

      + * @public + */ + sessionStartTime?: Date; + + /** + *

      The time when the memory duration for the session is set to end.

      + * @public + */ + sessionExpiryTime?: Date; + + /** + *

      The summarized text for this session.

      + * @public + */ + summaryText?: string; +} + +/** + *

      Contains sessions summaries.

      + * @public + */ +export type Memory = Memory.SessionSummaryMember | Memory.$UnknownMember; + +/** + * @public + */ +export namespace Memory { + /** + *

      Contains summary of a session.

      + * @public + */ + export interface SessionSummaryMember { + sessionSummary: MemorySessionSummary; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + sessionSummary?: never; + $unknown: [string, any]; + } + + export interface Visitor { + sessionSummary: (value: MemorySessionSummary) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: Memory, visitor: Visitor): T => { + if (value.sessionSummary !== undefined) return visitor.sessionSummary(value.sessionSummary); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface GetAgentMemoryResponse { + /** + *

      If the total number of results is greater than the maxItems value provided in the request, use this token + * when making another request in the nextToken field to return the next batch of results.

      + * @public + */ + nextToken?: string; + + /** + *

      Contains details of the sessions stored in the memory

      + * @public + */ + memoryContents?: Memory[]; } /** @@ -2971,44 +3984,43 @@ export interface GenerationConfiguration { } /** - *

      Specifies the name that the metadata attribute must match and the value to which to compare the value of the metadata attribute. For more information, see Query configurations.

      - *

      This data type is used in the following API operations:

      - * * @public + * @enum */ -export interface FilterAttribute { - /** - *

      The name that the metadata attribute must match.

      - * @public - */ - key: string | undefined; +export const QueryTransformationType = { + QUERY_DECOMPOSITION: "QUERY_DECOMPOSITION", +} as const; - /** - *

      The value to whcih to compare the value of the metadata attribute.

      - * @public - */ - value: __DocumentType | undefined; -} +/** + * @public + */ +export type QueryTransformationType = (typeof QueryTransformationType)[keyof typeof QueryTransformationType]; /** + *

      To split up the prompt and retrieve multiple sources, set the transformation type to + * QUERY_DECOMPOSITION.

      * @public - * @enum */ -export const SearchType = { - HYBRID: "HYBRID", - SEMANTIC: "SEMANTIC", -} as const; +export interface QueryTransformationConfiguration { + /** + *

      The type of transformation to apply to the prompt.

      + * @public + */ + type: QueryTransformationType | undefined; +} /** + *

      Settings for how the model processes the prompt prior to retrieval and generation.

      * @public */ -export type SearchType = (typeof SearchType)[keyof typeof SearchType]; +export interface OrchestrationConfiguration { + /** + *

      To split up the prompt and retrieve multiple sources, set the transformation type to + * QUERY_DECOMPOSITION.

      + * @public + */ + queryTransformationConfiguration: QueryTransformationConfiguration | undefined; +} /** * @public @@ -3081,7 +4093,7 @@ export interface RetrieveAndGenerateOutput { */ export interface RetrieveAndGenerateResponse { /** - *

      The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.

      + *

      The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.

      * @public */ sessionId: string | undefined; @@ -3631,7 +4643,7 @@ export interface KnowledgeBaseVectorSearchConfiguration { } /** - *

      Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.

      + *

      Contains configurations for knowledge base query. For more information, see Query configurations.

      *

      This data type is used in the following API operations:

      *
        *
      • @@ -3653,6 +4665,24 @@ export interface KnowledgeBaseRetrievalConfiguration { vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined; } +/** + *

        Configurations to apply to a knowledge base attached to the agent during query. For more information, see Knowledge base retrieval configurations.

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

        The unique identifier for a knowledge base attached to the agent.

        + * @public + */ + knowledgeBaseId: string | undefined; + + /** + *

        The configurations to apply to the knowledge base during query. For more information, see Query configurations.

        + * @public + */ + retrievalConfiguration: KnowledgeBaseRetrievalConfiguration | undefined; +} + /** *

        Contains details about the resource being queried.

        *

        This data type is used in the following API operations:

        @@ -3688,10 +4718,16 @@ export interface KnowledgeBaseRetrieveAndGenerateConfiguration { retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration; /** - *

        Contains configurations for response generation based on the knowwledge base query results.

        + *

        Contains configurations for response generation based on the knowledge base query results.

        * @public */ generationConfiguration?: GenerationConfiguration; + + /** + *

        Settings for how the model processes the prompt prior to retrieval and generation.

        + * @public + */ + orchestrationConfiguration?: OrchestrationConfiguration; } /** @@ -3759,7 +4795,7 @@ export interface RetrieveAndGenerateConfiguration { */ export interface RetrieveAndGenerateRequest { /** - *

        The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.

        + *

        The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.

        * @public */ sessionId?: string; @@ -3783,6 +4819,110 @@ export interface RetrieveAndGenerateRequest { sessionConfiguration?: RetrieveAndGenerateSessionConfiguration; } +/** + *

        Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Control session context.

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

        Contains attributes that persist across a session and the values of those attributes.

        + * @public + */ + sessionAttributes?: Record; + + /** + *

        Contains attributes that persist across a prompt and the values of those attributes. These attributes replace the $prompt_session_attributes$ placeholder variable in the orchestration prompt template. For more information, see Prompt template placeholder variables.

        + * @public + */ + promptSessionAttributes?: Record; + + /** + *

        Contains information about the results from the action group invocation. For more information, see Return control to the agent developer and Control session context.

        + * + *

        If you include this field, the inputText field will be ignored.

        + *
        + * @public + */ + returnControlInvocationResults?: InvocationResultMember[]; + + /** + *

        The identifier of the invocation of an action. This value must match the invocationId returned in the InvokeAgent response for the action whose results are provided in the returnControlInvocationResults field. For more information, see Return control to the agent developer and Control session context.

        + * @public + */ + invocationId?: string; + + /** + *

        Contains information about the files used by code interpreter.

        + * @public + */ + files?: InputFile[]; + + /** + *

        An array of configurations, each of which applies to a knowledge base attached to the agent.

        + * @public + */ + knowledgeBaseConfigurations?: KnowledgeBaseConfiguration[]; +} + +/** + * @public + */ +export interface InvokeAgentRequest { + /** + *

        Contains parameters that specify various attributes of the session. For more information, see Control session context.

        + * + *

        If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

        + *
        + * @public + */ + sessionState?: SessionState; + + /** + *

        The unique identifier of the agent to use.

        + * @public + */ + agentId: string | undefined; + + /** + *

        The alias of the agent to use.

        + * @public + */ + agentAliasId: string | undefined; + + /** + *

        The unique identifier of the session. Use the same value across requests to continue the same conversation.

        + * @public + */ + sessionId: string | undefined; + + /** + *

        Specifies whether to end the session with the agent or not.

        + * @public + */ + endSession?: boolean; + + /** + *

        Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see Trace enablement.

        + * @public + */ + enableTrace?: boolean; + + /** + *

        The prompt text to send the agent.

        + * + *

        If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

        + *
        + * @public + */ + inputText?: string; + + /** + *

        The unique identifier of the agent memory.

        + * @public + */ + memoryId?: string; +} + /** * @internal */ @@ -3805,41 +4945,110 @@ export const ActionGroupInvocationOutputFilterSensitiveLog = (obj: ActionGroupIn /** * @internal */ -export const ApiResultFilterSensitiveLog = (obj: ApiResult): any => ({ +export const FlowInputContentFilterSensitiveLog = (obj: FlowInputContent): any => { + if (obj.document !== undefined) return { document: obj.document }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const FlowInputFilterSensitiveLog = (obj: FlowInput): any => ({ ...obj, - ...(obj.apiPath && { apiPath: SENSITIVE_STRING }), + ...(obj.content && { content: SENSITIVE_STRING }), }); /** * @internal */ -export const InvocationResultMemberFilterSensitiveLog = (obj: InvocationResultMember): any => { - if (obj.apiResult !== undefined) return { apiResult: ApiResultFilterSensitiveLog(obj.apiResult) }; - if (obj.functionResult !== undefined) return { functionResult: obj.functionResult }; +export const InvokeFlowRequestFilterSensitiveLog = (obj: InvokeFlowRequest): any => ({ + ...obj, + ...(obj.inputs && { inputs: obj.inputs.map((item) => FlowInputFilterSensitiveLog(item)) }), +}); + +/** + * @internal + */ +export const FlowCompletionEventFilterSensitiveLog = (obj: FlowCompletionEvent): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const FlowOutputEventFilterSensitiveLog = (obj: FlowOutputEvent): any => ({ + ...obj, + ...(obj.content && { content: obj.content }), +}); + +/** + * @internal + */ +export const FlowResponseStreamFilterSensitiveLog = (obj: FlowResponseStream): any => { + if (obj.flowOutputEvent !== undefined) return { flowOutputEvent: SENSITIVE_STRING }; + if (obj.flowCompletionEvent !== undefined) return { flowCompletionEvent: SENSITIVE_STRING }; + if (obj.internalServerException !== undefined) return { internalServerException: obj.internalServerException }; + if (obj.validationException !== undefined) return { validationException: obj.validationException }; + if (obj.resourceNotFoundException !== undefined) return { resourceNotFoundException: obj.resourceNotFoundException }; + if (obj.serviceQuotaExceededException !== undefined) + return { serviceQuotaExceededException: obj.serviceQuotaExceededException }; + if (obj.throttlingException !== undefined) return { throttlingException: obj.throttlingException }; + if (obj.accessDeniedException !== undefined) return { accessDeniedException: obj.accessDeniedException }; + if (obj.conflictException !== undefined) return { conflictException: obj.conflictException }; + if (obj.dependencyFailedException !== undefined) return { dependencyFailedException: obj.dependencyFailedException }; + if (obj.badGatewayException !== undefined) return { badGatewayException: obj.badGatewayException }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; /** * @internal */ -export const SessionStateFilterSensitiveLog = (obj: SessionState): any => ({ +export const InvokeFlowResponseFilterSensitiveLog = (obj: InvokeFlowResponse): any => ({ ...obj, - ...(obj.returnControlInvocationResults && { - returnControlInvocationResults: obj.returnControlInvocationResults.map((item) => - InvocationResultMemberFilterSensitiveLog(item) - ), - }), + ...(obj.responseStream && { responseStream: "STREAMING_CONTENT" }), }); /** * @internal */ -export const InvokeAgentRequestFilterSensitiveLog = (obj: InvokeAgentRequest): any => ({ +export const ByteContentFileFilterSensitiveLog = (obj: ByteContentFile): any => ({ ...obj, - ...(obj.sessionState && { sessionState: SessionStateFilterSensitiveLog(obj.sessionState) }), - ...(obj.inputText && { inputText: SENSITIVE_STRING }), + ...(obj.data && { data: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const FileSourceFilterSensitiveLog = (obj: FileSource): any => ({ + ...obj, + ...(obj.byteContent && { byteContent: ByteContentFileFilterSensitiveLog(obj.byteContent) }), +}); + +/** + * @internal + */ +export const InputFileFilterSensitiveLog = (obj: InputFile): any => ({ + ...obj, + ...(obj.source && { source: FileSourceFilterSensitiveLog(obj.source) }), +}); + +/** + * @internal + */ +export const ApiResultFilterSensitiveLog = (obj: ApiResult): any => ({ + ...obj, + ...(obj.apiPath && { apiPath: SENSITIVE_STRING }), }); +/** + * @internal + */ +export const InvocationResultMemberFilterSensitiveLog = (obj: InvocationResultMember): any => { + if (obj.apiResult !== undefined) return { apiResult: ApiResultFilterSensitiveLog(obj.apiResult) }; + if (obj.functionResult !== undefined) return { functionResult: obj.functionResult }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + /** * @internal */ @@ -3909,6 +5118,22 @@ export const PayloadPartFilterSensitiveLog = (obj: PayloadPart): any => ({ ...(obj.attribution && { attribution: AttributionFilterSensitiveLog(obj.attribution) }), }); +/** + * @internal + */ +export const OutputFileFilterSensitiveLog = (obj: OutputFile): any => ({ + ...obj, + ...(obj.bytes && { bytes: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const FilePartFilterSensitiveLog = (obj: FilePart): any => ({ + ...obj, + ...(obj.files && { files: SENSITIVE_STRING }), +}); + /** * @internal */ @@ -4222,6 +5447,7 @@ export const ResponseStreamFilterSensitiveLog = (obj: ResponseStream): any => { if (obj.conflictException !== undefined) return { conflictException: obj.conflictException }; if (obj.dependencyFailedException !== undefined) return { dependencyFailedException: obj.dependencyFailedException }; if (obj.badGatewayException !== undefined) return { badGatewayException: obj.badGatewayException }; + if (obj.files !== undefined) return { files: FilePartFilterSensitiveLog(obj.files) }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; @@ -4379,6 +5605,16 @@ export const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog = ( }), }); +/** + * @internal + */ +export const KnowledgeBaseConfigurationFilterSensitiveLog = (obj: KnowledgeBaseConfiguration): any => ({ + ...obj, + ...(obj.retrievalConfiguration && { + retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), + }), +}); + /** * @internal */ @@ -4434,3 +5670,30 @@ export const RetrieveAndGenerateRequestFilterSensitiveLog = (obj: RetrieveAndGen ), }), }); + +/** + * @internal + */ +export const SessionStateFilterSensitiveLog = (obj: SessionState): any => ({ + ...obj, + ...(obj.returnControlInvocationResults && { + returnControlInvocationResults: obj.returnControlInvocationResults.map((item) => + InvocationResultMemberFilterSensitiveLog(item) + ), + }), + ...(obj.files && { files: obj.files.map((item) => InputFileFilterSensitiveLog(item)) }), + ...(obj.knowledgeBaseConfigurations && { + knowledgeBaseConfigurations: obj.knowledgeBaseConfigurations.map((item) => + KnowledgeBaseConfigurationFilterSensitiveLog(item) + ), + }), +}); + +/** + * @internal + */ +export const InvokeAgentRequestFilterSensitiveLog = (obj: InvokeAgentRequest): any => ({ + ...obj, + ...(obj.sessionState && { sessionState: SessionStateFilterSensitiveLog(obj.sessionState) }), + ...(obj.inputText && { inputText: SENSITIVE_STRING }), +}); diff --git a/clients/client-bedrock-agent-runtime/src/pagination/GetAgentMemoryPaginator.ts b/clients/client-bedrock-agent-runtime/src/pagination/GetAgentMemoryPaginator.ts new file mode 100644 index 0000000000000..f02272cdce35d --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/pagination/GetAgentMemoryPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient"; +import { + GetAgentMemoryCommand, + GetAgentMemoryCommandInput, + GetAgentMemoryCommandOutput, +} from "../commands/GetAgentMemoryCommand"; +import { BedrockAgentRuntimePaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateGetAgentMemory: ( + config: BedrockAgentRuntimePaginationConfiguration, + input: GetAgentMemoryCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BedrockAgentRuntimePaginationConfiguration, + GetAgentMemoryCommandInput, + GetAgentMemoryCommandOutput +>(BedrockAgentRuntimeClient, GetAgentMemoryCommand, "nextToken", "nextToken", "maxItems"); diff --git a/clients/client-bedrock-agent-runtime/src/pagination/index.ts b/clients/client-bedrock-agent-runtime/src/pagination/index.ts index 13f7ad2087e80..946d9ba7ed5d8 100644 --- a/clients/client-bedrock-agent-runtime/src/pagination/index.ts +++ b/clients/client-bedrock-agent-runtime/src/pagination/index.ts @@ -1,3 +1,4 @@ +export * from "./GetAgentMemoryPaginator"; // smithy-typescript generated code export * from "./Interfaces"; export * from "./RetrievePaginator"; 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 0b3c484787e8d..3b5b380af0a04 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -15,9 +15,11 @@ import { expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, take, @@ -31,7 +33,10 @@ import { SerdeContext as __SerdeContext, } from "@smithy/types"; +import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from "../commands/DeleteAgentMemoryCommand"; +import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "../commands/GetAgentMemoryCommand"; import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "../commands/InvokeAgentCommand"; +import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "../commands/InvokeFlowCommand"; import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput, @@ -44,6 +49,7 @@ import { Attribution, BadGatewayException, ByteContentDoc, + ByteContentFile, Citation, ConflictException, ContentBody, @@ -51,27 +57,42 @@ import { ExternalSource, ExternalSourcesGenerationConfiguration, ExternalSourcesRetrieveAndGenerateConfiguration, + FilePart, + FileSource, FilterAttribute, + FlowCompletionEvent, + FlowInput, + FlowInputContent, + FlowOutputContent, + FlowOutputEvent, + FlowResponseStream, FunctionResult, GenerationConfiguration, GuardrailConfiguration, InferenceConfig, InferenceConfiguration, + InputFile, InternalServerException, InvocationResultMember, + KnowledgeBaseConfiguration, KnowledgeBaseLookupOutput, KnowledgeBaseQuery, KnowledgeBaseRetrievalConfiguration, KnowledgeBaseRetrievalResult, KnowledgeBaseRetrieveAndGenerateConfiguration, KnowledgeBaseVectorSearchConfiguration, + Memory, + MemorySessionSummary, ModelInvocationInput, Observation, + OrchestrationConfiguration, OrchestrationTrace, + OutputFile, PayloadPart, PostProcessingTrace, PreProcessingTrace, PromptTemplate, + QueryTransformationConfiguration, ResourceNotFoundException, ResponseStream, RetrievalFilter, @@ -81,6 +102,7 @@ import { RetrievedReference, ReturnControlPayload, S3ObjectDoc, + S3ObjectFile, ServiceQuotaExceededException, SessionState, TextInferenceConfig, @@ -90,6 +112,49 @@ import { ValidationException, } from "../models/models_0"; +/** + * serializeAws_restJson1DeleteAgentMemoryCommand + */ +export const se_DeleteAgentMemoryCommand = async ( + input: DeleteAgentMemoryCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/memories"); + b.p("agentId", () => input.agentId!, "{agentId}", false); + b.p("agentAliasId", () => input.agentAliasId!, "{agentAliasId}", false); + const query: any = map({ + [_mI]: [, input[_mI]!], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetAgentMemoryCommand + */ +export const se_GetAgentMemoryCommand = async ( + input: GetAgentMemoryCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/memories"); + b.p("agentId", () => input.agentId!, "{agentId}", false); + b.p("agentAliasId", () => input.agentAliasId!, "{agentAliasId}", false); + const query: any = map({ + [_nT]: [, input[_nT]!], + [_mIa]: [() => input.maxItems !== void 0, () => input[_mIa]!.toString()], + [_mT]: [, __expectNonNull(input[_mT]!, `memoryType`)], + [_mI]: [, __expectNonNull(input[_mI]!, `memoryId`)], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + /** * serializeAws_restJson1InvokeAgentCommand */ @@ -111,7 +176,32 @@ export const se_InvokeAgentCommand = async ( enableTrace: [], endSession: [], inputText: [], - sessionState: (_) => _json(_), + memoryId: [], + sessionState: (_) => se_SessionState(_, context), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1InvokeFlowCommand + */ +export const se_InvokeFlowCommand = async ( + input: InvokeFlowCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}"); + b.p("flowIdentifier", () => input.flowIdentifier!, "{flowIdentifier}", false); + b.p("flowAliasIdentifier", () => input.flowAliasIdentifier!, "{flowAliasIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + inputs: (_) => se_FlowInputs(_, context), }) ); b.m("POST").h(headers).b(body); @@ -168,6 +258,45 @@ export const se_RetrieveAndGenerateCommand = async ( return b.build(); }; +/** + * deserializeAws_restJson1DeleteAgentMemoryCommand + */ +export const de_DeleteAgentMemoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentMemoryCommand + */ +export const de_GetAgentMemoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + memoryContents: (_) => de_Memories(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1InvokeAgentCommand */ @@ -182,12 +311,31 @@ export const de_InvokeAgentCommand = async ( $metadata: deserializeMetadata(output), [_cT]: [, output.headers[_xabact]], [_sI]: [, output.headers[_xabasi]], + [_mI]: [, output.headers[_xabami]], }); const data: any = output.body; contents.completion = de_ResponseStream(data, context); return contents; }; +/** + * deserializeAws_restJson1InvokeFlowCommand + */ +export const de_InvokeFlowCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = output.body; + contents.responseStream = de_FlowResponseStream(data, context); + return contents; +}; + /** * deserializeAws_restJson1RetrieveCommand */ @@ -452,6 +600,81 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1FlowResponseStream + */ +const de_FlowResponseStream = ( + output: any, + context: __SerdeContext & __EventStreamSerdeContext +): AsyncIterable => { + return context.eventStreamMarshaller.deserialize(output, async (event) => { + if (event["flowOutputEvent"] != null) { + return { + flowOutputEvent: await de_FlowOutputEvent_event(event["flowOutputEvent"], context), + }; + } + if (event["flowCompletionEvent"] != null) { + return { + flowCompletionEvent: await de_FlowCompletionEvent_event(event["flowCompletionEvent"], context), + }; + } + if (event["internalServerException"] != null) { + return { + internalServerException: await de_InternalServerException_event(event["internalServerException"], context), + }; + } + if (event["validationException"] != null) { + return { + validationException: await de_ValidationException_event(event["validationException"], context), + }; + } + if (event["resourceNotFoundException"] != null) { + return { + resourceNotFoundException: await de_ResourceNotFoundException_event( + event["resourceNotFoundException"], + context + ), + }; + } + if (event["serviceQuotaExceededException"] != null) { + return { + serviceQuotaExceededException: await de_ServiceQuotaExceededException_event( + event["serviceQuotaExceededException"], + context + ), + }; + } + if (event["throttlingException"] != null) { + return { + throttlingException: await de_ThrottlingException_event(event["throttlingException"], context), + }; + } + if (event["accessDeniedException"] != null) { + return { + accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context), + }; + } + if (event["conflictException"] != null) { + return { + conflictException: await de_ConflictException_event(event["conflictException"], context), + }; + } + if (event["dependencyFailedException"] != null) { + return { + dependencyFailedException: await de_DependencyFailedException_event( + event["dependencyFailedException"], + context + ), + }; + } + if (event["badGatewayException"] != null) { + return { + badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context), + }; + } + return { $unknown: output }; + }); +}; /** * deserializeAws_restJson1ResponseStream */ @@ -529,6 +752,11 @@ const de_ResponseStream = ( badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context), }; } + if (event["files"] != null) { + return { + files: await de_FilePart_event(event["files"], context), + }; + } return { $unknown: output }; }); }; @@ -563,6 +791,24 @@ const de_DependencyFailedException_event = async ( }; return de_DependencyFailedExceptionRes(parsedOutput, context); }; +const de_FilePart_event = async (output: any, context: __SerdeContext): Promise => { + const contents: FilePart = {} as any; + const data: any = await parseBody(output.body, context); + Object.assign(contents, de_FilePart(data, context)); + return contents; +}; +const de_FlowCompletionEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: FlowCompletionEvent = {} as any; + const data: any = await parseBody(output.body, context); + Object.assign(contents, _json(data)); + return contents; +}; +const de_FlowOutputEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: FlowOutputEvent = {} as any; + const data: any = await parseBody(output.body, context); + Object.assign(contents, de_FlowOutputEvent(data, context)); + return contents; +}; const de_InternalServerException_event = async ( output: any, context: __SerdeContext @@ -658,6 +904,16 @@ const se_ByteContentDoc = (input: ByteContentDoc, context: __SerdeContext): any }); }; +/** + * serializeAws_restJson1ByteContentFile + */ +const se_ByteContentFile = (input: ByteContentFile, context: __SerdeContext): any => { + return take(input, { + data: context.base64Encoder, + mediaType: [], + }); +}; + // se_ContentBody omitted. /** @@ -711,6 +967,17 @@ const se_ExternalSourcesRetrieveAndGenerateConfiguration = ( }); }; +/** + * serializeAws_restJson1FileSource + */ +const se_FileSource = (input: FileSource, context: __SerdeContext): any => { + return take(input, { + byteContent: (_) => se_ByteContentFile(_, context), + s3Location: _json, + sourceType: [], + }); +}; + /** * serializeAws_restJson1FilterAttribute */ @@ -728,6 +995,38 @@ const se_FilterValue = (input: __DocumentType, context: __SerdeContext): any => return input; }; +/** + * serializeAws_restJson1FlowInput + */ +const se_FlowInput = (input: FlowInput, context: __SerdeContext): any => { + return take(input, { + content: (_) => se_FlowInputContent(_, context), + nodeName: [], + nodeOutputName: [], + }); +}; + +/** + * serializeAws_restJson1FlowInputContent + */ +const se_FlowInputContent = (input: FlowInputContent, context: __SerdeContext): any => { + return FlowInputContent.visit(input, { + document: (value) => ({ document: se_Document(value, context) }), + _: (name, value) => ({ name: value } as any), + }); +}; + +/** + * serializeAws_restJson1FlowInputs + */ +const se_FlowInputs = (input: FlowInput[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_FlowInput(entry, context); + }); +}; + // se_FunctionResult omitted. /** @@ -753,8 +1052,51 @@ const se_InferenceConfig = (input: InferenceConfig, context: __SerdeContext): an }); }; +/** + * serializeAws_restJson1InputFile + */ +const se_InputFile = (input: InputFile, context: __SerdeContext): any => { + return take(input, { + name: [], + source: (_) => se_FileSource(_, context), + useCase: [], + }); +}; + +/** + * serializeAws_restJson1InputFiles + */ +const se_InputFiles = (input: InputFile[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_InputFile(entry, context); + }); +}; + // se_InvocationResultMember omitted. +/** + * serializeAws_restJson1KnowledgeBaseConfiguration + */ +const se_KnowledgeBaseConfiguration = (input: KnowledgeBaseConfiguration, context: __SerdeContext): any => { + return take(input, { + knowledgeBaseId: [], + retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context), + }); +}; + +/** + * serializeAws_restJson1KnowledgeBaseConfigurations + */ +const se_KnowledgeBaseConfigurations = (input: KnowledgeBaseConfiguration[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_KnowledgeBaseConfiguration(entry, context); + }); +}; + // se_KnowledgeBaseQuery omitted. /** @@ -780,6 +1122,7 @@ const se_KnowledgeBaseRetrieveAndGenerateConfiguration = ( generationConfiguration: (_) => se_GenerationConfiguration(_, context), knowledgeBaseId: [], modelArn: [], + orchestrationConfiguration: _json, retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context), }); }; @@ -798,10 +1141,14 @@ const se_KnowledgeBaseVectorSearchConfiguration = ( }); }; +// se_OrchestrationConfiguration omitted. + // se_PromptSessionAttributesMap omitted. // se_PromptTemplate omitted. +// se_QueryTransformationConfiguration omitted. + // se_RAGStopSequences omitted. // se_ResponseBody omitted. @@ -858,9 +1205,23 @@ const se_RetrieveAndGenerateConfiguration = (input: RetrieveAndGenerateConfigura // se_S3ObjectDoc omitted. +// se_S3ObjectFile omitted. + // se_SessionAttributesMap omitted. -// se_SessionState omitted. +/** + * serializeAws_restJson1SessionState + */ +const se_SessionState = (input: SessionState, context: __SerdeContext): any => { + return take(input, { + files: (_) => se_InputFiles(_, context), + invocationId: [], + knowledgeBaseConfigurations: (_) => se_KnowledgeBaseConfigurations(_, context), + promptSessionAttributes: _json, + returnControlInvocationResults: _json, + sessionAttributes: _json, + }); +}; /** * serializeAws_restJson1TextInferenceConfig @@ -874,6 +1235,13 @@ const se_TextInferenceConfig = (input: TextInferenceConfig, context: __SerdeCont }); }; +/** + * serializeAws_restJson1Document + */ +const se_Document = (input: __DocumentType, context: __SerdeContext): any => { + return input; +}; + // de_ActionGroupInvocationInput omitted. // de_ActionGroupInvocationOutput omitted. @@ -919,12 +1287,52 @@ const de_Citations = (output: any, context: __SerdeContext): Citation[] => { return retVal; }; +// de_CodeInterpreterInvocationInput omitted. + +// de_CodeInterpreterInvocationOutput omitted. + // de_ContentMap omitted. // de_FailureTrace omitted. +/** + * deserializeAws_restJson1FilePart + */ +const de_FilePart = (output: any, context: __SerdeContext): FilePart => { + return take(output, { + files: (_: any) => de_OutputFiles(_, context), + }) as any; +}; + +// de_Files omitted. + // de_FinalResponse omitted. +// de_FlowCompletionEvent omitted. + +/** + * deserializeAws_restJson1FlowOutputContent + */ +const de_FlowOutputContent = (output: any, context: __SerdeContext): FlowOutputContent => { + if (output.document != null) { + return { + document: de_Document(output.document, context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restJson1FlowOutputEvent + */ +const de_FlowOutputEvent = (output: any, context: __SerdeContext): FlowOutputEvent => { + return take(output, { + content: (_: any) => de_FlowOutputContent(__expectUnion(_), context), + nodeName: __expectString, + nodeType: __expectString, + }) as any; +}; + // de_FunctionInvocationInput omitted. // de_FunctionParameter omitted. @@ -1025,6 +1433,43 @@ const de_KnowledgeBaseRetrievalResults = (output: any, context: __SerdeContext): return retVal; }; +/** + * deserializeAws_restJson1Memories + */ +const de_Memories = (output: any, context: __SerdeContext): Memory[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_Memory(__expectUnion(entry), context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1Memory + */ +const de_Memory = (output: any, context: __SerdeContext): Memory => { + if (output.sessionSummary != null) { + return { + sessionSummary: de_MemorySessionSummary(output.sessionSummary, context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restJson1MemorySessionSummary + */ +const de_MemorySessionSummary = (output: any, context: __SerdeContext): MemorySessionSummary => { + return take(output, { + memoryId: __expectString, + sessionExpiryTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionId: __expectString, + sessionStartTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + summaryText: __expectString, + }) as any; +}; + /** * deserializeAws_restJson1ModelInvocationInput */ @@ -1046,6 +1491,7 @@ const de_ModelInvocationInput = (output: any, context: __SerdeContext): ModelInv const de_Observation = (output: any, context: __SerdeContext): Observation => { return take(output, { actionGroupInvocationOutput: _json, + codeInterpreterInvocationOutput: _json, finalResponse: _json, knowledgeBaseLookupOutput: (_: any) => de_KnowledgeBaseLookupOutput(_, context), repromptResponse: _json, @@ -1081,6 +1527,29 @@ const de_OrchestrationTrace = (output: any, context: __SerdeContext): Orchestrat return { $unknown: Object.entries(output)[0] }; }; +/** + * deserializeAws_restJson1OutputFile + */ +const de_OutputFile = (output: any, context: __SerdeContext): OutputFile => { + return take(output, { + bytes: context.base64Decoder, + name: __expectString, + type: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1OutputFiles + */ +const de_OutputFiles = (output: any, context: __SerdeContext): OutputFile[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_OutputFile(entry, context); + }); + return retVal; +}; + // de_Parameter omitted. // de_ParameterList omitted. @@ -1147,6 +1616,8 @@ const de_PreProcessingTrace = (output: any, context: __SerdeContext): PreProcess // de_RequestBody omitted. +// de_RetrievalResultConfluenceLocation omitted. + // de_RetrievalResultContent omitted. // de_RetrievalResultLocation omitted. @@ -1173,6 +1644,12 @@ const de_RetrievalResultMetadataValue = (output: any, context: __SerdeContext): // de_RetrievalResultS3Location omitted. +// de_RetrievalResultSalesforceLocation omitted. + +// de_RetrievalResultSharePointLocation omitted. + +// de_RetrievalResultWebLocation omitted. + // de_RetrieveAndGenerateOutput omitted. /** @@ -1251,6 +1728,13 @@ const de_TracePart = (output: any, context: __SerdeContext): TracePart => { }) as any; }; +/** + * deserializeAws_restJson1Document + */ +const de_Document = (output: any, context: __SerdeContext): __DocumentType => { + return output; +}; + const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ httpStatusCode: output.statusCode, requestId: @@ -1271,6 +1755,11 @@ const isSerializableHeaderValue = (value: any): boolean => (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); const _cT = "contentType"; +const _mI = "memoryId"; +const _mIa = "maxItems"; +const _mT = "memoryType"; +const _nT = "nextToken"; const _sI = "sessionId"; const _xabact = "x-amzn-bedrock-agent-content-type"; +const _xabami = "x-amz-bedrock-agent-memory-id"; const _xabasi = "x-amz-bedrock-agent-session-id"; diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json index fff5246f7902c..ccafd788e6ac2 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json @@ -52,6 +52,18 @@ "traits": { "smithy.api#documentation": "

        The function in the action group to call.

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

        How fulfillment of the action is handled. For more information, see Handling fulfillment of the action.

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

        The unique identifier of the invocation. Only returned if the executionType is RETURN_CONTROL.

        " + } } }, "traits": { @@ -137,9 +149,15 @@ "type": "service", "version": "2023-07-26", "resources": [ + { + "target": "com.amazonaws.bedrockagentruntime#FlowResource" + }, { "target": "com.amazonaws.bedrockagentruntime#InferenceResource" }, + { + "target": "com.amazonaws.bedrockagentruntime#MemoryResource" + }, { "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResource" }, @@ -1053,6 +1071,28 @@ "smithy.api#documentation": "

        This property contains the document to chat with, along with its attributes.

        " } }, + "com.amazonaws.bedrockagentruntime#ByteContentFile": { + "type": "structure", + "members": { + "mediaType": { + "target": "com.amazonaws.bedrockagentruntime#MimeType", + "traits": { + "smithy.api#documentation": "

        The MIME type of data contained in the file used for chat.

        ", + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.bedrockagentruntime#ByteContentBlob", + "traits": { + "smithy.api#documentation": "

        The byte value of the file to attach, encoded as Base-64 string. The maximum size of all files that is attached is 10MB. You can attach a maximum of 5 files.

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

        The property contains the file to chat with, along with its attributes.

        " + } + }, "com.amazonaws.bedrockagentruntime#Citation": { "type": "structure", "members": { @@ -1079,6 +1119,58 @@ "target": "com.amazonaws.bedrockagentruntime#Citation" } }, + "com.amazonaws.bedrockagentruntime#CodeInterpreterInvocationInput": { + "type": "structure", + "members": { + "code": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The code for the code interpreter to use.

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

        Files that are uploaded for code interpreter to use.

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

        Contains information about the code interpreter being invoked.

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

        Contains the successful output returned from code execution

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

        Contains the error returned from code execution.

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

        Contains output files, if generated by code execution.

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

        Indicates if the execution of the code timed out.

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

        Contains the JSON-formatted string returned by the API invoked by the code interpreter.

        " + } + }, "com.amazonaws.bedrockagentruntime#ConflictException": { "type": "structure", "members": { @@ -1138,6 +1230,98 @@ } } }, + "com.amazonaws.bedrockagentruntime#DateTimestamp": { + "type": "timestamp", + "traits": { + "smithy.api#documentation": "Time Stamp.", + "smithy.api#timestampFormat": "date-time" + } + }, + "com.amazonaws.bedrockagentruntime#DeleteAgentMemory": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#BadGatewayException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

        Deletes memory from the specified memory identifier.

        ", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagentruntime#AgentId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the agent to which the alias belongs.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagentruntime#AgentAliasId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of an alias of an agent.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "memoryId": { + "target": "com.amazonaws.bedrockagentruntime#MemoryId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the memory.

        ", + "smithy.api#httpQuery": "memoryId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagentruntime#DependencyFailedException": { "type": "structure", "members": { @@ -1157,6 +1341,23 @@ "smithy.api#httpError": 424 } }, + "com.amazonaws.bedrockagentruntime#ExecutionType": { + "type": "enum", + "members": { + "LAMBDA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LAMBDA" + } + }, + "RETURN_CONTROL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RETURN_CONTROL" + } + } + } + }, "com.amazonaws.bedrockagentruntime#ExternalSource": { "type": "structure", "members": { @@ -1300,6 +1501,96 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#FileBody": { + "type": "blob", + "traits": { + "smithy.api#length": { + "max": 1000000 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#FilePart": { + "type": "structure", + "members": { + "files": { + "target": "com.amazonaws.bedrockagentruntime#OutputFiles", + "traits": { + "smithy.api#documentation": "

        Files containing intermediate response for the user.

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

        Contains intermediate response for code interpreter if any files have been generated.

        " + } + }, + "com.amazonaws.bedrockagentruntime#FileSource": { + "type": "structure", + "members": { + "sourceType": { + "target": "com.amazonaws.bedrockagentruntime#FileSourceType", + "traits": { + "smithy.api#documentation": "

        The source type of the files to attach.

        ", + "smithy.api#required": {} + } + }, + "s3Location": { + "target": "com.amazonaws.bedrockagentruntime#S3ObjectFile", + "traits": { + "smithy.api#documentation": "

        The s3 location of the files to attach.

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

        The data and the text of the attached files.

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

        The source file of the content contained in the wrapper object.

        " + } + }, + "com.amazonaws.bedrockagentruntime#FileSourceType": { + "type": "enum", + "members": { + "S3": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3" + } + }, + "BYTE_CONTENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BYTE_CONTENT" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#FileUseCase": { + "type": "enum", + "members": { + "CODE_INTERPRETER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CODE_INTERPRETER" + } + }, + "CHAT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CHAT" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#Files": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, "com.amazonaws.bedrockagentruntime#FilterAttribute": { "type": "structure", "members": { @@ -1354,46 +1645,274 @@ "smithy.api#sensitive": {} } }, - "com.amazonaws.bedrockagentruntime#Function": { + "com.amazonaws.bedrockagentruntime#FlowAliasIdentifier": { "type": "string", "traits": { - "smithy.api#sensitive": {} + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^(arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:flow/[0-9a-zA-Z]{10}/alias/[0-9a-zA-Z]{10})|(\\bTSTALIASID\\b|[0-9a-zA-Z]+)$" } }, - "com.amazonaws.bedrockagentruntime#FunctionInvocationInput": { + "com.amazonaws.bedrockagentruntime#FlowCompletionEvent": { "type": "structure", "members": { - "actionGroup": { - "target": "smithy.api#String", + "completionReason": { + "target": "com.amazonaws.bedrockagentruntime#FlowCompletionReason", "traits": { - "smithy.api#documentation": "

        The action group that the function belongs to.

        ", + "smithy.api#documentation": "

        The reason that the flow completed.

        ", "smithy.api#required": {} } - }, - "parameters": { - "target": "com.amazonaws.bedrockagentruntime#FunctionParameters", - "traits": { - "smithy.api#documentation": "

        A list of parameters of the function.

        " - } - }, - "function": { - "target": "smithy.api#String", + } + }, + "traits": { + "smithy.api#documentation": "

        Contains information about why a flow completed.

        \n

        This data type is used in the following API operations:

        \n ", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#FlowCompletionReason": { + "type": "enum", + "members": { + "SUCCESS": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

        The name of the function.

        " + "smithy.api#enumValue": "SUCCESS" } } - }, + } + }, + "com.amazonaws.bedrockagentruntime#FlowIdentifier": { + "type": "string", "traits": { - "smithy.api#documentation": "

        Contains information about the function that the agent predicts should be called.

        \n

        This data type is used in the following API operations:

        \n " + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^(arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:flow/[0-9a-zA-Z]{10})|([0-9a-zA-Z]{10})$" } }, - "com.amazonaws.bedrockagentruntime#FunctionParameter": { + "com.amazonaws.bedrockagentruntime#FlowInput": { "type": "structure", "members": { - "name": { - "target": "smithy.api#String", + "nodeName": { + "target": "com.amazonaws.bedrockagentruntime#NodeName", "traits": { - "smithy.api#documentation": "

        The name of the parameter.

        " + "smithy.api#documentation": "

        A name for the input of the flow input node.

        ", + "smithy.api#required": {} + } + }, + "nodeOutputName": { + "target": "com.amazonaws.bedrockagentruntime#NodeOutputName", + "traits": { + "smithy.api#documentation": "

        A name for the output of the flow input node.

        ", + "smithy.api#required": {} + } + }, + "content": { + "target": "com.amazonaws.bedrockagentruntime#FlowInputContent", + "traits": { + "smithy.api#documentation": "

        Contains information about an input into the flow.

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

        Contains information about an input into the flow and what to do with it.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#FlowInputContent": { + "type": "union", + "members": { + "document": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "

        The input for the flow input node.

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

        Contains information about an input into the flow.

        \n

        This data type is used in the following API operations:

        \n ", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#FlowInputs": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#FlowInput" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.bedrockagentruntime#FlowOutputContent": { + "type": "union", + "members": { + "document": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "

        A name for the output of the flow.

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

        Contains information about the output node.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#FlowOutputEvent": { + "type": "structure", + "members": { + "nodeName": { + "target": "com.amazonaws.bedrockagentruntime#NodeName", + "traits": { + "smithy.api#documentation": "

        The name of the node to which input was provided.

        ", + "smithy.api#required": {} + } + }, + "nodeType": { + "target": "com.amazonaws.bedrockagentruntime#NodeType", + "traits": { + "smithy.api#documentation": "

        The type of node to which input was provided.

        ", + "smithy.api#required": {} + } + }, + "content": { + "target": "com.amazonaws.bedrockagentruntime#FlowOutputContent", + "traits": { + "smithy.api#documentation": "

        The output of the node.

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

        Contains information about an output from flow invoction.

        \n

        This data type is used in the following API operations:

        \n ", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#FlowResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagentruntime#InvokeFlow" + } + ] + }, + "com.amazonaws.bedrockagentruntime#FlowResponseStream": { + "type": "union", + "members": { + "flowOutputEvent": { + "target": "com.amazonaws.bedrockagentruntime#FlowOutputEvent", + "traits": { + "smithy.api#documentation": "

        Contains information about an output from flow invocation.

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

        Contains information about why the flow completed.

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

        An internal server error occurred. Retry your request.

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

        Input validation failed. Check your request parameters and retry the request.

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

        The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

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

        The number of requests exceeds the service quota. Resubmit your request later.

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

        The number of requests exceeds the limit. Resubmit your request later.

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

        The request is denied because of missing access permissions. Check your permissions and retry your request.

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

        There was a conflict performing an operation. Resolve the conflict and retry your request.

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

        There was an issue with a dependency. Check the resource configurations and retry the request.

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

        There was an issue with a dependency due to a server issue. Retry your request.

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

        The output of the flow.

        \n

        This data type is used in the following API operations:

        \n ", + "smithy.api#streaming": {} + } + }, + "com.amazonaws.bedrockagentruntime#Function": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#FunctionInvocationInput": { + "type": "structure", + "members": { + "actionGroup": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The action group that the function belongs to.

        ", + "smithy.api#required": {} + } + }, + "parameters": { + "target": "com.amazonaws.bedrockagentruntime#FunctionParameters", + "traits": { + "smithy.api#documentation": "

        A list of parameters of the function.

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

        The name of the function.

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

        Contains information about the function that the agent predicts should be called.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#FunctionParameter": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The name of the parameter.

        " } }, "type": { @@ -1484,18 +2003,145 @@ "inferenceConfig": { "target": "com.amazonaws.bedrockagentruntime#InferenceConfig", "traits": { - "smithy.api#documentation": "

        Configuration settings for inference when using RetrieveAndGenerate to generate responses while using a knowledge base as a source.

        " + "smithy.api#documentation": "

        Configuration settings for inference when using RetrieveAndGenerate to generate responses while using a knowledge base as a source.

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

        Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used.

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

        Contains configurations for response generation based on the knowledge base query results.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#GetAgentMemory": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#GetAgentMemoryRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#GetAgentMemoryResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#BadGatewayException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

        Gets the sessions stored in the memory of the agent.

        ", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxItems", + "items": "memoryContents" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetAgentMemoryRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.bedrockagentruntime#NextToken", + "traits": { + "smithy.api#documentation": "

        If the total number of results is greater than the maxItems value provided in the request, enter the token returned \n in the nextToken field in the response in this field to return the next batch of results.

        ", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxItems": { + "target": "com.amazonaws.bedrockagentruntime#MaxResults", + "traits": { + "smithy.api#documentation": "

        The maximum number of items to return in the response. If the total number of results is greater \n than this value, use the token returned in the response in the nextToken field when making another \n request to return the next batch of results.

        ", + "smithy.api#httpQuery": "maxItems" + } + }, + "agentId": { + "target": "com.amazonaws.bedrockagentruntime#AgentId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the agent to which the alias belongs.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagentruntime#AgentAliasId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of an alias of an agent.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "memoryType": { + "target": "com.amazonaws.bedrockagentruntime#MemoryType", + "traits": { + "smithy.api#documentation": "

        The type of memory.

        ", + "smithy.api#httpQuery": "memoryType", + "smithy.api#required": {} + } + }, + "memoryId": { + "target": "com.amazonaws.bedrockagentruntime#MemoryId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the memory.

        ", + "smithy.api#httpQuery": "memoryId", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetAgentMemoryResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.bedrockagentruntime#NextToken", + "traits": { + "smithy.api#documentation": "

        If the total number of results is greater than the maxItems value provided in the request, use this token \n when making another request in the nextToken field to return the next batch of results.

        " } }, - "additionalModelRequestFields": { - "target": "com.amazonaws.bedrockagentruntime#AdditionalModelRequestFields", + "memoryContents": { + "target": "com.amazonaws.bedrockagentruntime#Memories", "traits": { - "smithy.api#documentation": "

        Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used.

        " + "smithy.api#documentation": "

        Contains details of the sessions stored in the memory

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

        Contains configurations for response generation based on the knowledge base query results.

        \n

        This data type is used in the following API operations:

        \n " + "smithy.api#output": {} } }, "com.amazonaws.bedrockagentruntime#GuadrailAction": { @@ -2326,6 +2972,41 @@ } ] }, + "com.amazonaws.bedrockagentruntime#InputFile": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The name of the source file.

        ", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.bedrockagentruntime#FileSource", + "traits": { + "smithy.api#documentation": "

        Specifies where the files are located.

        ", + "smithy.api#required": {} + } + }, + "useCase": { + "target": "com.amazonaws.bedrockagentruntime#FileUseCase", + "traits": { + "smithy.api#documentation": "

        Specifies how the source files will be used by the code interpreter.

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

        Contains details of the source files.

        " + } + }, + "com.amazonaws.bedrockagentruntime#InputFiles": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#InputFile" + } + }, "com.amazonaws.bedrockagentruntime#InputText": { "type": "string", "traits": { @@ -2374,6 +3055,12 @@ "traits": { "smithy.api#documentation": "

        Contains details about the knowledge base to look up and the query to be made.

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

        Contains information about the code interpreter to be invoked.

        " + } } }, "traits": { @@ -2453,6 +3140,12 @@ "traits": { "smithy.api#enumValue": "FINISH" } + }, + "ACTION_GROUP_CODE_INTERPRETER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTION_GROUP_CODE_INTERPRETER" + } } } }, @@ -2494,7 +3187,7 @@ } ], "traits": { - "smithy.api#documentation": "\n

        The CLI doesn't support InvokeAgent.

        \n
        \n

        Sends a prompt for the agent to process and respond to. Note the following fields for the request:

        \n
          \n
        • \n

          To continue the same conversation with an agent, use the same sessionId value in the request.

          \n
        • \n
        • \n

          To activate trace enablement, turn enableTrace to true. 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 Trace enablement.

          \n
        • \n
        • \n

          End a conversation by setting endSession to true.

          \n
        • \n
        • \n

          In the sessionState object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.

          \n
        • \n
        \n

        The response is returned in the bytes field of the chunk object.

        \n
          \n
        • \n

          The attribution object contains citations for parts of the response.

          \n
        • \n
        • \n

          If you set enableTrace to true in the request, you can trace the agent's steps and reasoning process that led it to the response.

          \n
        • \n
        • \n

          If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl field.

          \n
        • \n
        • \n

          Errors are also surfaced in the response.

          \n
        • \n
        ", + "smithy.api#documentation": "\n

        The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeAgent.

        \n
        \n

        Sends a prompt for the agent to process and respond to. Note the following fields for the request:

        \n
          \n
        • \n

          To continue the same conversation with an agent, use the same sessionId value in the request.

          \n
        • \n
        • \n

          To activate trace enablement, turn enableTrace to true. 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 Trace enablement.

          \n
        • \n
        • \n

          End a conversation by setting endSession to true.

          \n
        • \n
        • \n

          In the sessionState object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.

          \n
        • \n
        \n

        The response is returned in the bytes field of the chunk object.

        \n
          \n
        • \n

          The attribution object contains citations for parts of the response.

          \n
        • \n
        • \n

          If you set enableTrace to true in the request, you can trace the agent's steps and reasoning process that led it to the response.

          \n
        • \n
        • \n

          If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl field.

          \n
        • \n
        • \n

          Errors are also surfaced in the response.

          \n
        • \n
        ", "smithy.api#http": { "code": 200, "method": "POST", @@ -2552,6 +3245,12 @@ "traits": { "smithy.api#documentation": "

        The prompt text to send the agent.

        \n \n

        If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.

        \n
        " } + }, + "memoryId": { + "target": "com.amazonaws.bedrockagentruntime#MemoryId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the agent memory.

        " + } } }, "traits": { @@ -2584,6 +3283,106 @@ "smithy.api#httpHeader": "x-amz-bedrock-agent-session-id", "smithy.api#required": {} } + }, + "memoryId": { + "target": "com.amazonaws.bedrockagentruntime#MemoryId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the agent memory.

        ", + "smithy.api#httpHeader": "x-amz-bedrock-agent-memory-id" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#InvokeFlow": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#InvokeFlowRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#InvokeFlowResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#BadGatewayException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

        Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

        ", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}" + } + } + }, + "com.amazonaws.bedrockagentruntime#InvokeFlowRequest": { + "type": "structure", + "members": { + "flowIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#FlowIdentifier", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the flow.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "flowAliasIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#FlowAliasIdentifier", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the flow alias.

        ", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "inputs": { + "target": "com.amazonaws.bedrockagentruntime#FlowInputs", + "traits": { + "smithy.api#documentation": "

        A list of objects, each containing information about an input into the flow.

        ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#InvokeFlowResponse": { + "type": "structure", + "members": { + "responseStream": { + "target": "com.amazonaws.bedrockagentruntime#FlowResponseStream", + "traits": { + "smithy.api#documentation": "

        The output of the flow, returned as a stream. If there's an error, the error is returned.

        ", + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } } }, "traits": { @@ -2600,6 +3399,39 @@ "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$" } }, + "com.amazonaws.bedrockagentruntime#KnowledgeBaseConfiguration": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseId", + "traits": { + "smithy.api#documentation": "

        The unique identifier for a knowledge base attached to the agent.

        ", + "smithy.api#required": {} + } + }, + "retrievalConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration", + "traits": { + "smithy.api#documentation": "

        The configurations to apply to the knowledge base during query. For more information, see Query configurations.

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

        Configurations to apply to a knowledge base attached to the agent during query. For more information, see Knowledge base retrieval configurations.

        " + } + }, + "com.amazonaws.bedrockagentruntime#KnowledgeBaseConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseConfiguration" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, "com.amazonaws.bedrockagentruntime#KnowledgeBaseId": { "type": "string", "traits": { @@ -2680,7 +3512,7 @@ } }, "traits": { - "smithy.api#documentation": "

        Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.

        \n

        This data type is used in the following API operations:

        \n " + "smithy.api#documentation": "

        Contains configurations for knowledge base query. For more information, see Query configurations.

        \n

        This data type is used in the following API operations:

        \n " } }, "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResult": { @@ -2745,70 +3577,176 @@ "retrievalConfiguration": { "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration", "traits": { - "smithy.api#documentation": "

        Contains configurations for how to retrieve and return the knowledge base query.

        " + "smithy.api#documentation": "

        Contains configurations for how to retrieve and return the knowledge base query.

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

        Contains configurations for response generation based on the knowledge base query results.

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

        Settings for how the model processes the prompt prior to retrieval and generation.

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

        Contains details about the resource being queried.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#KnowledgeBaseVectorSearchConfiguration": { + "type": "structure", + "members": { + "numberOfResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#addedDefault": {}, + "smithy.api#default": 5, + "smithy.api#documentation": "

        The number of source chunks to retrieve.

        ", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "overrideSearchType": { + "target": "com.amazonaws.bedrockagentruntime#SearchType", + "traits": { + "smithy.api#documentation": "

        By default, Amazon Bedrock decides a search strategy for you. If you're using an Amazon OpenSearch Serverless vector store that contains a filterable text field, you can specify whether to query the knowledge base with a HYBRID search using both vector embeddings and raw text, or SEMANTIC search using only vector embeddings. For other vector store configurations, only SEMANTIC search is available. For more information, see Test a knowledge base.

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

        Specifies the filters to use on the metadata in the knowledge base data sources before returning results. For more information, see Query configurations.

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

        Configurations for how to perform the search query and return results. For more information, see Query configurations.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#LambdaArn": { + "type": "string" + }, + "com.amazonaws.bedrockagentruntime#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#documentation": "Max Results.", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + }, + "com.amazonaws.bedrockagentruntime#MaxTokens": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 65536 + } + } + }, + "com.amazonaws.bedrockagentruntime#MaximumLength": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 4096 + } + } + }, + "com.amazonaws.bedrockagentruntime#Memories": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#Memory" + } + }, + "com.amazonaws.bedrockagentruntime#Memory": { + "type": "union", + "members": { + "sessionSummary": { + "target": "com.amazonaws.bedrockagentruntime#MemorySessionSummary", + "traits": { + "smithy.api#documentation": "

        Contains summary of a session.

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

        Contains sessions summaries.

        " + } + }, + "com.amazonaws.bedrockagentruntime#MemoryId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 2, + "max": 100 + }, + "smithy.api#pattern": "^[0-9a-zA-Z._:-]+$" + } + }, + "com.amazonaws.bedrockagentruntime#MemoryResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagentruntime#DeleteAgentMemory" + }, + { + "target": "com.amazonaws.bedrockagentruntime#GetAgentMemory" + } + ] + }, + "com.amazonaws.bedrockagentruntime#MemorySessionSummary": { + "type": "structure", + "members": { + "memoryId": { + "target": "com.amazonaws.bedrockagentruntime#MemoryId", + "traits": { + "smithy.api#documentation": "

        The unique identifier of the memory where the session summary is stored.

        " } }, - "generationConfiguration": { - "target": "com.amazonaws.bedrockagentruntime#GenerationConfiguration", + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#SessionId", "traits": { - "smithy.api#documentation": "

        Contains configurations for response generation based on the knowwledge base query results.

        " + "smithy.api#documentation": "

        The identifier for this session.

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

        Contains details about the resource being queried.

        \n

        This data type is used in the following API operations:

        \n " - } - }, - "com.amazonaws.bedrockagentruntime#KnowledgeBaseVectorSearchConfiguration": { - "type": "structure", - "members": { - "numberOfResults": { - "target": "smithy.api#Integer", + }, + "sessionStartTime": { + "target": "com.amazonaws.bedrockagentruntime#DateTimestamp", "traits": { - "smithy.api#addedDefault": {}, - "smithy.api#default": 5, - "smithy.api#documentation": "

        The number of source chunks to retrieve.

        ", - "smithy.api#range": { - "min": 1, - "max": 100 - } + "smithy.api#documentation": "

        The start time for this session.

        " } }, - "overrideSearchType": { - "target": "com.amazonaws.bedrockagentruntime#SearchType", + "sessionExpiryTime": { + "target": "com.amazonaws.bedrockagentruntime#DateTimestamp", "traits": { - "smithy.api#documentation": "

        By default, Amazon Bedrock decides a search strategy for you. If you're using an Amazon OpenSearch Serverless vector store that contains a filterable text field, you can specify whether to query the knowledge base with a HYBRID search using both vector embeddings and raw text, or SEMANTIC search using only vector embeddings. For other vector store configurations, only SEMANTIC search is available. For more information, see Test a knowledge base.

        " + "smithy.api#documentation": "

        The time when the memory duration for the session is set to end.

        " } }, - "filter": { - "target": "com.amazonaws.bedrockagentruntime#RetrievalFilter", + "summaryText": { + "target": "com.amazonaws.bedrockagentruntime#SummaryText", "traits": { - "smithy.api#documentation": "

        Specifies the filters to use on the metadata in the knowledge base data sources before returning results. For more information, see Query configurations.

        " + "smithy.api#documentation": "

        The summarized text for this session.

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

        Configurations for how to perform the search query and return results. For more information, see Query configurations.

        \n

        This data type is used in the following API operations:

        \n " - } - }, - "com.amazonaws.bedrockagentruntime#LambdaArn": { - "type": "string" - }, - "com.amazonaws.bedrockagentruntime#MaxTokens": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 0, - "max": 65536 - } + "smithy.api#documentation": "

        Contains details of a session summary.

        " } }, - "com.amazonaws.bedrockagentruntime#MaximumLength": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 0, - "max": 4096 + "com.amazonaws.bedrockagentruntime#MemoryType": { + "type": "enum", + "members": { + "SESSION_SUMMARY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SESSION_SUMMARY" + } } } }, @@ -2876,6 +3814,65 @@ "smithy.api#pattern": "^\\S*$" } }, + "com.amazonaws.bedrockagentruntime#NodeName": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-zA-Z]([_]?[0-9a-zA-Z]){0,99}$" + } + }, + "com.amazonaws.bedrockagentruntime#NodeOutputName": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-zA-Z]([_]?[0-9a-zA-Z]){0,99}$" + } + }, + "com.amazonaws.bedrockagentruntime#NodeType": { + "type": "enum", + "members": { + "FLOW_INPUT_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FlowInputNode" + } + }, + "FLOW_OUTPUT_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FlowOutputNode" + } + }, + "LAMBDA_FUNCTION_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LambdaFunctionNode" + } + }, + "KNOWLEDGE_BASE_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KnowledgeBaseNode" + } + }, + "PROMPT_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PromptNode" + } + }, + "CONDITION_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ConditionNode" + } + }, + "LEX_NODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LexNode" + } + } + } + }, "com.amazonaws.bedrockagentruntime#NonBlankString": { "type": "string", "traits": { @@ -2920,6 +3917,12 @@ "traits": { "smithy.api#documentation": "

        Contains details about the response to reprompt the input.

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

        Contains the JSON-formatted string returned by the API invoked by the code interpreter.

        " + } } }, "traits": { @@ -2927,6 +3930,21 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#OrchestrationConfiguration": { + "type": "structure", + "members": { + "queryTransformationConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#QueryTransformationConfiguration", + "traits": { + "smithy.api#documentation": "

        To split up the prompt and retrieve multiple sources, set the transformation type to\n QUERY_DECOMPOSITION.

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

        Settings for how the model processes the prompt prior to retrieval and generation.

        " + } + }, "com.amazonaws.bedrockagentruntime#OrchestrationTrace": { "type": "union", "members": { @@ -2960,6 +3978,45 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#OutputFile": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The name of the file containing response from code interpreter.

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

        The type of file that contains response from the code interpreter.

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

        The byte count of files that contains response from code interpreter.

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

        Contains details of the response from code interpreter.

        ", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#OutputFiles": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#OutputFile" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 5 + } + } + }, "com.amazonaws.bedrockagentruntime#OutputString": { "type": "string", "traits": { @@ -3226,6 +4283,32 @@ "smithy.api#documentation": "

        Contains the parameters in the request body.

        " } }, + "com.amazonaws.bedrockagentruntime#QueryTransformationConfiguration": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagentruntime#QueryTransformationType", + "traits": { + "smithy.api#documentation": "

        The type of transformation to apply to the prompt.

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

        To split up the prompt and retrieve multiple sources, set the transformation type to\n QUERY_DECOMPOSITION.

        " + } + }, + "com.amazonaws.bedrockagentruntime#QueryTransformationType": { + "type": "enum", + "members": { + "QUERY_DECOMPOSITION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "QUERY_DECOMPOSITION" + } + } + } + }, "com.amazonaws.bedrockagentruntime#RAGStopSequences": { "type": "list", "member": { @@ -3419,6 +4502,12 @@ "traits": { "smithy.api#documentation": "

        There was an issue with a dependency due to a server issue. Retry your request.

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

        Contains intermediate response for code interpreter if any files have been generated.

        " + } } }, "traits": { @@ -3525,6 +4614,20 @@ } } }, + "com.amazonaws.bedrockagentruntime#RetrievalResultConfluenceLocation": { + "type": "structure", + "members": { + "url": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The Confluence host URL for the data source location.

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

        The Confluence data source location.

        " + } + }, "com.amazonaws.bedrockagentruntime#RetrievalResultContent": { "type": "structure", "members": { @@ -3547,19 +4650,43 @@ "type": { "target": "com.amazonaws.bedrockagentruntime#RetrievalResultLocationType", "traits": { - "smithy.api#documentation": "

        The type of the location of the data source.

        ", + "smithy.api#documentation": "

        The type of data source location.

        ", "smithy.api#required": {} } }, "s3Location": { "target": "com.amazonaws.bedrockagentruntime#RetrievalResultS3Location", "traits": { - "smithy.api#documentation": "

        Contains the S3 location of the data source.

        " + "smithy.api#documentation": "

        The S3 data source location.

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

        The web URL/URLs data source location.

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

        The Confluence data source location.

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

        The Salesforce data source location.

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

        The SharePoint data source location.

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

        Contains information about the location of the data source.

        \n

        This data type is used in the following API operations:

        \n ", + "smithy.api#documentation": "

        Contains information about the data source location.

        \n

        This data type is used in the following API operations:

        \n ", "smithy.api#sensitive": {} } }, @@ -3571,6 +4698,30 @@ "traits": { "smithy.api#enumValue": "S3" } + }, + "WEB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WEB" + } + }, + "CONFLUENCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONFLUENCE" + } + }, + "SALESFORCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SALESFORCE" + } + }, + "SHAREPOINT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SHAREPOINT" + } } } }, @@ -3607,12 +4758,54 @@ "uri": { "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "

        The S3 URI of the data source.

        " + "smithy.api#documentation": "

        The S3 URI for the data source location.

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

        The S3 data source location.

        \n

        This data type is used in the following API operations:

        \n " + } + }, + "com.amazonaws.bedrockagentruntime#RetrievalResultSalesforceLocation": { + "type": "structure", + "members": { + "url": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

        The Salesforce host URL for the data source location.

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

        The Salesforce data source location.

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

        The SharePoint site URL for the data source location.

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

        The SharePoint data source location.

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

        The web URL/URLs for the data source location.

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

        Contains the S3 location of the data source.

        \n

        This data type is used in the following API operations:

        \n " + "smithy.api#documentation": "

        The web URL/URLs data source location.

        " } }, "com.amazonaws.bedrockagentruntime#Retrieve": { @@ -3781,7 +4974,7 @@ "sessionId": { "target": "com.amazonaws.bedrockagentruntime#SessionId", "traits": { - "smithy.api#documentation": "

        The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.

        " + "smithy.api#documentation": "

        The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.

        " } }, "input": { @@ -3822,7 +5015,7 @@ "sessionId": { "target": "com.amazonaws.bedrockagentruntime#SessionId", "traits": { - "smithy.api#documentation": "

        The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.

        ", + "smithy.api#documentation": "

        The unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself.

        ", "smithy.api#required": {} } }, @@ -4026,6 +5219,21 @@ "smithy.api#documentation": "

        The unique wrapper object of the document from the S3 location.

        " } }, + "com.amazonaws.bedrockagentruntime#S3ObjectFile": { + "type": "structure", + "members": { + "uri": { + "target": "com.amazonaws.bedrockagentruntime#S3Uri", + "traits": { + "smithy.api#documentation": "

        The uri of the s3 object.

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

        Contains details of the s3 object where the source file is located.

        " + } + }, "com.amazonaws.bedrockagentruntime#S3Uri": { "type": "string", "traits": { @@ -4111,6 +5319,18 @@ "traits": { "smithy.api#documentation": "

        The identifier of the invocation of an action. This value must match the invocationId returned in the InvokeAgent response for the action whose results are provided in the returnControlInvocationResults field. For more information, see Return control to the agent developer and Control session context.

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

        Contains information about the files used by code interpreter.

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

        An array of configurations, each of which applies to a knowledge base attached to the agent.

        " + } } }, "traits": { @@ -4181,6 +5401,15 @@ } } }, + "com.amazonaws.bedrockagentruntime#SummaryText": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 25000000 + } + } + }, "com.amazonaws.bedrockagentruntime#Temperature": { "type": "float", "traits": {