From f62fcc0a1d210615c24662bb7280cc8f1efa3b8d Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 27 Feb 2025 19:20:42 +0000 Subject: [PATCH] feat(client-bedrock-agent-runtime): Introduces Sessions (preview) to enable stateful conversations in GenAI applications. --- .../client-bedrock-agent-runtime/README.md | 126 +- .../src/BedrockAgentRuntime.ts | 261 +++ .../src/BedrockAgentRuntimeClient.ts | 52 +- .../src/commands/CreateInvocationCommand.ts | 140 ++ .../src/commands/CreateSessionCommand.ts | 158 ++ .../src/commands/DeleteSessionCommand.ts | 114 + .../src/commands/EndSessionCommand.ts | 118 + .../src/commands/GetInvocationStepCommand.ts | 138 ++ .../src/commands/GetSessionCommand.ts | 119 + .../src/commands/InvokeAgentCommand.ts | 8 +- .../src/commands/InvokeInlineAgentCommand.ts | 8 +- .../commands/ListInvocationStepsCommand.ts | 122 ++ .../src/commands/ListInvocationsCommand.ts | 120 ++ .../src/commands/ListSessionsCommand.ts | 118 + .../commands/ListTagsForResourceCommand.ts | 113 + .../src/commands/PutInvocationStepCommand.ts | 163 ++ .../commands/RetrieveAndGenerateCommand.ts | 8 +- .../RetrieveAndGenerateStreamCommand.ts | 6 +- .../src/commands/RetrieveCommand.ts | 8 +- .../src/commands/TagResourceCommand.ts | 115 + .../src/commands/UntagResourceCommand.ts | 112 + .../src/commands/UpdateSessionCommand.ts | 121 ++ .../src/commands/index.ts | 14 + .../src/models/index.ts | 1 + .../src/models/models_0.ts | 1381 +++++------- .../src/models/models_1.ts | 1200 +++++++++++ .../ListInvocationStepsPaginator.ts | 24 + .../pagination/ListInvocationsPaginator.ts | 24 + .../src/pagination/ListSessionsPaginator.ts | 24 + .../src/pagination/index.ts | 3 + .../src/protocols/Aws_restJson1.ts | 949 +++++++- .../aws-models/bedrock-agent-runtime.json | 1913 ++++++++++++++++- 32 files changed, 6803 insertions(+), 978 deletions(-) create mode 100644 clients/client-bedrock-agent-runtime/src/commands/CreateInvocationCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/CreateSessionCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/DeleteSessionCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/EndSessionCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/GetInvocationStepCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/GetSessionCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/ListInvocationStepsCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/ListInvocationsCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/ListSessionsCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/ListTagsForResourceCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/PutInvocationStepCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/TagResourceCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/UntagResourceCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/commands/UpdateSessionCommand.ts create mode 100644 clients/client-bedrock-agent-runtime/src/models/models_1.ts create mode 100644 clients/client-bedrock-agent-runtime/src/pagination/ListInvocationStepsPaginator.ts create mode 100644 clients/client-bedrock-agent-runtime/src/pagination/ListInvocationsPaginator.ts create mode 100644 clients/client-bedrock-agent-runtime/src/pagination/ListSessionsPaginator.ts diff --git a/clients/client-bedrock-agent-runtime/README.md b/clients/client-bedrock-agent-runtime/README.md index f4b0060f3a36..753a1a54ca72 100644 --- a/clients/client-bedrock-agent-runtime/README.md +++ b/clients/client-bedrock-agent-runtime/README.md @@ -23,16 +23,16 @@ using your favorite package manager: The AWS SDK is modulized by clients and commands. To send a request, you only need to import the `BedrockAgentRuntimeClient` and -the commands you need, for example `RetrieveCommand`: +the commands you need, for example `ListSessionsCommand`: ```js // ES5 example -const { BedrockAgentRuntimeClient, RetrieveCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); +const { BedrockAgentRuntimeClient, ListSessionsCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); ``` ```ts // ES6+ example -import { BedrockAgentRuntimeClient, RetrieveCommand } from "@aws-sdk/client-bedrock-agent-runtime"; +import { BedrockAgentRuntimeClient, ListSessionsCommand } from "@aws-sdk/client-bedrock-agent-runtime"; ``` ### Usage @@ -51,7 +51,7 @@ const client = new BedrockAgentRuntimeClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new RetrieveCommand(params); +const command = new ListSessionsCommand(params); ``` #### Async/await @@ -130,7 +130,7 @@ const client = new AWS.BedrockAgentRuntime({ region: "REGION" }); // async/await. try { - const data = await client.retrieve(params); + const data = await client.listSessions(params); // process data. } catch (error) { // error handling. @@ -138,7 +138,7 @@ try { // Promises. client - .retrieve(params) + .listSessions(params) .then((data) => { // process data. }) @@ -147,7 +147,7 @@ client }); // callbacks. -client.retrieve(params, (err, data) => { +client.listSessions(params, (err, data) => { // process err and data. }); ``` @@ -203,6 +203,22 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +CreateInvocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/CreateInvocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/CreateInvocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/CreateInvocationCommandOutput/) + +
+
+ +CreateSession + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/CreateSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/CreateSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/CreateSessionCommandOutput/) + +
DeleteAgentMemory @@ -210,6 +226,22 @@ 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/) +
+
+ +DeleteSession + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/DeleteSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/DeleteSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/DeleteSessionCommandOutput/) + +
+
+ +EndSession + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/EndSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/EndSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/EndSessionCommandOutput/) +
@@ -226,6 +258,22 @@ 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/) +
+
+ +GetInvocationStep + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/GetInvocationStepCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetInvocationStepCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetInvocationStepCommandOutput/) + +
+
+ +GetSession + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/GetSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/GetSessionCommandOutput/) +
@@ -250,6 +298,38 @@ InvokeInlineAgent [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/InvokeInlineAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeInlineAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeInlineAgentCommandOutput/) +
+
+ +ListInvocations + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/ListInvocationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListInvocationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListInvocationsCommandOutput/) + +
+
+ +ListInvocationSteps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/ListInvocationStepsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListInvocationStepsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListInvocationStepsCommandOutput/) + +
+
+ +ListSessions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/ListSessionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListSessionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListSessionsCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/ListTagsForResourceCommandOutput/) +
@@ -258,6 +338,14 @@ OptimizePrompt [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/OptimizePromptCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/OptimizePromptCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/OptimizePromptCommandOutput/) +
+
+ +PutInvocationStep + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/PutInvocationStepCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/PutInvocationStepCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/PutInvocationStepCommandOutput/) +
@@ -291,3 +379,27 @@ RetrieveAndGenerateStream [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/RetrieveAndGenerateStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/RetrieveAndGenerateStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/RetrieveAndGenerateStreamCommandOutput/)
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/UntagResourceCommandOutput/) + +
+
+ +UpdateSession + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/UpdateSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/UpdateSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/UpdateSessionCommandOutput/) + +
diff --git a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts index 90b8b58b3549..08acf0d74ea2 100644 --- a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts +++ b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts @@ -3,11 +3,27 @@ import { createAggregatedClient } from "@smithy/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; import { BedrockAgentRuntimeClient, BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient"; +import { + CreateInvocationCommand, + CreateInvocationCommandInput, + CreateInvocationCommandOutput, +} from "./commands/CreateInvocationCommand"; +import { + CreateSessionCommand, + CreateSessionCommandInput, + CreateSessionCommandOutput, +} from "./commands/CreateSessionCommand"; import { DeleteAgentMemoryCommand, DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput, } from "./commands/DeleteAgentMemoryCommand"; +import { + DeleteSessionCommand, + DeleteSessionCommandInput, + DeleteSessionCommandOutput, +} from "./commands/DeleteSessionCommand"; +import { EndSessionCommand, EndSessionCommandInput, EndSessionCommandOutput } from "./commands/EndSessionCommand"; import { GenerateQueryCommand, GenerateQueryCommandInput, @@ -18,6 +34,12 @@ import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput, } from "./commands/GetAgentMemoryCommand"; +import { + GetInvocationStepCommand, + GetInvocationStepCommandInput, + GetInvocationStepCommandOutput, +} from "./commands/GetInvocationStepCommand"; +import { GetSessionCommand, GetSessionCommandInput, GetSessionCommandOutput } from "./commands/GetSessionCommand"; import { InvokeAgentCommand, InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand"; import { InvokeFlowCommand, InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand"; import { @@ -25,11 +47,36 @@ import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput, } from "./commands/InvokeInlineAgentCommand"; +import { + ListInvocationsCommand, + ListInvocationsCommandInput, + ListInvocationsCommandOutput, +} from "./commands/ListInvocationsCommand"; +import { + ListInvocationStepsCommand, + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput, +} from "./commands/ListInvocationStepsCommand"; +import { + ListSessionsCommand, + ListSessionsCommandInput, + ListSessionsCommandOutput, +} from "./commands/ListSessionsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; import { OptimizePromptCommand, OptimizePromptCommandInput, OptimizePromptCommandOutput, } from "./commands/OptimizePromptCommand"; +import { + PutInvocationStepCommand, + PutInvocationStepCommandInput, + PutInvocationStepCommandOutput, +} from "./commands/PutInvocationStepCommand"; import { RerankCommand, RerankCommandInput, RerankCommandOutput } from "./commands/RerankCommand"; import { RetrieveAndGenerateCommand, @@ -42,22 +89,76 @@ import { RetrieveAndGenerateStreamCommandOutput, } from "./commands/RetrieveAndGenerateStreamCommand"; import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateSessionCommand, + UpdateSessionCommandInput, + UpdateSessionCommandOutput, +} from "./commands/UpdateSessionCommand"; const commands = { + CreateInvocationCommand, + CreateSessionCommand, DeleteAgentMemoryCommand, + DeleteSessionCommand, + EndSessionCommand, GenerateQueryCommand, GetAgentMemoryCommand, + GetInvocationStepCommand, + GetSessionCommand, InvokeAgentCommand, InvokeFlowCommand, InvokeInlineAgentCommand, + ListInvocationsCommand, + ListInvocationStepsCommand, + ListSessionsCommand, + ListTagsForResourceCommand, OptimizePromptCommand, + PutInvocationStepCommand, RerankCommand, RetrieveCommand, RetrieveAndGenerateCommand, RetrieveAndGenerateStreamCommand, + TagResourceCommand, + UntagResourceCommand, + UpdateSessionCommand, }; export interface BedrockAgentRuntime { + /** + * @see {@link CreateInvocationCommand} + */ + createInvocation( + args: CreateInvocationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createInvocation( + args: CreateInvocationCommandInput, + cb: (err: any, data?: CreateInvocationCommandOutput) => void + ): void; + createInvocation( + args: CreateInvocationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateInvocationCommandOutput) => void + ): void; + + /** + * @see {@link CreateSessionCommand} + */ + createSession(): Promise; + createSession(args: CreateSessionCommandInput, options?: __HttpHandlerOptions): Promise; + createSession(args: CreateSessionCommandInput, cb: (err: any, data?: CreateSessionCommandOutput) => void): void; + createSession( + args: CreateSessionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateSessionCommandOutput) => void + ): void; + /** * @see {@link DeleteAgentMemoryCommand} */ @@ -75,6 +176,28 @@ export interface BedrockAgentRuntime { cb: (err: any, data?: DeleteAgentMemoryCommandOutput) => void ): void; + /** + * @see {@link DeleteSessionCommand} + */ + deleteSession(args: DeleteSessionCommandInput, options?: __HttpHandlerOptions): Promise; + deleteSession(args: DeleteSessionCommandInput, cb: (err: any, data?: DeleteSessionCommandOutput) => void): void; + deleteSession( + args: DeleteSessionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteSessionCommandOutput) => void + ): void; + + /** + * @see {@link EndSessionCommand} + */ + endSession(args: EndSessionCommandInput, options?: __HttpHandlerOptions): Promise; + endSession(args: EndSessionCommandInput, cb: (err: any, data?: EndSessionCommandOutput) => void): void; + endSession( + args: EndSessionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndSessionCommandOutput) => void + ): void; + /** * @see {@link GenerateQueryCommand} */ @@ -100,6 +223,34 @@ export interface BedrockAgentRuntime { cb: (err: any, data?: GetAgentMemoryCommandOutput) => void ): void; + /** + * @see {@link GetInvocationStepCommand} + */ + getInvocationStep( + args: GetInvocationStepCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getInvocationStep( + args: GetInvocationStepCommandInput, + cb: (err: any, data?: GetInvocationStepCommandOutput) => void + ): void; + getInvocationStep( + args: GetInvocationStepCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetInvocationStepCommandOutput) => void + ): void; + + /** + * @see {@link GetSessionCommand} + */ + getSession(args: GetSessionCommandInput, options?: __HttpHandlerOptions): Promise; + getSession(args: GetSessionCommandInput, cb: (err: any, data?: GetSessionCommandOutput) => void): void; + getSession( + args: GetSessionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetSessionCommandOutput) => void + ): void; + /** * @see {@link InvokeAgentCommand} */ @@ -139,6 +290,66 @@ export interface BedrockAgentRuntime { cb: (err: any, data?: InvokeInlineAgentCommandOutput) => void ): void; + /** + * @see {@link ListInvocationsCommand} + */ + listInvocations( + args: ListInvocationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listInvocations(args: ListInvocationsCommandInput, cb: (err: any, data?: ListInvocationsCommandOutput) => void): void; + listInvocations( + args: ListInvocationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListInvocationsCommandOutput) => void + ): void; + + /** + * @see {@link ListInvocationStepsCommand} + */ + listInvocationSteps( + args: ListInvocationStepsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listInvocationSteps( + args: ListInvocationStepsCommandInput, + cb: (err: any, data?: ListInvocationStepsCommandOutput) => void + ): void; + listInvocationSteps( + args: ListInvocationStepsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListInvocationStepsCommandOutput) => void + ): void; + + /** + * @see {@link ListSessionsCommand} + */ + listSessions(): Promise; + listSessions(args: ListSessionsCommandInput, options?: __HttpHandlerOptions): Promise; + listSessions(args: ListSessionsCommandInput, cb: (err: any, data?: ListSessionsCommandOutput) => void): void; + listSessions( + args: ListSessionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListSessionsCommandOutput) => void + ): void; + + /** + * @see {@link ListTagsForResourceCommand} + */ + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + /** * @see {@link OptimizePromptCommand} */ @@ -153,6 +364,23 @@ export interface BedrockAgentRuntime { cb: (err: any, data?: OptimizePromptCommandOutput) => void ): void; + /** + * @see {@link PutInvocationStepCommand} + */ + putInvocationStep( + args: PutInvocationStepCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putInvocationStep( + args: PutInvocationStepCommandInput, + cb: (err: any, data?: PutInvocationStepCommandOutput) => void + ): void; + putInvocationStep( + args: PutInvocationStepCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutInvocationStepCommandOutput) => void + ): void; + /** * @see {@link RerankCommand} */ @@ -208,6 +436,39 @@ export interface BedrockAgentRuntime { options: __HttpHandlerOptions, cb: (err: any, data?: RetrieveAndGenerateStreamCommandOutput) => void ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateSessionCommand} + */ + updateSession(args: UpdateSessionCommandInput, options?: __HttpHandlerOptions): Promise; + updateSession(args: UpdateSessionCommandInput, cb: (err: any, data?: UpdateSessionCommandOutput) => void): void; + updateSession( + args: UpdateSessionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateSessionCommandOutput) => void + ): void; } /** diff --git a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts index 8110c6b4a1c4..140a21c3209c 100644 --- a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts +++ b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts @@ -59,13 +59,30 @@ import { HttpAuthSchemeResolvedConfig, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider"; +import { CreateInvocationCommandInput, CreateInvocationCommandOutput } from "./commands/CreateInvocationCommand"; +import { CreateSessionCommandInput, CreateSessionCommandOutput } from "./commands/CreateSessionCommand"; import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from "./commands/DeleteAgentMemoryCommand"; +import { DeleteSessionCommandInput, DeleteSessionCommandOutput } from "./commands/DeleteSessionCommand"; +import { EndSessionCommandInput, EndSessionCommandOutput } from "./commands/EndSessionCommand"; import { GenerateQueryCommandInput, GenerateQueryCommandOutput } from "./commands/GenerateQueryCommand"; import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "./commands/GetAgentMemoryCommand"; +import { GetInvocationStepCommandInput, GetInvocationStepCommandOutput } from "./commands/GetInvocationStepCommand"; +import { GetSessionCommandInput, GetSessionCommandOutput } from "./commands/GetSessionCommand"; import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand"; import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand"; import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "./commands/InvokeInlineAgentCommand"; +import { ListInvocationsCommandInput, ListInvocationsCommandOutput } from "./commands/ListInvocationsCommand"; +import { + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput, +} from "./commands/ListInvocationStepsCommand"; +import { ListSessionsCommandInput, ListSessionsCommandOutput } from "./commands/ListSessionsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "./commands/OptimizePromptCommand"; +import { PutInvocationStepCommandInput, PutInvocationStepCommandOutput } from "./commands/PutInvocationStepCommand"; import { RerankCommandInput, RerankCommandOutput } from "./commands/RerankCommand"; import { RetrieveAndGenerateCommandInput, @@ -76,6 +93,9 @@ import { RetrieveAndGenerateStreamCommandOutput, } from "./commands/RetrieveAndGenerateStreamCommand"; import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateSessionCommandInput, UpdateSessionCommandOutput } from "./commands/UpdateSessionCommand"; import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, @@ -91,33 +111,61 @@ export { __Client }; * @public */ export type ServiceInputTypes = + | CreateInvocationCommandInput + | CreateSessionCommandInput | DeleteAgentMemoryCommandInput + | DeleteSessionCommandInput + | EndSessionCommandInput | GenerateQueryCommandInput | GetAgentMemoryCommandInput + | GetInvocationStepCommandInput + | GetSessionCommandInput | InvokeAgentCommandInput | InvokeFlowCommandInput | InvokeInlineAgentCommandInput + | ListInvocationStepsCommandInput + | ListInvocationsCommandInput + | ListSessionsCommandInput + | ListTagsForResourceCommandInput | OptimizePromptCommandInput + | PutInvocationStepCommandInput | RerankCommandInput | RetrieveAndGenerateCommandInput | RetrieveAndGenerateStreamCommandInput - | RetrieveCommandInput; + | RetrieveCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateSessionCommandInput; /** * @public */ export type ServiceOutputTypes = + | CreateInvocationCommandOutput + | CreateSessionCommandOutput | DeleteAgentMemoryCommandOutput + | DeleteSessionCommandOutput + | EndSessionCommandOutput | GenerateQueryCommandOutput | GetAgentMemoryCommandOutput + | GetInvocationStepCommandOutput + | GetSessionCommandOutput | InvokeAgentCommandOutput | InvokeFlowCommandOutput | InvokeInlineAgentCommandOutput + | ListInvocationStepsCommandOutput + | ListInvocationsCommandOutput + | ListSessionsCommandOutput + | ListTagsForResourceCommandOutput | OptimizePromptCommandOutput + | PutInvocationStepCommandOutput | RerankCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveAndGenerateStreamCommandOutput - | RetrieveCommandOutput; + | RetrieveCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateSessionCommandOutput; /** * @public diff --git a/clients/client-bedrock-agent-runtime/src/commands/CreateInvocationCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/CreateInvocationCommand.ts new file mode 100644 index 000000000000..eea6367425f8 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/CreateInvocationCommand.ts @@ -0,0 +1,140 @@ +// 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 { CreateInvocationRequest, CreateInvocationResponse } from "../models/models_0"; +import { de_CreateInvocationCommand, se_CreateInvocationCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateInvocationCommand}. + */ +export interface CreateInvocationCommandInput extends CreateInvocationRequest {} +/** + * @public + * + * The output of {@link CreateInvocationCommand}. + */ +export interface CreateInvocationCommandOutput extends CreateInvocationResponse, __MetadataBearer {} + +/** + *

Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from + * a conversation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ *

Related APIs

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, CreateInvocationCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, CreateInvocationCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // CreateInvocationRequest + * invocationId: "STRING_VALUE", + * description: "STRING_VALUE", + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new CreateInvocationCommand(input); + * const response = await client.send(command); + * // { // CreateInvocationResponse + * // sessionId: "STRING_VALUE", // required + * // invocationId: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param CreateInvocationCommandInput - {@link CreateInvocationCommandInput} + * @returns {@link CreateInvocationCommandOutput} + * @see {@link CreateInvocationCommandInput} for command's `input` shape. + * @see {@link CreateInvocationCommandOutput} 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 ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your 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 CreateInvocationCommand extends $Command + .classBuilder< + CreateInvocationCommandInput, + CreateInvocationCommandOutput, + 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", "CreateInvocation", {}) + .n("BedrockAgentRuntimeClient", "CreateInvocationCommand") + .f(void 0, void 0) + .ser(se_CreateInvocationCommand) + .de(de_CreateInvocationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: CreateInvocationRequest; + output: CreateInvocationResponse; + }; + sdk: { + input: CreateInvocationCommandInput; + output: CreateInvocationCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/CreateSessionCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/CreateSessionCommand.ts new file mode 100644 index 000000000000..267fd910bf86 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/CreateSessionCommand.ts @@ -0,0 +1,158 @@ +// 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 { CreateSessionRequest, CreateSessionResponse } from "../models/models_0"; +import { de_CreateSessionCommand, se_CreateSessionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateSessionCommand}. + */ +export interface CreateSessionCommandInput extends CreateSessionRequest {} +/** + * @public + * + * The output of {@link CreateSessionCommand}. + */ +export interface CreateSessionCommandOutput extends CreateSessionResponse, __MetadataBearer {} + +/** + *

Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source + * frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of + * conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see + * Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ *

By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata, + * or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.

+ * + *

+ * You use a session to store state and conversation history for generative AI applications built with open-source frameworks. + * For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the + * InvokeAgent API operation. + *

+ *
+ *

Related APIs:

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, CreateSessionCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, CreateSessionCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // CreateSessionRequest + * sessionMetadata: { // SessionMetadataMap + * "": "STRING_VALUE", + * }, + * encryptionKeyArn: "STRING_VALUE", + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateSessionCommand(input); + * const response = await client.send(command); + * // { // CreateSessionResponse + * // sessionId: "STRING_VALUE", // required + * // sessionArn: "STRING_VALUE", // required + * // sessionStatus: "ACTIVE" || "EXPIRED" || "ENDED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param CreateSessionCommandInput - {@link CreateSessionCommandInput} + * @returns {@link CreateSessionCommandOutput} + * @see {@link CreateSessionCommandInput} for command's `input` shape. + * @see {@link CreateSessionCommandOutput} 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 ConflictException} (client fault) + *

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

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

An internal server error occurred. Retry your request.

+ * + * @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 CreateSessionCommand extends $Command + .classBuilder< + CreateSessionCommandInput, + CreateSessionCommandOutput, + 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", "CreateSession", {}) + .n("BedrockAgentRuntimeClient", "CreateSessionCommand") + .f(void 0, void 0) + .ser(se_CreateSessionCommand) + .de(de_CreateSessionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: CreateSessionRequest; + output: CreateSessionResponse; + }; + sdk: { + input: CreateSessionCommandInput; + output: CreateSessionCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/DeleteSessionCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/DeleteSessionCommand.ts new file mode 100644 index 000000000000..d72bd2c7d75a --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/DeleteSessionCommand.ts @@ -0,0 +1,114 @@ +// 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 { DeleteSessionRequest, DeleteSessionResponse } from "../models/models_0"; +import { de_DeleteSessionCommand, se_DeleteSessionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteSessionCommand}. + */ +export interface DeleteSessionCommandInput extends DeleteSessionRequest {} +/** + * @public + * + * The output of {@link DeleteSessionCommand}. + */ +export interface DeleteSessionCommandOutput extends DeleteSessionResponse, __MetadataBearer {} + +/** + *

Deletes a session that you ended. You can't delete a session with an ACTIVE status. To delete an active session, you must first end it with the + * EndSession API operation. + * For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, DeleteSessionCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, DeleteSessionCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // DeleteSessionRequest + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new DeleteSessionCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteSessionCommandInput - {@link DeleteSessionCommandInput} + * @returns {@link DeleteSessionCommandOutput} + * @see {@link DeleteSessionCommandInput} for command's `input` shape. + * @see {@link DeleteSessionCommandOutput} 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 ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your 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 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 DeleteSessionCommand extends $Command + .classBuilder< + DeleteSessionCommandInput, + DeleteSessionCommandOutput, + 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", "DeleteSession", {}) + .n("BedrockAgentRuntimeClient", "DeleteSessionCommand") + .f(void 0, void 0) + .ser(se_DeleteSessionCommand) + .de(de_DeleteSessionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteSessionRequest; + output: {}; + }; + sdk: { + input: DeleteSessionCommandInput; + output: DeleteSessionCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/EndSessionCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/EndSessionCommand.ts new file mode 100644 index 000000000000..28f267c7bb6b --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/EndSessionCommand.ts @@ -0,0 +1,118 @@ +// 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 { EndSessionRequest, EndSessionResponse } from "../models/models_0"; +import { de_EndSessionCommand, se_EndSessionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndSessionCommand}. + */ +export interface EndSessionCommandInput extends EndSessionRequest {} +/** + * @public + * + * The output of {@link EndSessionCommand}. + */ +export interface EndSessionCommandOutput extends EndSessionResponse, __MetadataBearer {} + +/** + *

Ends the session. + * After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation. + * For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, EndSessionCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, EndSessionCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // EndSessionRequest + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new EndSessionCommand(input); + * const response = await client.send(command); + * // { // EndSessionResponse + * // sessionId: "STRING_VALUE", // required + * // sessionArn: "STRING_VALUE", // required + * // sessionStatus: "ACTIVE" || "EXPIRED" || "ENDED", // required + * // }; + * + * ``` + * + * @param EndSessionCommandInput - {@link EndSessionCommandInput} + * @returns {@link EndSessionCommandOutput} + * @see {@link EndSessionCommandInput} for command's `input` shape. + * @see {@link EndSessionCommandOutput} 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 ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your 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 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 EndSessionCommand extends $Command + .classBuilder< + EndSessionCommandInput, + EndSessionCommandOutput, + 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", "EndSession", {}) + .n("BedrockAgentRuntimeClient", "EndSessionCommand") + .f(void 0, void 0) + .ser(se_EndSessionCommand) + .de(de_EndSessionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: EndSessionRequest; + output: EndSessionResponse; + }; + sdk: { + input: EndSessionCommandInput; + output: EndSessionCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/GetInvocationStepCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/GetInvocationStepCommand.ts new file mode 100644 index 000000000000..3396e24e1030 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/GetInvocationStepCommand.ts @@ -0,0 +1,138 @@ +// 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 { + GetInvocationStepRequest, + GetInvocationStepResponse, + GetInvocationStepResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_GetInvocationStepCommand, se_GetInvocationStepCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetInvocationStepCommand}. + */ +export interface GetInvocationStepCommandInput extends GetInvocationStepRequest {} +/** + * @public + * + * The output of {@link GetInvocationStepCommand}. + */ +export interface GetInvocationStepCommandOutput extends GetInvocationStepResponse, __MetadataBearer {} + +/** + *

Retrieves the details of a specific invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, GetInvocationStepCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, GetInvocationStepCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // GetInvocationStepRequest + * invocationIdentifier: "STRING_VALUE", // required + * invocationStepId: "STRING_VALUE", // required + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetInvocationStepCommand(input); + * const response = await client.send(command); + * // { // GetInvocationStepResponse + * // invocationStep: { // InvocationStep + * // sessionId: "STRING_VALUE", // required + * // invocationId: "STRING_VALUE", // required + * // invocationStepId: "STRING_VALUE", // required + * // invocationStepTime: new Date("TIMESTAMP"), // required + * // payload: { // InvocationStepPayload Union: only one key present + * // contentBlocks: [ // BedrockSessionContentBlocks + * // { // BedrockSessionContentBlock Union: only one key present + * // text: "STRING_VALUE", + * // image: { // ImageBlock + * // format: "png" || "jpeg" || "gif" || "webp", // required + * // source: { // ImageSource Union: only one key present + * // bytes: new Uint8Array(), + * // s3Location: { // S3Location + * // uri: "STRING_VALUE", // required + * // }, + * // }, + * // }, + * // }, + * // ], + * // }, + * // }, + * // }; + * + * ``` + * + * @param GetInvocationStepCommandInput - {@link GetInvocationStepCommandInput} + * @returns {@link GetInvocationStepCommandOutput} + * @see {@link GetInvocationStepCommandInput} for command's `input` shape. + * @see {@link GetInvocationStepCommandOutput} 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 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 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 GetInvocationStepCommand extends $Command + .classBuilder< + GetInvocationStepCommandInput, + GetInvocationStepCommandOutput, + 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", "GetInvocationStep", {}) + .n("BedrockAgentRuntimeClient", "GetInvocationStepCommand") + .f(void 0, GetInvocationStepResponseFilterSensitiveLog) + .ser(se_GetInvocationStepCommand) + .de(de_GetInvocationStepCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetInvocationStepRequest; + output: GetInvocationStepResponse; + }; + sdk: { + input: GetInvocationStepCommandInput; + output: GetInvocationStepCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/GetSessionCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/GetSessionCommand.ts new file mode 100644 index 000000000000..3646b49f9912 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/GetSessionCommand.ts @@ -0,0 +1,119 @@ +// 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 { GetSessionRequest, GetSessionResponse } from "../models/models_0"; +import { de_GetSessionCommand, se_GetSessionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetSessionCommand}. + */ +export interface GetSessionCommandInput extends GetSessionRequest {} +/** + * @public + * + * The output of {@link GetSessionCommand}. + */ +export interface GetSessionCommandOutput extends GetSessionResponse, __MetadataBearer {} + +/** + *

Retrieves details about a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, GetSessionCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, GetSessionCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // GetSessionRequest + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetSessionCommand(input); + * const response = await client.send(command); + * // { // GetSessionResponse + * // sessionId: "STRING_VALUE", // required + * // sessionArn: "STRING_VALUE", // required + * // sessionStatus: "ACTIVE" || "EXPIRED" || "ENDED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // lastUpdatedAt: new Date("TIMESTAMP"), // required + * // sessionMetadata: { // SessionMetadataMap + * // "": "STRING_VALUE", + * // }, + * // encryptionKeyArn: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GetSessionCommandInput - {@link GetSessionCommandInput} + * @returns {@link GetSessionCommandOutput} + * @see {@link GetSessionCommandInput} for command's `input` shape. + * @see {@link GetSessionCommandOutput} 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 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 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 GetSessionCommand extends $Command + .classBuilder< + GetSessionCommandInput, + GetSessionCommandOutput, + 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", "GetSession", {}) + .n("BedrockAgentRuntimeClient", "GetSessionCommand") + .f(void 0, void 0) + .ser(se_GetSessionCommand) + .de(de_GetSessionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetSessionRequest; + output: GetSessionResponse; + }; + sdk: { + input: GetSessionCommandInput; + output: GetSessionCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts index fe9ba1b173a4..cb8b9cf58fa3 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts @@ -10,12 +10,8 @@ import { ServiceOutputTypes, } from "../BedrockAgentRuntimeClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { - InvokeAgentRequest, - InvokeAgentRequestFilterSensitiveLog, - InvokeAgentResponse, - InvokeAgentResponseFilterSensitiveLog, -} from "../models/models_0"; +import { InvokeAgentResponse, InvokeAgentResponseFilterSensitiveLog } from "../models/models_0"; +import { InvokeAgentRequest, InvokeAgentRequestFilterSensitiveLog } from "../models/models_1"; import { de_InvokeAgentCommand, se_InvokeAgentCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts index aebe68fe6164..eaa3936063aa 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts @@ -10,12 +10,8 @@ import { ServiceOutputTypes, } from "../BedrockAgentRuntimeClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { - InvokeInlineAgentRequest, - InvokeInlineAgentRequestFilterSensitiveLog, - InvokeInlineAgentResponse, - InvokeInlineAgentResponseFilterSensitiveLog, -} from "../models/models_0"; +import { InvokeInlineAgentResponse, InvokeInlineAgentResponseFilterSensitiveLog } from "../models/models_0"; +import { InvokeInlineAgentRequest, InvokeInlineAgentRequestFilterSensitiveLog } from "../models/models_1"; import { de_InvokeInlineAgentCommand, se_InvokeInlineAgentCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent-runtime/src/commands/ListInvocationStepsCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/ListInvocationStepsCommand.ts new file mode 100644 index 000000000000..59ee68799620 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/ListInvocationStepsCommand.ts @@ -0,0 +1,122 @@ +// 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 { ListInvocationStepsRequest, ListInvocationStepsResponse } from "../models/models_0"; +import { de_ListInvocationStepsCommand, se_ListInvocationStepsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListInvocationStepsCommand}. + */ +export interface ListInvocationStepsCommandInput extends ListInvocationStepsRequest {} +/** + * @public + * + * The output of {@link ListInvocationStepsCommand}. + */ +export interface ListInvocationStepsCommandOutput extends ListInvocationStepsResponse, __MetadataBearer {} + +/** + *

Lists all invocation steps associated with a session and optionally, an invocation within the session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, ListInvocationStepsCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, ListInvocationStepsCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // ListInvocationStepsRequest + * invocationIdentifier: "STRING_VALUE", + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new ListInvocationStepsCommand(input); + * const response = await client.send(command); + * // { // ListInvocationStepsResponse + * // invocationStepSummaries: [ // InvocationStepSummaries // required + * // { // InvocationStepSummary + * // sessionId: "STRING_VALUE", // required + * // invocationId: "STRING_VALUE", // required + * // invocationStepId: "STRING_VALUE", // required + * // invocationStepTime: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListInvocationStepsCommandInput - {@link ListInvocationStepsCommandInput} + * @returns {@link ListInvocationStepsCommandOutput} + * @see {@link ListInvocationStepsCommandInput} for command's `input` shape. + * @see {@link ListInvocationStepsCommandOutput} 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 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 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 ListInvocationStepsCommand extends $Command + .classBuilder< + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput, + 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", "ListInvocationSteps", {}) + .n("BedrockAgentRuntimeClient", "ListInvocationStepsCommand") + .f(void 0, void 0) + .ser(se_ListInvocationStepsCommand) + .de(de_ListInvocationStepsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListInvocationStepsRequest; + output: ListInvocationStepsResponse; + }; + sdk: { + input: ListInvocationStepsCommandInput; + output: ListInvocationStepsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/ListInvocationsCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/ListInvocationsCommand.ts new file mode 100644 index 000000000000..f1d4c11d8d4d --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/ListInvocationsCommand.ts @@ -0,0 +1,120 @@ +// 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 { ListInvocationsRequest, ListInvocationsResponse } from "../models/models_0"; +import { de_ListInvocationsCommand, se_ListInvocationsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListInvocationsCommand}. + */ +export interface ListInvocationsCommandInput extends ListInvocationsRequest {} +/** + * @public + * + * The output of {@link ListInvocationsCommand}. + */ +export interface ListInvocationsCommandOutput extends ListInvocationsResponse, __MetadataBearer {} + +/** + *

Lists all invocations associated with a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, ListInvocationsCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, ListInvocationsCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // ListInvocationsRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new ListInvocationsCommand(input); + * const response = await client.send(command); + * // { // ListInvocationsResponse + * // invocationSummaries: [ // InvocationSummaries // required + * // { // InvocationSummary + * // sessionId: "STRING_VALUE", // required + * // invocationId: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListInvocationsCommandInput - {@link ListInvocationsCommandInput} + * @returns {@link ListInvocationsCommandOutput} + * @see {@link ListInvocationsCommandInput} for command's `input` shape. + * @see {@link ListInvocationsCommandOutput} 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 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 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 ListInvocationsCommand extends $Command + .classBuilder< + ListInvocationsCommandInput, + ListInvocationsCommandOutput, + 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", "ListInvocations", {}) + .n("BedrockAgentRuntimeClient", "ListInvocationsCommand") + .f(void 0, void 0) + .ser(se_ListInvocationsCommand) + .de(de_ListInvocationsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListInvocationsRequest; + output: ListInvocationsResponse; + }; + sdk: { + input: ListInvocationsCommandInput; + output: ListInvocationsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/ListSessionsCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/ListSessionsCommand.ts new file mode 100644 index 000000000000..4e0142762eca --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/ListSessionsCommand.ts @@ -0,0 +1,118 @@ +// 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 { ListSessionsRequest, ListSessionsResponse } from "../models/models_0"; +import { de_ListSessionsCommand, se_ListSessionsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListSessionsCommand}. + */ +export interface ListSessionsCommandInput extends ListSessionsRequest {} +/** + * @public + * + * The output of {@link ListSessionsCommand}. + */ +export interface ListSessionsCommandOutput extends ListSessionsResponse, __MetadataBearer {} + +/** + *

Lists all sessions in your Amazon Web Services account. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, ListSessionsCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, ListSessionsCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // ListSessionsRequest + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListSessionsCommand(input); + * const response = await client.send(command); + * // { // ListSessionsResponse + * // sessionSummaries: [ // SessionSummaries // required + * // { // SessionSummary + * // sessionId: "STRING_VALUE", // required + * // sessionArn: "STRING_VALUE", // required + * // sessionStatus: "ACTIVE" || "EXPIRED" || "ENDED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // lastUpdatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListSessionsCommandInput - {@link ListSessionsCommandInput} + * @returns {@link ListSessionsCommandOutput} + * @see {@link ListSessionsCommandInput} for command's `input` shape. + * @see {@link ListSessionsCommandOutput} 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 InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @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 ListSessionsCommand extends $Command + .classBuilder< + ListSessionsCommandInput, + ListSessionsCommandOutput, + 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", "ListSessions", {}) + .n("BedrockAgentRuntimeClient", "ListSessionsCommand") + .f(void 0, void 0) + .ser(se_ListSessionsCommand) + .de(de_ListSessionsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListSessionsRequest; + output: ListSessionsResponse; + }; + sdk: { + input: ListSessionsCommandInput; + output: ListSessionsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/ListTagsForResourceCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..7b4c82e7fbc5 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/ListTagsForResourceCommand.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 { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {} + +/** + *

List all the tags for the resource you specify.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, ListTagsForResourceCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, ListTagsForResourceCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // ListTagsForResourceRequest + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceResponse + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput} + * @returns {@link ListTagsForResourceCommandOutput} + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} 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 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 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 ListTagsForResourceCommand extends $Command + .classBuilder< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + 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", "ListTagsForResource", {}) + .n("BedrockAgentRuntimeClient", "ListTagsForResourceCommand") + .f(void 0, void 0) + .ser(se_ListTagsForResourceCommand) + .de(de_ListTagsForResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListTagsForResourceRequest; + output: ListTagsForResourceResponse; + }; + sdk: { + input: ListTagsForResourceCommandInput; + output: ListTagsForResourceCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/PutInvocationStepCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/PutInvocationStepCommand.ts new file mode 100644 index 000000000000..601bbf01cda3 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/PutInvocationStepCommand.ts @@ -0,0 +1,163 @@ +// 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 { + PutInvocationStepRequest, + PutInvocationStepRequestFilterSensitiveLog, + PutInvocationStepResponse, +} from "../models/models_0"; +import { de_PutInvocationStepCommand, se_PutInvocationStepCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutInvocationStepCommand}. + */ +export interface PutInvocationStepCommandInput extends PutInvocationStepRequest {} +/** + * @public + * + * The output of {@link PutInvocationStepCommand}. + */ +export interface PutInvocationStepCommandOutput extends PutInvocationStepResponse, __MetadataBearer {} + +/** + *

Add an invocation step to an invocation in a session. An invocation step stores fine-grained state checkpoints, including text and images, for each interaction. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ *

Related APIs:

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, PutInvocationStepCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, PutInvocationStepCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // PutInvocationStepRequest + * sessionIdentifier: "STRING_VALUE", // required + * invocationIdentifier: "STRING_VALUE", // required + * invocationStepTime: new Date("TIMESTAMP"), // required + * payload: { // InvocationStepPayload Union: only one key present + * contentBlocks: [ // BedrockSessionContentBlocks + * { // BedrockSessionContentBlock Union: only one key present + * text: "STRING_VALUE", + * image: { // ImageBlock + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: { // ImageSource Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * s3Location: { // S3Location + * uri: "STRING_VALUE", // required + * }, + * }, + * }, + * }, + * ], + * }, + * invocationStepId: "STRING_VALUE", + * }; + * const command = new PutInvocationStepCommand(input); + * const response = await client.send(command); + * // { // PutInvocationStepResponse + * // invocationStepId: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param PutInvocationStepCommandInput - {@link PutInvocationStepCommandInput} + * @returns {@link PutInvocationStepCommandOutput} + * @see {@link PutInvocationStepCommandInput} for command's `input` shape. + * @see {@link PutInvocationStepCommandOutput} 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 ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your 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 PutInvocationStepCommand extends $Command + .classBuilder< + PutInvocationStepCommandInput, + PutInvocationStepCommandOutput, + 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", "PutInvocationStep", {}) + .n("BedrockAgentRuntimeClient", "PutInvocationStepCommand") + .f(PutInvocationStepRequestFilterSensitiveLog, void 0) + .ser(se_PutInvocationStepCommand) + .de(de_PutInvocationStepCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutInvocationStepRequest; + output: PutInvocationStepResponse; + }; + sdk: { + input: PutInvocationStepCommandInput; + output: PutInvocationStepCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts index 1a083f1dda7d..833734bff5b3 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts @@ -10,12 +10,8 @@ import { ServiceOutputTypes, } from "../BedrockAgentRuntimeClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { - RetrieveAndGenerateRequest, - RetrieveAndGenerateRequestFilterSensitiveLog, - RetrieveAndGenerateResponse, - RetrieveAndGenerateResponseFilterSensitiveLog, -} from "../models/models_0"; +import { RetrieveAndGenerateResponse, RetrieveAndGenerateResponseFilterSensitiveLog } from "../models/models_0"; +import { RetrieveAndGenerateRequest, RetrieveAndGenerateRequestFilterSensitiveLog } from "../models/models_1"; import { de_RetrieveAndGenerateCommand, se_RetrieveAndGenerateCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts index 59e47860afb8..2cec6a6da4cf 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts @@ -11,11 +11,13 @@ import { } from "../BedrockAgentRuntimeClient"; import { commonParams } from "../endpoint/EndpointParameters"; import { - RetrieveAndGenerateStreamRequest, - RetrieveAndGenerateStreamRequestFilterSensitiveLog, RetrieveAndGenerateStreamResponse, RetrieveAndGenerateStreamResponseFilterSensitiveLog, } from "../models/models_0"; +import { + RetrieveAndGenerateStreamRequest, + RetrieveAndGenerateStreamRequestFilterSensitiveLog, +} from "../models/models_1"; import { de_RetrieveAndGenerateStreamCommand, se_RetrieveAndGenerateStreamCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts index e5e3f63e6d8d..e3754bdfd8df 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts @@ -10,12 +10,8 @@ import { ServiceOutputTypes, } from "../BedrockAgentRuntimeClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { - RetrieveRequest, - RetrieveRequestFilterSensitiveLog, - RetrieveResponse, - RetrieveResponseFilterSensitiveLog, -} from "../models/models_0"; +import { RetrieveResponse, RetrieveResponseFilterSensitiveLog } from "../models/models_0"; +import { RetrieveRequest, RetrieveRequestFilterSensitiveLog } from "../models/models_1"; import { de_RetrieveCommand, se_RetrieveCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent-runtime/src/commands/TagResourceCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..90e305d992a0 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/TagResourceCommand.ts @@ -0,0 +1,115 @@ +// 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 { TagResourceRequest, TagResourceResponse } from "../models/models_0"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceRequest {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer {} + +/** + *

Associate tags with a resource. For more information, see Tagging resources 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, TagResourceCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, TagResourceCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // TagResourceRequest + * resourceArn: "STRING_VALUE", // required + * tags: { // TagsMap // required + * "": "STRING_VALUE", + * }, + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param TagResourceCommandInput - {@link TagResourceCommandInput} + * @returns {@link TagResourceCommandOutput} + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} 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 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 TagResourceCommand extends $Command + .classBuilder< + TagResourceCommandInput, + TagResourceCommandOutput, + 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", "TagResource", {}) + .n("BedrockAgentRuntimeClient", "TagResourceCommand") + .f(void 0, void 0) + .ser(se_TagResourceCommand) + .de(de_TagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TagResourceRequest; + output: {}; + }; + sdk: { + input: TagResourceCommandInput; + output: TagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/UntagResourceCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..fa91d708f90a --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/UntagResourceCommand.ts @@ -0,0 +1,112 @@ +// 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 { UntagResourceRequest, UntagResourceResponse } from "../models/models_0"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceRequest {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {} + +/** + *

Remove tags from a resource.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, UntagResourceCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, UntagResourceCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // UntagResourceRequest + * resourceArn: "STRING_VALUE", // required + * tagKeys: [ // TagKeyList // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UntagResourceCommandInput - {@link UntagResourceCommandInput} + * @returns {@link UntagResourceCommandOutput} + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} 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 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 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 UntagResourceCommand extends $Command + .classBuilder< + UntagResourceCommandInput, + UntagResourceCommandOutput, + 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", "UntagResource", {}) + .n("BedrockAgentRuntimeClient", "UntagResourceCommand") + .f(void 0, void 0) + .ser(se_UntagResourceCommand) + .de(de_UntagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UntagResourceRequest; + output: {}; + }; + sdk: { + input: UntagResourceCommandInput; + output: UntagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/UpdateSessionCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/UpdateSessionCommand.ts new file mode 100644 index 000000000000..8ba141c8b62f --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/commands/UpdateSessionCommand.ts @@ -0,0 +1,121 @@ +// 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 { UpdateSessionRequest, UpdateSessionResponse } from "../models/models_0"; +import { de_UpdateSessionCommand, se_UpdateSessionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UpdateSessionCommand}. + */ +export interface UpdateSessionCommandInput extends UpdateSessionRequest {} +/** + * @public + * + * The output of {@link UpdateSessionCommand}. + */ +export interface UpdateSessionCommandOutput extends UpdateSessionResponse, __MetadataBearer {} + +/** + *

Updates the metadata or encryption settings of a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, UpdateSessionCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, UpdateSessionCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // UpdateSessionRequest + * sessionMetadata: { // SessionMetadataMap + * "": "STRING_VALUE", + * }, + * sessionIdentifier: "STRING_VALUE", // required + * }; + * const command = new UpdateSessionCommand(input); + * const response = await client.send(command); + * // { // UpdateSessionResponse + * // sessionId: "STRING_VALUE", // required + * // sessionArn: "STRING_VALUE", // required + * // sessionStatus: "ACTIVE" || "EXPIRED" || "ENDED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // lastUpdatedAt: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param UpdateSessionCommandInput - {@link UpdateSessionCommandInput} + * @returns {@link UpdateSessionCommandOutput} + * @see {@link UpdateSessionCommandInput} for command's `input` shape. + * @see {@link UpdateSessionCommandOutput} 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 ConflictException} (client fault) + *

There was a conflict performing an operation. Resolve the conflict and retry your 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 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 UpdateSessionCommand extends $Command + .classBuilder< + UpdateSessionCommandInput, + UpdateSessionCommandOutput, + 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", "UpdateSession", {}) + .n("BedrockAgentRuntimeClient", "UpdateSessionCommand") + .f(void 0, void 0) + .ser(se_UpdateSessionCommand) + .de(de_UpdateSessionCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UpdateSessionRequest; + output: UpdateSessionResponse; + }; + sdk: { + input: UpdateSessionCommandInput; + output: UpdateSessionCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/index.ts b/clients/client-bedrock-agent-runtime/src/commands/index.ts index b35d1fcb2343..16b1a3689766 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/index.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/index.ts @@ -1,12 +1,26 @@ // smithy-typescript generated code +export * from "./CreateInvocationCommand"; +export * from "./CreateSessionCommand"; export * from "./DeleteAgentMemoryCommand"; +export * from "./DeleteSessionCommand"; +export * from "./EndSessionCommand"; export * from "./GenerateQueryCommand"; export * from "./GetAgentMemoryCommand"; +export * from "./GetInvocationStepCommand"; +export * from "./GetSessionCommand"; export * from "./InvokeAgentCommand"; export * from "./InvokeFlowCommand"; export * from "./InvokeInlineAgentCommand"; +export * from "./ListInvocationStepsCommand"; +export * from "./ListInvocationsCommand"; +export * from "./ListSessionsCommand"; +export * from "./ListTagsForResourceCommand"; export * from "./OptimizePromptCommand"; +export * from "./PutInvocationStepCommand"; export * from "./RerankCommand"; export * from "./RetrieveAndGenerateCommand"; export * from "./RetrieveAndGenerateStreamCommand"; export * from "./RetrieveCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateSessionCommand"; diff --git a/clients/client-bedrock-agent-runtime/src/models/index.ts b/clients/client-bedrock-agent-runtime/src/models/index.ts index 9eaceb12865f..1657800f73ce 100644 --- a/clients/client-bedrock-agent-runtime/src/models/index.ts +++ b/clients/client-bedrock-agent-runtime/src/models/index.ts @@ -1,2 +1,3 @@ // smithy-typescript generated code export * from "./models_0"; +export * from "./models_1"; 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 db338d9c0202..02938806ead0 100644 --- a/clients/client-bedrock-agent-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts @@ -8129,982 +8129,882 @@ export interface RetrieveResponse { } /** - *

Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations. See the examples below to see how to use these filters.

- *

This data type is used in the following API operations:

- * * @public */ -export type RetrievalFilter = - | RetrievalFilter.AndAllMember - | RetrievalFilter.EqualsMember - | RetrievalFilter.GreaterThanMember - | RetrievalFilter.GreaterThanOrEqualsMember - | RetrievalFilter.InMember - | RetrievalFilter.LessThanMember - | RetrievalFilter.LessThanOrEqualsMember - | RetrievalFilter.ListContainsMember - | RetrievalFilter.NotEqualsMember - | RetrievalFilter.NotInMember - | RetrievalFilter.OrAllMember - | RetrievalFilter.StartsWithMember - | RetrievalFilter.StringContainsMember - | RetrievalFilter.$UnknownMember; - -/** - * @public - */ -export namespace RetrievalFilter { - /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

- *

The following example would return data sources with an animal attribute whose value is cat:

- *

- * "equals": \{ "key": "animal", "value": "cat" \} - *

- * @public - */ - export interface EqualsMember { - equals: FilterAttribute; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } +export interface CreateSessionRequest { + /** + *

A map of key-value pairs containing attributes to be persisted across the session. For example, the user's ID, their language preference, + * and the type of device they are using.

+ * @public + */ + sessionMetadata?: Record | undefined; /** - *

Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

- *

The following example would return data sources that don't contain an animal attribute whose value is cat.

- *

- * "notEquals": \{ "key": "animal", "value": "cat" \} - *

- * @public - */ - export interface NotEqualsMember { - equals?: never; - notEquals: FilterAttribute; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The Amazon Resource Name (ARN) of the KMS key to use to encrypt the session data. The user or role creating the session must have permission to use the key. + * For more information, see Amazon Bedrock session encryption. + *

+ * @public + */ + encryptionKeyArn?: string | undefined; /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

- *

The following example would return data sources with an year attribute whose value is greater than 1989:

- *

- * "greaterThan": \{ "key": "year", "value": 1989 \} - *

- * @public - */ - export interface GreaterThanMember { - equals?: never; - notEquals?: never; - greaterThan: FilterAttribute; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

Specify the key-value pairs for the tags that you want to attach to the session.

+ * @public + */ + tags?: Record | undefined; +} + +/** + * @public + * @enum + */ +export const SessionStatus = { + ACTIVE: "ACTIVE", + ENDED: "ENDED", + EXPIRED: "EXPIRED", +} as const; +/** + * @public + */ +export type SessionStatus = (typeof SessionStatus)[keyof typeof SessionStatus]; + +/** + * @public + */ +export interface CreateSessionResponse { /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

- *

The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

- *

- * "greaterThanOrEquals": \{ "key": "year", "value": 1989 \} - *

- * @public - */ - export interface GreaterThanOrEqualsMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals: FilterAttribute; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The unique identifier for the session.

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

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

- *

The following example would return data sources with an year attribute whose value is less than to 1989.

- *

- * "lessThan": \{ "key": "year", "value": 1989 \} - *

- * @public - */ - export interface LessThanMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan: FilterAttribute; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The Amazon Resource Name (ARN) of the created session.

+ * @public + */ + sessionArn: string | undefined; /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

- *

The following example would return data sources with an year attribute whose value is less than or equal to 1989.

- *

- * "lessThanOrEquals": \{ "key": "year", "value": 1989 \} - *

- * @public - */ - export interface LessThanOrEqualsMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals: FilterAttribute; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The current status of the session.

+ * @public + */ + sessionStatus: SessionStatus | undefined; /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

- *

The following example would return data sources with an animal attribute that is either cat or dog:

- *

- * "in": \{ "key": "animal", "value": ["cat", "dog"] \} - *

- * @public - */ - export interface InMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in: FilterAttribute; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The timestamp for when the session was created.

+ * @public + */ + createdAt: Date | undefined; +} +/** + * @public + */ +export interface DeleteSessionRequest { /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

- *

The following example would return data sources whose animal attribute is neither cat nor dog.

- *

- * "notIn": \{ "key": "animal", "value": ["cat", "dog"] \} - *

- * @public - */ - export interface NotInMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn: FilterAttribute; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The unique identifier for the session to be deleted. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

+ * @public + */ + sessionIdentifier: string | undefined; +} + +/** + * @public + */ +export interface DeleteSessionResponse {} +/** + * @public + */ +export interface EndSessionRequest { /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

- *

The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

- *

- * "startsWith": \{ "key": "animal", "value": "ca" \} - *

- * @public - */ - export interface StartsWithMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith: FilterAttribute; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The unique identifier for the session to end. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

+ * @public + */ + sessionIdentifier: string | undefined; +} +/** + * @public + */ +export interface EndSessionResponse { /** - *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

- *

The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

- *

- * "listContains": \{ "key": "animals", "value": "cat" \} - *

- * @public - */ - export interface ListContainsMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains: FilterAttribute; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown?: never; - } + *

The unique identifier of the session you ended.

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

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

- *
    - *
  • - *

    A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

    - *

    - * "stringContains": \{ "key": "animal", "value": "at" \} - *

    - *
  • - *
  • - *

    A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

    - *

    - * "stringContains": \{ "key": "animals", "value": "at" \} - *

    - *
  • - *
+ *

The Amazon Resource Name (ARN) of the session you ended.

* @public */ - export interface StringContainsMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains: FilterAttribute; - andAll?: never; - orAll?: never; - $unknown?: never; - } + sessionArn: string | undefined; /** - *

Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

+ *

The current status of the session you ended.

* @public */ - export interface AndAllMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll: RetrievalFilter[]; - orAll?: never; - $unknown?: never; - } + sessionStatus: SessionStatus | undefined; +} +/** + * @public + */ +export interface GetSessionRequest { /** - *

Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

+ *

A unique identifier for the session to retrieve. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

* @public */ - export interface OrAllMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll: RetrievalFilter[]; - $unknown?: never; - } + sessionIdentifier: string | undefined; +} +/** + * @public + */ +export interface GetSessionResponse { /** + *

The unique identifier for the session in UUID format.

* @public */ - export interface $UnknownMember { - equals?: never; - notEquals?: never; - greaterThan?: never; - greaterThanOrEquals?: never; - lessThan?: never; - lessThanOrEquals?: never; - in?: never; - notIn?: never; - startsWith?: never; - listContains?: never; - stringContains?: never; - andAll?: never; - orAll?: never; - $unknown: [string, any]; - } + sessionId: string | undefined; - export interface Visitor { - equals: (value: FilterAttribute) => T; - notEquals: (value: FilterAttribute) => T; - greaterThan: (value: FilterAttribute) => T; - greaterThanOrEquals: (value: FilterAttribute) => T; - lessThan: (value: FilterAttribute) => T; - lessThanOrEquals: (value: FilterAttribute) => T; - in: (value: FilterAttribute) => T; - notIn: (value: FilterAttribute) => T; - startsWith: (value: FilterAttribute) => T; - listContains: (value: FilterAttribute) => T; - stringContains: (value: FilterAttribute) => T; - andAll: (value: RetrievalFilter[]) => T; - orAll: (value: RetrievalFilter[]) => T; - _: (name: string, value: any) => T; - } + /** + *

The Amazon Resource Name (ARN) of the session.

+ * @public + */ + sessionArn: string | undefined; - export const visit = (value: RetrievalFilter, visitor: Visitor): T => { - if (value.equals !== undefined) return visitor.equals(value.equals); - if (value.notEquals !== undefined) return visitor.notEquals(value.notEquals); - if (value.greaterThan !== undefined) return visitor.greaterThan(value.greaterThan); - if (value.greaterThanOrEquals !== undefined) return visitor.greaterThanOrEquals(value.greaterThanOrEquals); - if (value.lessThan !== undefined) return visitor.lessThan(value.lessThan); - if (value.lessThanOrEquals !== undefined) return visitor.lessThanOrEquals(value.lessThanOrEquals); - if (value.in !== undefined) return visitor.in(value.in); - if (value.notIn !== undefined) return visitor.notIn(value.notIn); - if (value.startsWith !== undefined) return visitor.startsWith(value.startsWith); - if (value.listContains !== undefined) return visitor.listContains(value.listContains); - if (value.stringContains !== undefined) return visitor.stringContains(value.stringContains); - if (value.andAll !== undefined) return visitor.andAll(value.andAll); - if (value.orAll !== undefined) return visitor.orAll(value.orAll); - return visitor._(value.$unknown[0], value.$unknown[1]); - }; + /** + *

The current status of the session.

+ * @public + */ + sessionStatus: SessionStatus | undefined; + + /** + *

The timestamp for when the session was created.

+ * @public + */ + createdAt: Date | undefined; + + /** + *

The timestamp for when the session was last modified.

+ * @public + */ + lastUpdatedAt: Date | undefined; + + /** + *

A map of key-value pairs containing attributes persisted across the session.

+ * @public + */ + sessionMetadata?: Record | undefined; + + /** + *

The Amazon Resource Name (ARN) of the Key Management Service key used to encrypt the session data. + * For more information, see Amazon Bedrock session encryption.

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

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

- *

This data type is used in the following API operations:

- * * @public */ -export interface KnowledgeBaseVectorSearchConfiguration { +export interface CreateInvocationRequest { /** - *

The number of source chunks to retrieve.

+ *

A unique identifier for the invocation in UUID format.

* @public */ - numberOfResults?: number | undefined; + invocationId?: string | undefined; + + /** + *

A description for the interactions in the invocation. For example, "User asking about weather in Seattle".

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

The unique identifier for the associated session for the invocation. You can specify either the session's sessionId or its Amazon Resource Name (ARN). + *

+ * @public + */ + sessionIdentifier: string | undefined; +} + +/** + * @public + */ +export interface CreateInvocationResponse { + /** + *

The unique identifier for the session associated with the invocation.

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

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.

+ *

The unique identifier for the invocation.

* @public */ - overrideSearchType?: SearchType | undefined; + invocationId: string | undefined; /** - *

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

+ *

The timestamp for when the invocation was created.

* @public */ - filter?: RetrievalFilter | undefined; + createdAt: Date | undefined; +} +/** + * @public + */ +export interface ListInvocationsRequest { /** - *

Contains configurations for reranking the retrieved results. For more information, see Improve the relevance of query responses with a reranker model.

+ *

If the total number of results is greater than the maxResults 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 */ - rerankingConfiguration?: VectorSearchRerankingConfiguration | undefined; + nextToken?: string | undefined; /** - *

Settings for implicit filtering.

+ *

The maximum number of results 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 */ - implicitFilterConfiguration?: ImplicitFilterConfiguration | undefined; + maxResults?: number | undefined; + + /** + *

The unique identifier for the session to list invocations for. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

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

Contains details about an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

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

The unique identifier for the session associated with the invocation.

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

A unique identifier for the invocation in UUID format.

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

The timestamp for when the invocation was created.

+ * @public + */ + createdAt: Date | undefined; } /** - *

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

- *

This data type is used in the following API operations:

- * * @public */ -export interface KnowledgeBaseRetrievalConfiguration { +export interface ListInvocationsResponse { + /** + *

A list of invocation summaries associated with the session.

+ * @public + */ + invocationSummaries: InvocationSummary[] | undefined; + /** - *

Contains details about how the results from the vector search should be returned. For more information, see Query configurations.

+ *

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

* @public */ - vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined; + nextToken?: string | undefined; } /** - *

- * Details of the knowledge base associated withe inline agent. - *

* @public */ -export interface KnowledgeBase { +export interface GetInvocationStepRequest { /** - *

- * The unique identifier for a knowledge base associated with the inline agent. - *

+ *

The unique identifier for the invocation in UUID format.

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

- * The description of the knowledge base associated with the inline agent. - *

+ *

The unique identifier (in UUID format) for the specific invocation step to retrieve.

* @public */ - description: string | undefined; + invocationStepId: string | undefined; /** - *

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

+ *

The unique identifier for the invocation step's associated session. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

* @public */ - retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | undefined; + sessionIdentifier: string | undefined; } /** - *

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

+ * @public + * @enum + */ +export const ImageFormat = { + GIF: "gif", + JPEG: "jpeg", + PNG: "png", + WEBP: "webp", +} as const; + +/** * @public */ -export interface KnowledgeBaseConfiguration { +export type ImageFormat = (typeof ImageFormat)[keyof typeof ImageFormat]; + +/** + *

Information about the Amazon S3 bucket where the image is stored.

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

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

+ *

The path to the Amazon S3 bucket where the image is stored.

* @public */ - knowledgeBaseId: string | undefined; + uri: string | undefined; +} + +/** + *

The source for an image.

+ * @public + */ +export type ImageSource = ImageSource.BytesMember | ImageSource.S3LocationMember | ImageSource.$UnknownMember; + +/** + * @public + */ +export namespace ImageSource { + /** + *

The raw image bytes for the image. If you use an Amazon Web Services SDK, you don't need to encode the image bytes in base64.

+ * @public + */ + export interface BytesMember { + bytes: Uint8Array; + s3Location?: never; + $unknown?: never; + } + + /** + *

The path to the Amazon S3 bucket where the image is stored.

+ * @public + */ + export interface S3LocationMember { + bytes?: never; + s3Location: S3Location; + $unknown?: never; + } /** - *

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

* @public */ - retrievalConfiguration: KnowledgeBaseRetrievalConfiguration | undefined; + export interface $UnknownMember { + bytes?: never; + s3Location?: never; + $unknown: [string, any]; + } + + export interface Visitor { + bytes: (value: Uint8Array) => T; + s3Location: (value: S3Location) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ImageSource, visitor: Visitor): T => { + if (value.bytes !== undefined) return visitor.bytes(value.bytes); + if (value.s3Location !== undefined) return visitor.s3Location(value.s3Location); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; } /** - *

Contains details about the resource being queried.

- *

This data type is used in the following API operations:

- * + *

Image content for an invocation step.

* @public */ -export interface KnowledgeBaseRetrieveAndGenerateConfiguration { +export interface ImageBlock { /** - *

The unique identifier of the knowledge base that is queried.

+ *

The format of the image.

* @public */ - knowledgeBaseId: string | undefined; + format: ImageFormat | undefined; /** - *

The ARN of the foundation model or inference profile used to generate a response.

+ *

The source for the image.

* @public */ - modelArn: string | undefined; + source: ImageSource | undefined; +} + +/** + *

A block of content that you pass to, or receive from, a Amazon Bedrock session in an invocation step. You pass the content to a + * session in the payLoad of the PutInvocationStep API operation. + * You retrieve the content with the GetInvocationStep API operation.

+ *

For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

+ * @public + */ +export type BedrockSessionContentBlock = + | BedrockSessionContentBlock.ImageMember + | BedrockSessionContentBlock.TextMember + | BedrockSessionContentBlock.$UnknownMember; + +/** + * @public + */ +export namespace BedrockSessionContentBlock { + /** + *

The text in the invocation step.

+ * @public + */ + export interface TextMember { + text: string; + image?: never; + $unknown?: never; + } + + /** + *

The image in the invocation step.

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

Payload content, such as text and images, for the invocation step.

+ * @public + */ +export type InvocationStepPayload = InvocationStepPayload.ContentBlocksMember | InvocationStepPayload.$UnknownMember; +/** + * @public + */ +export namespace InvocationStepPayload { /** - *

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

+ *

The content for the invocation step.

* @public */ - retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | undefined; + export interface ContentBlocksMember { + contentBlocks: BedrockSessionContentBlock[]; + $unknown?: never; + } /** - *

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

* @public */ - generationConfiguration?: GenerationConfiguration | undefined; + export interface $UnknownMember { + contentBlocks?: never; + $unknown: [string, any]; + } - /** - *

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

- * @public - */ - orchestrationConfiguration?: OrchestrationConfiguration | undefined; + export interface Visitor { + contentBlocks: (value: BedrockSessionContentBlock[]) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: InvocationStepPayload, visitor: Visitor): T => { + if (value.contentBlocks !== undefined) return visitor.contentBlocks(value.contentBlocks); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; } /** + *

Stores fine-grained state checkpoints, including text and images, for each interaction in an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

* @public */ -export interface RetrieveRequest { +export interface InvocationStep { /** - *

The unique identifier of the knowledge base to query.

+ *

The unique identifier of the session containing the invocation step.

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

Contains the query to send the knowledge base.

+ *

The unique identifier (in UUID format) for the invocation that includes the invocation step.

* @public */ - retrievalQuery: KnowledgeBaseQuery | undefined; + invocationId: string | undefined; /** - *

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

+ *

The unique identifier (in UUID format) for the invocation step.

* @public */ - retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | undefined; + invocationStepId: string | undefined; /** - *

Guardrail settings.

+ *

The timestamp for when the invocation step was created.

* @public */ - guardrailConfiguration?: GuardrailConfiguration | undefined; + invocationStepTime: Date | undefined; /** - *

If there are more results than can fit in the response, the response returns a nextToken. Use this token in the nextToken field of another request to retrieve the next batch of results.

+ *

Payload content, such as text and images, for the invocation step.

* @public */ - nextToken?: string | undefined; + payload: InvocationStepPayload | undefined; } /** - *

Contains details about the resource being queried.

- *

This data type is used in the following API operations:

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

The type of resource that contains your data for retrieving information and generating responses.

- *

If you choose ot use EXTERNAL_SOURCES, then currently only Claude 3 Sonnet models for knowledge bases are supported.

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

Contains details about the knowledge base for retrieving information and generating responses.

- * @public - */ - knowledgeBaseConfiguration?: KnowledgeBaseRetrieveAndGenerateConfiguration | undefined; - +export interface GetInvocationStepResponse { /** - *

The configuration for the external source wrapper object in the retrieveAndGenerate function.

+ *

The complete details of the requested invocation step.

* @public */ - externalSourcesConfiguration?: ExternalSourcesRetrieveAndGenerateConfiguration | undefined; + invocationStep: InvocationStep | undefined; } /** * @public */ -export interface InvokeInlineAgentRequest { +export interface ListInvocationStepsRequest { /** - *

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

+ *

The unique identifier (in UUID format) for the invocation to list invocation steps for.

* @public */ - sessionId: string | undefined; + invocationIdentifier?: string | undefined; /** - *

- * The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use to encrypt your inline agent. - *

+ *

If the total number of results is greater than the maxResults 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 */ - customerEncryptionKeyArn?: string | undefined; + nextToken?: string | undefined; /** - *

- * Specifies whether to end the session with the inline agent or not. - *

+ *

The maximum number of results 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 */ - endSession?: boolean | undefined; + maxResults?: number | undefined; /** - *

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

+ *

The unique identifier for the session associated with the invocation steps. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

* @public */ - enableTrace?: boolean | undefined; + sessionIdentifier: string | undefined; +} +/** + *

Contains details about an invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

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

- * The prompt text to send to the agent. - *

- * - *

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

- *
+ *

The unique identifier for the session associated with the invocation step.

* @public */ - inputText?: string | undefined; + sessionId: string | undefined; /** - *

- * Parameters that specify the various attributes of a sessions. 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. For more information, see Control session context. - *

- * - *

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

- *
+ *

A unique identifier for the invocation in UUID format.

* @public */ - inlineSessionState?: InlineSessionState | undefined; + invocationId: string | undefined; /** - *

- * The model identifier (ID) of the model to use for orchestration by the inline agent. For example, meta.llama3-1-70b-instruct-v1:0. - *

+ *

The unique identifier (in UUID format) for the invocation step.

* @public */ - foundationModel: string | undefined; + invocationStepId: string | undefined; /** - *

- * The instructions that tell the inline agent what it should do and how it should interact with users. - *

+ *

The timestamp for when the invocation step was created.

* @public */ - instruction: string | undefined; + invocationStepTime: Date | undefined; +} +/** + * @public + */ +export interface ListInvocationStepsResponse { /** - *

- * The number of seconds for which the inline agent should maintain session information. After this time expires, the subsequent InvokeInlineAgent request begins a new session. - *

- *

A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and the data provided before the timeout is deleted.

+ *

A list of summaries for each invocation step associated with a session and if you specified it, an invocation within the session.

* @public */ - idleSessionTTLInSeconds?: number | undefined; + invocationStepSummaries: InvocationStepSummary[] | undefined; /** - *

- * A list of action groups with each action group defining the action the inline agent needs to carry out. - *

+ *

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

* @public */ - actionGroups?: AgentActionGroup[] | undefined; + nextToken?: string | undefined; +} +/** + * @public + */ +export interface PutInvocationStepRequest { /** - *

- * Contains information of the knowledge bases to associate with. - *

+ *

The unique identifier for the session to add the invocation step to. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

* @public */ - knowledgeBases?: KnowledgeBase[] | undefined; + sessionIdentifier: string | undefined; /** - *

- * The guardrails to assign to the inline agent. - *

+ *

The unique identifier (in UUID format) of the invocation to add the invocation step to.

* @public */ - guardrailConfiguration?: GuardrailConfigurationWithArn | undefined; + invocationIdentifier: string | undefined; /** - *

- * Configurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent. - *

+ *

The timestamp for when the invocation step occurred.

* @public */ - promptOverrideConfiguration?: PromptOverrideConfiguration | undefined; + invocationStepTime: Date | undefined; /** - *

Model settings for the request.

+ *

The payload for the invocation step, including text and images for the interaction.

* @public */ - bedrockModelConfigurations?: InlineBedrockModelConfigurations | undefined; + payload: InvocationStepPayload | undefined; /** - *

- * Specifies the configurations for streaming. - *

- * - *

To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream action.

- *
+ *

The unique identifier of the invocation step in UUID format.

* @public */ - streamingConfigurations?: StreamingConfigurations | undefined; + invocationStepId?: string | undefined; } /** * @public */ -export interface RetrieveAndGenerateRequest { - /** - *

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; - - /** - *

Contains the query to be made to the knowledge base.

- * @public - */ - input: RetrieveAndGenerateInput | undefined; - - /** - *

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

- * @public - */ - retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration | undefined; - +export interface PutInvocationStepResponse { /** - *

Contains details about the session with the knowledge base.

+ *

The unique identifier of the invocation step in UUID format.

* @public */ - sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined; + invocationStepId: string | undefined; } /** * @public */ -export interface RetrieveAndGenerateStreamRequest { +export interface ListSessionsRequest { /** - *

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.

+ *

The maximum number of results 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 */ - sessionId?: string | undefined; + maxResults?: number | undefined; /** - *

Contains the query to be made to the knowledge base.

+ *

If the total number of results is greater than the maxResults 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 */ - input: RetrieveAndGenerateInput | undefined; + nextToken?: string | undefined; +} +/** + *

Contains details about a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

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

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

+ *

The unique identifier for the session.

* @public */ - retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration | undefined; + sessionId: string | undefined; /** - *

Contains details about the session with the knowledge base.

+ *

The Amazon Resource Name (ARN) of the session.

* @public */ - sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined; -} + sessionArn: string | undefined; -/** - *

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.

+ *

The current status of the session.

* @public */ - sessionAttributes?: Record | undefined; + sessionStatus: SessionStatus | undefined; /** - *

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.

+ *

The timestamp for when the session was created.

* @public */ - promptSessionAttributes?: Record | undefined; + createdAt: Date | undefined; /** - *

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.

- *
+ *

The timestamp for when the session was last modified.

* @public */ - returnControlInvocationResults?: InvocationResultMember[] | undefined; + lastUpdatedAt: Date | undefined; +} +/** + * @public + */ +export interface ListSessionsResponse { /** - *

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.

+ *

A list of summaries for each session in your Amazon Web Services account.

* @public */ - invocationId?: string | undefined; + sessionSummaries: SessionSummary[] | undefined; /** - *

Contains information about the files used by code interpreter.

+ *

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

* @public */ - files?: InputFile[] | undefined; + nextToken?: string | undefined; +} +/** + * @public + */ +export interface UpdateSessionRequest { /** - *

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

+ *

A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, + * and the type of device they are using.

* @public */ - knowledgeBaseConfigurations?: KnowledgeBaseConfiguration[] | undefined; + sessionMetadata?: Record | undefined; /** - *

The state's conversation history.

+ *

The unique identifier of the session to modify. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

* @public */ - conversationHistory?: ConversationHistory | undefined; + sessionIdentifier: string | undefined; } /** * @public */ -export interface InvokeAgentRequest { +export interface UpdateSessionResponse { /** - *

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.

- *
+ *

The unique identifier of the session you updated.

* @public */ - sessionState?: SessionState | undefined; + sessionId: string | undefined; /** - *

The unique identifier of the agent to use.

+ *

The Amazon Resource Name (ARN) of the session that was updated.

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

The alias of the agent to use.

+ *

The status of the session you updated.

* @public */ - agentAliasId: string | undefined; + sessionStatus: SessionStatus | undefined; /** - *

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

+ *

The timestamp for when the session was created.

* @public */ - sessionId: string | undefined; + createdAt: Date | undefined; /** - *

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

+ *

The timestamp for when the session was last modified.

* @public */ - endSession?: boolean | undefined; + lastUpdatedAt: Date | undefined; +} +/** + * @public + */ +export interface ListTagsForResourceRequest { /** - *

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

+ *

The Amazon Resource Name (ARN) of the resource for which to list tags.

* @public */ - enableTrace?: boolean | undefined; + resourceArn: string | undefined; +} +/** + * @public + */ +export interface ListTagsForResourceResponse { /** - *

The prompt text to send the agent.

- * - *

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

- *
+ *

The key-value pairs for the tags associated with the resource.

* @public */ - inputText?: string | undefined; + tags?: Record | undefined; +} +/** + * @public + */ +export interface TagResourceRequest { /** - *

The unique identifier of the agent memory.

+ *

The Amazon Resource Name (ARN) of the resource to tag.

* @public */ - memoryId?: string | undefined; + resourceArn: string | undefined; /** - *

Model performance settings for the request.

+ *

An object containing key-value pairs that define the tags to attach to the resource.

* @public */ - bedrockModelConfigurations?: BedrockModelConfigurations | undefined; + tags: Record | undefined; +} + +/** + * @public + */ +export interface TagResourceResponse {} +/** + * @public + */ +export interface UntagResourceRequest { /** - *

- * Specifies the configurations for streaming. - *

- * - *

To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream action.

- *
+ *

The Amazon Resource Name (ARN) of the resource from which to remove tags.

* @public */ - streamingConfigurations?: StreamingConfigurations | undefined; + resourceArn: string | undefined; /** - *

The ARN of the resource making the request.

+ *

A list of keys of the tags to remove from the resource.

* @public */ - sourceArn?: string | undefined; + tagKeys: string[] | undefined; } +/** + * @public + */ +export interface UntagResourceResponse {} + /** * @internal */ @@ -10437,185 +10337,40 @@ export const RetrieveResponseFilterSensitiveLog = (obj: RetrieveResponse): any = /** * @internal */ -export const RetrievalFilterFilterSensitiveLog = (obj: RetrievalFilter): any => { - if (obj.equals !== undefined) return { equals: obj.equals }; - if (obj.notEquals !== undefined) return { notEquals: obj.notEquals }; - if (obj.greaterThan !== undefined) return { greaterThan: obj.greaterThan }; - if (obj.greaterThanOrEquals !== undefined) return { greaterThanOrEquals: obj.greaterThanOrEquals }; - if (obj.lessThan !== undefined) return { lessThan: obj.lessThan }; - if (obj.lessThanOrEquals !== undefined) return { lessThanOrEquals: obj.lessThanOrEquals }; - if (obj.in !== undefined) return { in: obj.in }; - if (obj.notIn !== undefined) return { notIn: obj.notIn }; - if (obj.startsWith !== undefined) return { startsWith: obj.startsWith }; - if (obj.listContains !== undefined) return { listContains: obj.listContains }; - if (obj.stringContains !== undefined) return { stringContains: obj.stringContains }; - if (obj.andAll !== undefined) return { andAll: SENSITIVE_STRING }; - if (obj.orAll !== undefined) return { orAll: SENSITIVE_STRING }; +export const BedrockSessionContentBlockFilterSensitiveLog = (obj: BedrockSessionContentBlock): any => { + if (obj.text !== undefined) return { text: obj.text }; + if (obj.image !== undefined) return { image: obj.image }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; /** * @internal */ -export const KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog = ( - obj: KnowledgeBaseVectorSearchConfiguration -): any => ({ - ...obj, - ...(obj.filter && { filter: SENSITIVE_STRING }), - ...(obj.rerankingConfiguration && { - rerankingConfiguration: VectorSearchRerankingConfigurationFilterSensitiveLog(obj.rerankingConfiguration), - }), - ...(obj.implicitFilterConfiguration && { - implicitFilterConfiguration: ImplicitFilterConfigurationFilterSensitiveLog(obj.implicitFilterConfiguration), - }), -}); - -/** - * @internal - */ -export const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog = ( - obj: KnowledgeBaseRetrievalConfiguration -): any => ({ - ...obj, - ...(obj.vectorSearchConfiguration && { - vectorSearchConfiguration: KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog(obj.vectorSearchConfiguration), - }), -}); - -/** - * @internal - */ -export const KnowledgeBaseFilterSensitiveLog = (obj: KnowledgeBase): any => ({ - ...obj, - ...(obj.description && { description: SENSITIVE_STRING }), - ...(obj.retrievalConfiguration && { - retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), - }), -}); - -/** - * @internal - */ -export const KnowledgeBaseConfigurationFilterSensitiveLog = (obj: KnowledgeBaseConfiguration): any => ({ - ...obj, - ...(obj.retrievalConfiguration && { - retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), - }), -}); - -/** - * @internal - */ -export const KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog = ( - obj: KnowledgeBaseRetrieveAndGenerateConfiguration -): any => ({ - ...obj, - ...(obj.retrievalConfiguration && { - retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), - }), - ...(obj.generationConfiguration && { - generationConfiguration: GenerationConfigurationFilterSensitiveLog(obj.generationConfiguration), - }), - ...(obj.orchestrationConfiguration && { - orchestrationConfiguration: OrchestrationConfigurationFilterSensitiveLog(obj.orchestrationConfiguration), - }), -}); - -/** - * @internal - */ -export const RetrieveRequestFilterSensitiveLog = (obj: RetrieveRequest): any => ({ - ...obj, - ...(obj.retrievalQuery && { retrievalQuery: SENSITIVE_STRING }), - ...(obj.retrievalConfiguration && { - retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), - }), -}); - -/** - * @internal - */ -export const RetrieveAndGenerateConfigurationFilterSensitiveLog = (obj: RetrieveAndGenerateConfiguration): any => ({ - ...obj, - ...(obj.knowledgeBaseConfiguration && { - knowledgeBaseConfiguration: KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog( - obj.knowledgeBaseConfiguration - ), - }), - ...(obj.externalSourcesConfiguration && { - externalSourcesConfiguration: ExternalSourcesRetrieveAndGenerateConfigurationFilterSensitiveLog( - obj.externalSourcesConfiguration - ), - }), -}); - -/** - * @internal - */ -export const InvokeInlineAgentRequestFilterSensitiveLog = (obj: InvokeInlineAgentRequest): any => ({ - ...obj, - ...(obj.inputText && { inputText: SENSITIVE_STRING }), - ...(obj.inlineSessionState && { inlineSessionState: InlineSessionStateFilterSensitiveLog(obj.inlineSessionState) }), - ...(obj.instruction && { instruction: SENSITIVE_STRING }), - ...(obj.actionGroups && { actionGroups: obj.actionGroups.map((item) => AgentActionGroupFilterSensitiveLog(item)) }), - ...(obj.knowledgeBases && { - knowledgeBases: obj.knowledgeBases.map((item) => KnowledgeBaseFilterSensitiveLog(item)), - }), - ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), -}); - -/** - * @internal - */ -export const RetrieveAndGenerateRequestFilterSensitiveLog = (obj: RetrieveAndGenerateRequest): any => ({ - ...obj, - ...(obj.input && { input: SENSITIVE_STRING }), - ...(obj.retrieveAndGenerateConfiguration && { - retrieveAndGenerateConfiguration: RetrieveAndGenerateConfigurationFilterSensitiveLog( - obj.retrieveAndGenerateConfiguration - ), - }), -}); +export const InvocationStepPayloadFilterSensitiveLog = (obj: InvocationStepPayload): any => { + if (obj.contentBlocks !== undefined) return { contentBlocks: SENSITIVE_STRING }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; /** * @internal */ -export const RetrieveAndGenerateStreamRequestFilterSensitiveLog = (obj: RetrieveAndGenerateStreamRequest): any => ({ +export const InvocationStepFilterSensitiveLog = (obj: InvocationStep): any => ({ ...obj, - ...(obj.input && { input: SENSITIVE_STRING }), - ...(obj.retrieveAndGenerateConfiguration && { - retrieveAndGenerateConfiguration: RetrieveAndGenerateConfigurationFilterSensitiveLog( - obj.retrieveAndGenerateConfiguration - ), - }), + ...(obj.payload && { payload: InvocationStepPayloadFilterSensitiveLog(obj.payload) }), }); /** * @internal */ -export const SessionStateFilterSensitiveLog = (obj: SessionState): any => ({ +export const GetInvocationStepResponseFilterSensitiveLog = (obj: GetInvocationStepResponse): 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) - ), - }), - ...(obj.conversationHistory && { - conversationHistory: ConversationHistoryFilterSensitiveLog(obj.conversationHistory), - }), + ...(obj.invocationStep && { invocationStep: InvocationStepFilterSensitiveLog(obj.invocationStep) }), }); /** * @internal */ -export const InvokeAgentRequestFilterSensitiveLog = (obj: InvokeAgentRequest): any => ({ +export const PutInvocationStepRequestFilterSensitiveLog = (obj: PutInvocationStepRequest): any => ({ ...obj, - ...(obj.sessionState && { sessionState: SessionStateFilterSensitiveLog(obj.sessionState) }), - ...(obj.inputText && { inputText: SENSITIVE_STRING }), + ...(obj.payload && { payload: InvocationStepPayloadFilterSensitiveLog(obj.payload) }), }); diff --git a/clients/client-bedrock-agent-runtime/src/models/models_1.ts b/clients/client-bedrock-agent-runtime/src/models/models_1.ts new file mode 100644 index 000000000000..5a70634ec3bd --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/models/models_1.ts @@ -0,0 +1,1200 @@ +// smithy-typescript generated code +import { SENSITIVE_STRING } from "@smithy/smithy-client"; + +import { + AgentActionGroup, + AgentActionGroupFilterSensitiveLog, + BedrockModelConfigurations, + ConversationHistory, + ConversationHistoryFilterSensitiveLog, + ExternalSourcesRetrieveAndGenerateConfiguration, + ExternalSourcesRetrieveAndGenerateConfigurationFilterSensitiveLog, + FilterAttribute, + GenerationConfiguration, + GenerationConfigurationFilterSensitiveLog, + GuardrailConfiguration, + GuardrailConfigurationWithArn, + ImplicitFilterConfiguration, + ImplicitFilterConfigurationFilterSensitiveLog, + InlineBedrockModelConfigurations, + InlineSessionState, + InlineSessionStateFilterSensitiveLog, + InputFile, + InputFileFilterSensitiveLog, + InvocationResultMember, + InvocationResultMemberFilterSensitiveLog, + KnowledgeBaseQuery, + OrchestrationConfiguration, + OrchestrationConfigurationFilterSensitiveLog, + PromptOverrideConfiguration, + RetrieveAndGenerateInput, + RetrieveAndGenerateSessionConfiguration, + RetrieveAndGenerateType, + SearchType, + StreamingConfigurations, + VectorSearchRerankingConfiguration, + VectorSearchRerankingConfigurationFilterSensitiveLog, +} from "./models_0"; + +/** + *

Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations. See the examples below to see how to use these filters.

+ *

This data type is used in the following API operations:

+ * + * @public + */ +export type RetrievalFilter = + | RetrievalFilter.AndAllMember + | RetrievalFilter.EqualsMember + | RetrievalFilter.GreaterThanMember + | RetrievalFilter.GreaterThanOrEqualsMember + | RetrievalFilter.InMember + | RetrievalFilter.LessThanMember + | RetrievalFilter.LessThanOrEqualsMember + | RetrievalFilter.ListContainsMember + | RetrievalFilter.NotEqualsMember + | RetrievalFilter.NotInMember + | RetrievalFilter.OrAllMember + | RetrievalFilter.StartsWithMember + | RetrievalFilter.StringContainsMember + | RetrievalFilter.$UnknownMember; + +/** + * @public + */ +export namespace RetrievalFilter { + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

+ *

The following example would return data sources with an animal attribute whose value is cat:

+ *

+ * "equals": \{ "key": "animal", "value": "cat" \} + *

+ * @public + */ + export interface EqualsMember { + equals: FilterAttribute; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

+ *

The following example would return data sources that don't contain an animal attribute whose value is cat.

+ *

+ * "notEquals": \{ "key": "animal", "value": "cat" \} + *

+ * @public + */ + export interface NotEqualsMember { + equals?: never; + notEquals: FilterAttribute; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

+ *

The following example would return data sources with an year attribute whose value is greater than 1989:

+ *

+ * "greaterThan": \{ "key": "year", "value": 1989 \} + *

+ * @public + */ + export interface GreaterThanMember { + equals?: never; + notEquals?: never; + greaterThan: FilterAttribute; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

+ *

The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

+ *

+ * "greaterThanOrEquals": \{ "key": "year", "value": 1989 \} + *

+ * @public + */ + export interface GreaterThanOrEqualsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals: FilterAttribute; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

+ *

The following example would return data sources with an year attribute whose value is less than to 1989.

+ *

+ * "lessThan": \{ "key": "year", "value": 1989 \} + *

+ * @public + */ + export interface LessThanMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan: FilterAttribute; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

+ *

The following example would return data sources with an year attribute whose value is less than or equal to 1989.

+ *

+ * "lessThanOrEquals": \{ "key": "year", "value": 1989 \} + *

+ * @public + */ + export interface LessThanOrEqualsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals: FilterAttribute; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

+ *

The following example would return data sources with an animal attribute that is either cat or dog:

+ *

+ * "in": \{ "key": "animal", "value": ["cat", "dog"] \} + *

+ * @public + */ + export interface InMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in: FilterAttribute; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

+ *

The following example would return data sources whose animal attribute is neither cat nor dog.

+ *

+ * "notIn": \{ "key": "animal", "value": ["cat", "dog"] \} + *

+ * @public + */ + export interface NotInMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn: FilterAttribute; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

+ *

The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

+ *

+ * "startsWith": \{ "key": "animal", "value": "ca" \} + *

+ * @public + */ + export interface StartsWithMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith: FilterAttribute; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

+ *

The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

+ *

+ * "listContains": \{ "key": "animals", "value": "cat" \} + *

+ * @public + */ + export interface ListContainsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains: FilterAttribute; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

+ *
    + *
  • + *

    A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

    + *

    + * "stringContains": \{ "key": "animal", "value": "at" \} + *

    + *
  • + *
  • + *

    A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

    + *

    + * "stringContains": \{ "key": "animals", "value": "at" \} + *

    + *
  • + *
+ * @public + */ + export interface StringContainsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains: FilterAttribute; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

+ * @public + */ + export interface AndAllMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll: RetrievalFilter[]; + orAll?: never; + $unknown?: never; + } + + /** + *

Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

+ * @public + */ + export interface OrAllMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll: RetrievalFilter[]; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown: [string, any]; + } + + export interface Visitor { + equals: (value: FilterAttribute) => T; + notEquals: (value: FilterAttribute) => T; + greaterThan: (value: FilterAttribute) => T; + greaterThanOrEquals: (value: FilterAttribute) => T; + lessThan: (value: FilterAttribute) => T; + lessThanOrEquals: (value: FilterAttribute) => T; + in: (value: FilterAttribute) => T; + notIn: (value: FilterAttribute) => T; + startsWith: (value: FilterAttribute) => T; + listContains: (value: FilterAttribute) => T; + stringContains: (value: FilterAttribute) => T; + andAll: (value: RetrievalFilter[]) => T; + orAll: (value: RetrievalFilter[]) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: RetrievalFilter, visitor: Visitor): T => { + if (value.equals !== undefined) return visitor.equals(value.equals); + if (value.notEquals !== undefined) return visitor.notEquals(value.notEquals); + if (value.greaterThan !== undefined) return visitor.greaterThan(value.greaterThan); + if (value.greaterThanOrEquals !== undefined) return visitor.greaterThanOrEquals(value.greaterThanOrEquals); + if (value.lessThan !== undefined) return visitor.lessThan(value.lessThan); + if (value.lessThanOrEquals !== undefined) return visitor.lessThanOrEquals(value.lessThanOrEquals); + if (value.in !== undefined) return visitor.in(value.in); + if (value.notIn !== undefined) return visitor.notIn(value.notIn); + if (value.startsWith !== undefined) return visitor.startsWith(value.startsWith); + if (value.listContains !== undefined) return visitor.listContains(value.listContains); + if (value.stringContains !== undefined) return visitor.stringContains(value.stringContains); + if (value.andAll !== undefined) return visitor.andAll(value.andAll); + if (value.orAll !== undefined) return visitor.orAll(value.orAll); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + *

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

+ *

This data type is used in the following API operations:

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

The number of source chunks to retrieve.

+ * @public + */ + numberOfResults?: number | undefined; + + /** + *

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.

+ * @public + */ + overrideSearchType?: SearchType | undefined; + + /** + *

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

+ * @public + */ + filter?: RetrievalFilter | undefined; + + /** + *

Contains configurations for reranking the retrieved results. For more information, see Improve the relevance of query responses with a reranker model.

+ * @public + */ + rerankingConfiguration?: VectorSearchRerankingConfiguration | undefined; + + /** + *

Settings for implicit filtering.

+ * @public + */ + implicitFilterConfiguration?: ImplicitFilterConfiguration | undefined; +} + +/** + *

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

+ *

This data type is used in the following API operations:

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

Contains details about how the results from the vector search should be returned. For more information, see Query configurations.

+ * @public + */ + vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined; +} + +/** + *

+ * Details of the knowledge base associated withe inline agent. + *

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

+ * The unique identifier for a knowledge base associated with the inline agent. + *

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

+ * The description of the knowledge base associated with the inline agent. + *

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

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

+ * @public + */ + retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | 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:

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

The unique identifier of the knowledge base that is queried.

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

The ARN of the foundation model or inference profile used to generate a response.

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

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

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

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

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

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

+ * @public + */ + orchestrationConfiguration?: OrchestrationConfiguration | undefined; +} + +/** + * @public + */ +export interface RetrieveRequest { + /** + *

The unique identifier of the knowledge base to query.

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

Contains the query to send the knowledge base.

+ * @public + */ + retrievalQuery: KnowledgeBaseQuery | undefined; + + /** + *

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

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

Guardrail settings.

+ * @public + */ + guardrailConfiguration?: GuardrailConfiguration | undefined; + + /** + *

If there are more results than can fit in the response, the response returns a nextToken. Use this token in the nextToken field of another request to retrieve the next batch of results.

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

Contains details about the resource being queried.

+ *

This data type is used in the following API operations:

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

The type of resource that contains your data for retrieving information and generating responses.

+ *

If you choose to use EXTERNAL_SOURCES, then currently only Anthropic Claude 3 Sonnet models for knowledge bases are supported.

+ * @public + */ + type: RetrieveAndGenerateType | undefined; + + /** + *

Contains details about the knowledge base for retrieving information and generating responses.

+ * @public + */ + knowledgeBaseConfiguration?: KnowledgeBaseRetrieveAndGenerateConfiguration | undefined; + + /** + *

The configuration for the external source wrapper object in the retrieveAndGenerate function.

+ * @public + */ + externalSourcesConfiguration?: ExternalSourcesRetrieveAndGenerateConfiguration | undefined; +} + +/** + * @public + */ +export interface InvokeInlineAgentRequest { + /** + *

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

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

+ * The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use to encrypt your inline agent. + *

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

+ * Specifies whether to end the session with the inline agent or not. + *

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

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

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

+ * The prompt text to send to the agent. + *

+ * + *

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

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

+ * Parameters that specify the various attributes of a sessions. 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. For more information, see Control session context. + *

+ * + *

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

+ *
+ * @public + */ + inlineSessionState?: InlineSessionState | undefined; + + /** + *

+ * The model identifier (ID) of the model to use for orchestration by the inline agent. For example, meta.llama3-1-70b-instruct-v1:0. + *

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

+ * The instructions that tell the inline agent what it should do and how it should interact with users. + *

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

+ * The number of seconds for which the inline agent should maintain session information. After this time expires, the subsequent InvokeInlineAgent request begins a new session. + *

+ *

A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and the data provided before the timeout is deleted.

+ * @public + */ + idleSessionTTLInSeconds?: number | undefined; + + /** + *

+ * A list of action groups with each action group defining the action the inline agent needs to carry out. + *

+ * @public + */ + actionGroups?: AgentActionGroup[] | undefined; + + /** + *

+ * Contains information of the knowledge bases to associate with. + *

+ * @public + */ + knowledgeBases?: KnowledgeBase[] | undefined; + + /** + *

+ * The guardrails to assign to the inline agent. + *

+ * @public + */ + guardrailConfiguration?: GuardrailConfigurationWithArn | undefined; + + /** + *

+ * Configurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent. + *

+ * @public + */ + promptOverrideConfiguration?: PromptOverrideConfiguration | undefined; + + /** + *

Model settings for the request.

+ * @public + */ + bedrockModelConfigurations?: InlineBedrockModelConfigurations | undefined; + + /** + *

+ * Specifies the configurations for streaming. + *

+ * + *

To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream action.

+ *
+ * @public + */ + streamingConfigurations?: StreamingConfigurations | undefined; +} + +/** + * @public + */ +export interface RetrieveAndGenerateRequest { + /** + *

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; + + /** + *

Contains the query to be made to the knowledge base.

+ * @public + */ + input: RetrieveAndGenerateInput | undefined; + + /** + *

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

+ * @public + */ + retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration | undefined; + + /** + *

Contains details about the session with the knowledge base.

+ * @public + */ + sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined; +} + +/** + * @public + */ +export interface RetrieveAndGenerateStreamRequest { + /** + *

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; + + /** + *

Contains the query to be made to the knowledge base.

+ * @public + */ + input: RetrieveAndGenerateInput | undefined; + + /** + *

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

+ * @public + */ + retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration | undefined; + + /** + *

Contains details about the session with the knowledge base.

+ * @public + */ + sessionConfiguration?: RetrieveAndGenerateSessionConfiguration | undefined; +} + +/** + *

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 | undefined; + + /** + *

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 | undefined; + + /** + *

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[] | undefined; + + /** + *

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 | undefined; + + /** + *

Contains information about the files used by code interpreter.

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

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

+ * @public + */ + knowledgeBaseConfigurations?: KnowledgeBaseConfiguration[] | undefined; + + /** + *

The state's conversation history.

+ * @public + */ + conversationHistory?: ConversationHistory | undefined; +} + +/** + * @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 | undefined; + + /** + *

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 | undefined; + + /** + *

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 | undefined; + + /** + *

The prompt text to send the agent.

+ * + *

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

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

The unique identifier of the agent memory.

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

Model performance settings for the request.

+ * @public + */ + bedrockModelConfigurations?: BedrockModelConfigurations | undefined; + + /** + *

+ * Specifies the configurations for streaming. + *

+ * + *

To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream action.

+ *
+ * @public + */ + streamingConfigurations?: StreamingConfigurations | undefined; + + /** + *

The ARN of the resource making the request.

+ * @public + */ + sourceArn?: string | undefined; +} + +/** + * @internal + */ +export const RetrievalFilterFilterSensitiveLog = (obj: RetrievalFilter): any => { + if (obj.equals !== undefined) return { equals: obj.equals }; + if (obj.notEquals !== undefined) return { notEquals: obj.notEquals }; + if (obj.greaterThan !== undefined) return { greaterThan: obj.greaterThan }; + if (obj.greaterThanOrEquals !== undefined) return { greaterThanOrEquals: obj.greaterThanOrEquals }; + if (obj.lessThan !== undefined) return { lessThan: obj.lessThan }; + if (obj.lessThanOrEquals !== undefined) return { lessThanOrEquals: obj.lessThanOrEquals }; + if (obj.in !== undefined) return { in: obj.in }; + if (obj.notIn !== undefined) return { notIn: obj.notIn }; + if (obj.startsWith !== undefined) return { startsWith: obj.startsWith }; + if (obj.listContains !== undefined) return { listContains: obj.listContains }; + if (obj.stringContains !== undefined) return { stringContains: obj.stringContains }; + if (obj.andAll !== undefined) return { andAll: SENSITIVE_STRING }; + if (obj.orAll !== undefined) return { orAll: SENSITIVE_STRING }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog = ( + obj: KnowledgeBaseVectorSearchConfiguration +): any => ({ + ...obj, + ...(obj.filter && { filter: SENSITIVE_STRING }), + ...(obj.rerankingConfiguration && { + rerankingConfiguration: VectorSearchRerankingConfigurationFilterSensitiveLog(obj.rerankingConfiguration), + }), + ...(obj.implicitFilterConfiguration && { + implicitFilterConfiguration: ImplicitFilterConfigurationFilterSensitiveLog(obj.implicitFilterConfiguration), + }), +}); + +/** + * @internal + */ +export const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog = ( + obj: KnowledgeBaseRetrievalConfiguration +): any => ({ + ...obj, + ...(obj.vectorSearchConfiguration && { + vectorSearchConfiguration: KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog(obj.vectorSearchConfiguration), + }), +}); + +/** + * @internal + */ +export const KnowledgeBaseFilterSensitiveLog = (obj: KnowledgeBase): any => ({ + ...obj, + ...(obj.description && { description: SENSITIVE_STRING }), + ...(obj.retrievalConfiguration && { + retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), + }), +}); + +/** + * @internal + */ +export const KnowledgeBaseConfigurationFilterSensitiveLog = (obj: KnowledgeBaseConfiguration): any => ({ + ...obj, + ...(obj.retrievalConfiguration && { + retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), + }), +}); + +/** + * @internal + */ +export const KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog = ( + obj: KnowledgeBaseRetrieveAndGenerateConfiguration +): any => ({ + ...obj, + ...(obj.retrievalConfiguration && { + retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), + }), + ...(obj.generationConfiguration && { + generationConfiguration: GenerationConfigurationFilterSensitiveLog(obj.generationConfiguration), + }), + ...(obj.orchestrationConfiguration && { + orchestrationConfiguration: OrchestrationConfigurationFilterSensitiveLog(obj.orchestrationConfiguration), + }), +}); + +/** + * @internal + */ +export const RetrieveRequestFilterSensitiveLog = (obj: RetrieveRequest): any => ({ + ...obj, + ...(obj.retrievalQuery && { retrievalQuery: SENSITIVE_STRING }), + ...(obj.retrievalConfiguration && { + retrievalConfiguration: KnowledgeBaseRetrievalConfigurationFilterSensitiveLog(obj.retrievalConfiguration), + }), +}); + +/** + * @internal + */ +export const RetrieveAndGenerateConfigurationFilterSensitiveLog = (obj: RetrieveAndGenerateConfiguration): any => ({ + ...obj, + ...(obj.knowledgeBaseConfiguration && { + knowledgeBaseConfiguration: KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog( + obj.knowledgeBaseConfiguration + ), + }), + ...(obj.externalSourcesConfiguration && { + externalSourcesConfiguration: ExternalSourcesRetrieveAndGenerateConfigurationFilterSensitiveLog( + obj.externalSourcesConfiguration + ), + }), +}); + +/** + * @internal + */ +export const InvokeInlineAgentRequestFilterSensitiveLog = (obj: InvokeInlineAgentRequest): any => ({ + ...obj, + ...(obj.inputText && { inputText: SENSITIVE_STRING }), + ...(obj.inlineSessionState && { inlineSessionState: InlineSessionStateFilterSensitiveLog(obj.inlineSessionState) }), + ...(obj.instruction && { instruction: SENSITIVE_STRING }), + ...(obj.actionGroups && { actionGroups: obj.actionGroups.map((item) => AgentActionGroupFilterSensitiveLog(item)) }), + ...(obj.knowledgeBases && { + knowledgeBases: obj.knowledgeBases.map((item) => KnowledgeBaseFilterSensitiveLog(item)), + }), + ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const RetrieveAndGenerateRequestFilterSensitiveLog = (obj: RetrieveAndGenerateRequest): any => ({ + ...obj, + ...(obj.input && { input: SENSITIVE_STRING }), + ...(obj.retrieveAndGenerateConfiguration && { + retrieveAndGenerateConfiguration: RetrieveAndGenerateConfigurationFilterSensitiveLog( + obj.retrieveAndGenerateConfiguration + ), + }), +}); + +/** + * @internal + */ +export const RetrieveAndGenerateStreamRequestFilterSensitiveLog = (obj: RetrieveAndGenerateStreamRequest): any => ({ + ...obj, + ...(obj.input && { input: SENSITIVE_STRING }), + ...(obj.retrieveAndGenerateConfiguration && { + retrieveAndGenerateConfiguration: RetrieveAndGenerateConfigurationFilterSensitiveLog( + obj.retrieveAndGenerateConfiguration + ), + }), +}); + +/** + * @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) + ), + }), + ...(obj.conversationHistory && { + conversationHistory: ConversationHistoryFilterSensitiveLog(obj.conversationHistory), + }), +}); + +/** + * @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/ListInvocationStepsPaginator.ts b/clients/client-bedrock-agent-runtime/src/pagination/ListInvocationStepsPaginator.ts new file mode 100644 index 000000000000..402e29d0bf53 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/pagination/ListInvocationStepsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient"; +import { + ListInvocationStepsCommand, + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput, +} from "../commands/ListInvocationStepsCommand"; +import { BedrockAgentRuntimePaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListInvocationSteps: ( + config: BedrockAgentRuntimePaginationConfiguration, + input: ListInvocationStepsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BedrockAgentRuntimePaginationConfiguration, + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput +>(BedrockAgentRuntimeClient, ListInvocationStepsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-bedrock-agent-runtime/src/pagination/ListInvocationsPaginator.ts b/clients/client-bedrock-agent-runtime/src/pagination/ListInvocationsPaginator.ts new file mode 100644 index 000000000000..04ec527f5ecd --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/pagination/ListInvocationsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient"; +import { + ListInvocationsCommand, + ListInvocationsCommandInput, + ListInvocationsCommandOutput, +} from "../commands/ListInvocationsCommand"; +import { BedrockAgentRuntimePaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListInvocations: ( + config: BedrockAgentRuntimePaginationConfiguration, + input: ListInvocationsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BedrockAgentRuntimePaginationConfiguration, + ListInvocationsCommandInput, + ListInvocationsCommandOutput +>(BedrockAgentRuntimeClient, ListInvocationsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-bedrock-agent-runtime/src/pagination/ListSessionsPaginator.ts b/clients/client-bedrock-agent-runtime/src/pagination/ListSessionsPaginator.ts new file mode 100644 index 000000000000..820a15e61583 --- /dev/null +++ b/clients/client-bedrock-agent-runtime/src/pagination/ListSessionsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient"; +import { + ListSessionsCommand, + ListSessionsCommandInput, + ListSessionsCommandOutput, +} from "../commands/ListSessionsCommand"; +import { BedrockAgentRuntimePaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListSessions: ( + config: BedrockAgentRuntimePaginationConfiguration, + input: ListSessionsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BedrockAgentRuntimePaginationConfiguration, + ListSessionsCommandInput, + ListSessionsCommandOutput +>(BedrockAgentRuntimeClient, ListSessionsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-bedrock-agent-runtime/src/pagination/index.ts b/clients/client-bedrock-agent-runtime/src/pagination/index.ts index d32a0442bdcf..c8cfdf4f6797 100644 --- a/clients/client-bedrock-agent-runtime/src/pagination/index.ts +++ b/clients/client-bedrock-agent-runtime/src/pagination/index.ts @@ -1,5 +1,8 @@ export * from "./GetAgentMemoryPaginator"; // smithy-typescript generated code export * from "./Interfaces"; +export * from "./ListInvocationStepsPaginator"; +export * from "./ListInvocationsPaginator"; +export * from "./ListSessionsPaginator"; export * from "./RerankPaginator"; 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 2fa77221c698..f74a59c8bf13 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -22,6 +22,7 @@ import { map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, + serializeDateTime as __serializeDateTime, serializeFloat as __serializeFloat, take, withBaseException, @@ -34,13 +35,30 @@ import { SerdeContext as __SerdeContext, } from "@smithy/types"; +import { CreateInvocationCommandInput, CreateInvocationCommandOutput } from "../commands/CreateInvocationCommand"; +import { CreateSessionCommandInput, CreateSessionCommandOutput } from "../commands/CreateSessionCommand"; import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from "../commands/DeleteAgentMemoryCommand"; +import { DeleteSessionCommandInput, DeleteSessionCommandOutput } from "../commands/DeleteSessionCommand"; +import { EndSessionCommandInput, EndSessionCommandOutput } from "../commands/EndSessionCommand"; import { GenerateQueryCommandInput, GenerateQueryCommandOutput } from "../commands/GenerateQueryCommand"; import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "../commands/GetAgentMemoryCommand"; +import { GetInvocationStepCommandInput, GetInvocationStepCommandOutput } from "../commands/GetInvocationStepCommand"; +import { GetSessionCommandInput, GetSessionCommandOutput } from "../commands/GetSessionCommand"; import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "../commands/InvokeAgentCommand"; import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "../commands/InvokeFlowCommand"; import { InvokeInlineAgentCommandInput, InvokeInlineAgentCommandOutput } from "../commands/InvokeInlineAgentCommand"; +import { ListInvocationsCommandInput, ListInvocationsCommandOutput } from "../commands/ListInvocationsCommand"; +import { + ListInvocationStepsCommandInput, + ListInvocationStepsCommandOutput, +} from "../commands/ListInvocationStepsCommand"; +import { ListSessionsCommandInput, ListSessionsCommandOutput } from "../commands/ListSessionsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "../commands/OptimizePromptCommand"; +import { PutInvocationStepCommandInput, PutInvocationStepCommandOutput } from "../commands/PutInvocationStepCommand"; import { RerankCommandInput, RerankCommandOutput } from "../commands/RerankCommand"; import { RetrieveAndGenerateCommandInput, @@ -51,6 +69,9 @@ import { RetrieveAndGenerateStreamCommandOutput, } from "../commands/RetrieveAndGenerateStreamCommand"; import { RetrieveCommandInput, RetrieveCommandOutput } from "../commands/RetrieveCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { UpdateSessionCommandInput, UpdateSessionCommandOutput } from "../commands/UpdateSessionCommand"; import { BedrockAgentRuntimeServiceException as __BaseException } from "../models/BedrockAgentRuntimeServiceException"; import { AccessDeniedException, @@ -65,6 +86,7 @@ import { BedrockModelConfigurations, BedrockRerankingConfiguration, BedrockRerankingModelConfiguration, + BedrockSessionContentBlock, ByteContentDoc, ByteContentFile, Citation, @@ -105,6 +127,8 @@ import { GuardrailConfiguration, GuardrailConfigurationWithArn, GuardrailEvent, + ImageBlock, + ImageSource, ImplicitFilterConfiguration, InferenceConfig, InferenceConfiguration, @@ -119,14 +143,13 @@ import { InputPrompt, InternalServerException, InvocationResultMember, - KnowledgeBase, - KnowledgeBaseConfiguration, + InvocationStep, + InvocationStepPayload, + InvocationStepSummary, + InvocationSummary, KnowledgeBaseLookupOutput, KnowledgeBaseQuery, - KnowledgeBaseRetrievalConfiguration, KnowledgeBaseRetrievalResult, - KnowledgeBaseRetrieveAndGenerateConfiguration, - KnowledgeBaseVectorSearchConfiguration, Memory, MemorySessionSummary, Message, @@ -164,8 +187,6 @@ import { RerankTextDocument, ResourceNotFoundException, ResponseStream, - RetrievalFilter, - RetrieveAndGenerateConfiguration, RetrieveAndGenerateInput, RetrieveAndGenerateOutputEvent, RetrieveAndGenerateSessionConfiguration, @@ -174,10 +195,11 @@ import { ReturnControlPayload, RoutingClassifierTrace, S3Identifier, + S3Location, S3ObjectDoc, S3ObjectFile, ServiceQuotaExceededException, - SessionState, + SessionSummary, StreamingConfigurations, TextInferenceConfig, TextPrompt, @@ -192,6 +214,64 @@ import { VectorSearchBedrockRerankingModelConfiguration, VectorSearchRerankingConfiguration, } from "../models/models_0"; +import { + KnowledgeBase, + KnowledgeBaseConfiguration, + KnowledgeBaseRetrievalConfiguration, + KnowledgeBaseRetrieveAndGenerateConfiguration, + KnowledgeBaseVectorSearchConfiguration, + RetrievalFilter, + RetrieveAndGenerateConfiguration, + SessionState, +} from "../models/models_1"; + +/** + * serializeAws_restJson1CreateInvocationCommand + */ +export const se_CreateInvocationCommand = async ( + input: CreateInvocationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions/{sessionIdentifier}/invocations"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + description: [], + invocationId: [], + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1CreateSessionCommand + */ +export const se_CreateSessionCommand = async ( + input: CreateSessionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions"); + let body: any; + body = JSON.stringify( + take(input, { + encryptionKeyArn: [], + sessionMetadata: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; /** * serializeAws_restJson1DeleteAgentMemoryCommand @@ -214,6 +294,38 @@ export const se_DeleteAgentMemoryCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DeleteSessionCommand + */ +export const se_DeleteSessionCommand = async ( + input: DeleteSessionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/sessions/{sessionIdentifier}"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1EndSessionCommand + */ +export const se_EndSessionCommand = async ( + input: EndSessionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/sessions/{sessionIdentifier}"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + b.m("PATCH").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GenerateQueryCommand */ @@ -260,6 +372,46 @@ export const se_GetAgentMemoryCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetInvocationStepCommand + */ +export const se_GetInvocationStepCommand = async ( + input: GetInvocationStepCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions/{sessionIdentifier}/invocationSteps/{invocationStepId}"); + b.p("invocationStepId", () => input.invocationStepId!, "{invocationStepId}", false); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + invocationIdentifier: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetSessionCommand + */ +export const se_GetSessionCommand = async ( + input: GetSessionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/sessions/{sessionIdentifier}"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1InvokeAgentCommand */ @@ -355,6 +507,88 @@ export const se_InvokeInlineAgentCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListInvocationsCommand + */ +export const se_ListInvocationsCommand = async ( + input: ListInvocationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/sessions/{sessionIdentifier}/invocations"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + const query: any = map({ + [_nT]: [, input[_nT]!], + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListInvocationStepsCommand + */ +export const se_ListInvocationStepsCommand = async ( + input: ListInvocationStepsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions/{sessionIdentifier}/invocationSteps"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + const query: any = map({ + [_nT]: [, input[_nT]!], + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + invocationIdentifier: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListSessionsCommand + */ +export const se_ListSessionsCommand = async ( + input: ListSessionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/sessions"); + const query: any = map({ + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + [_nT]: [, input[_nT]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1OptimizePromptCommand */ @@ -378,6 +612,32 @@ export const se_OptimizePromptCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1PutInvocationStepCommand + */ +export const se_PutInvocationStepCommand = async ( + input: PutInvocationStepCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions/{sessionIdentifier}/invocationSteps"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + invocationIdentifier: [], + invocationStepId: [], + invocationStepTime: (_) => __serializeDateTime(_), + payload: (_) => se_InvocationStepPayload(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1RerankCommand */ @@ -476,6 +736,118 @@ export const se_RetrieveAndGenerateStreamCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + body = JSON.stringify( + take(input, { + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + const query: any = map({ + [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK]! || []], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UpdateSessionCommand + */ +export const se_UpdateSessionCommand = async ( + input: UpdateSessionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/sessions/{sessionIdentifier}"); + b.p("sessionIdentifier", () => input.sessionIdentifier!, "{sessionIdentifier}", false); + let body: any; + body = JSON.stringify( + take(input, { + sessionMetadata: (_) => _json(_), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1CreateInvocationCommand + */ +export const de_CreateInvocationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && 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, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + invocationId: __expectString, + sessionId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateSessionCommand + */ +export const de_CreateSessionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && 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, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionArn: __expectString, + sessionId: __expectString, + sessionStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1DeleteAgentMemoryCommand */ @@ -489,17 +861,208 @@ export const de_DeleteAgentMemoryCommand = async ( const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteSessionCommand + */ +export const de_DeleteSessionCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1EndSessionCommand + */ +export const de_EndSessionCommand = 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, { + sessionArn: __expectString, + sessionId: __expectString, + sessionStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GenerateQueryCommand + */ +export const de_GenerateQueryCommand = 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, { + queries: _json, + }); + Object.assign(contents, doc); + 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_restJson1GetInvocationStepCommand + */ +export const de_GetInvocationStepCommand = 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, { + invocationStep: (_) => de_InvocationStep(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetSessionCommand + */ +export const de_GetSessionCommand = 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, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + encryptionKeyArn: __expectString, + lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionArn: __expectString, + sessionId: __expectString, + sessionMetadata: _json, + sessionStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1InvokeAgentCommand + */ +export const de_InvokeAgentCommand = 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), + [_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), + [_eI]: [, output.headers[_xabfei]], + }); + const data: any = output.body; + contents.responseStream = de_FlowResponseStream(data, context); + return contents; +}; + +/** + * deserializeAws_restJson1InvokeInlineAgentCommand + */ +export const de_InvokeInlineAgentCommand = 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), + [_cT]: [, output.headers[_xabact]], + [_sI]: [, output.headers[_xabasi]], + }); + const data: any = output.body; + contents.completion = de_InlineAgentResponseStream(data, context); return contents; }; /** - * deserializeAws_restJson1GenerateQueryCommand + * deserializeAws_restJson1ListInvocationsCommand */ -export const de_GenerateQueryCommand = async ( +export const de_ListInvocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } @@ -508,19 +1071,20 @@ export const de_GenerateQueryCommand = async ( }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - queries: _json, + invocationSummaries: (_) => de_InvocationSummaries(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetAgentMemoryCommand + * deserializeAws_restJson1ListInvocationStepsCommand */ -export const de_GetAgentMemoryCommand = async ( +export const de_ListInvocationStepsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } @@ -529,7 +1093,7 @@ export const de_GetAgentMemoryCommand = async ( }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - memoryContents: (_) => de_Memories(_, context), + invocationStepSummaries: (_) => de_InvocationStepSummaries(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -537,80 +1101,84 @@ export const de_GetAgentMemoryCommand = async ( }; /** - * deserializeAws_restJson1InvokeAgentCommand + * deserializeAws_restJson1ListSessionsCommand */ -export const de_InvokeAgentCommand = async ( +export const de_ListSessionsCommand = async ( output: __HttpResponse, - context: __SerdeContext & __EventStreamSerdeContext -): Promise => { + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } const contents: any = map({ $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); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sessionSummaries: (_) => de_SessionSummaries(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1InvokeFlowCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_InvokeFlowCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, - context: __SerdeContext & __EventStreamSerdeContext -): Promise => { + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_eI]: [, output.headers[_xabfei]], }); - const data: any = output.body; - contents.responseStream = de_FlowResponseStream(data, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1InvokeInlineAgentCommand + * deserializeAws_restJson1OptimizePromptCommand */ -export const de_InvokeInlineAgentCommand = async ( +export const de_OptimizePromptCommand = async ( output: __HttpResponse, context: __SerdeContext & __EventStreamSerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_cT]: [, output.headers[_xabact]], - [_sI]: [, output.headers[_xabasi]], }); const data: any = output.body; - contents.completion = de_InlineAgentResponseStream(data, context); + contents.optimizedPrompt = de_OptimizedPromptStream(data, context); return contents; }; /** - * deserializeAws_restJson1OptimizePromptCommand + * deserializeAws_restJson1PutInvocationStepCommand */ -export const de_OptimizePromptCommand = async ( +export const de_PutInvocationStepCommand = async ( output: __HttpResponse, - context: __SerdeContext & __EventStreamSerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: any = output.body; - contents.optimizedPrompt = de_OptimizedPromptStream(data, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + invocationStepId: __expectString, + }); + Object.assign(contents, doc); return contents; }; @@ -702,6 +1270,65 @@ export const de_RetrieveAndGenerateStreamCommand = async ( return contents; }; +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateSessionCommand + */ +export const de_UpdateSessionCommand = 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, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionArn: __expectString, + sessionId: __expectString, + sessionStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserialize_Aws_restJson1CommandError */ @@ -715,15 +1342,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "AccessDeniedException": case "com.amazonaws.bedrockagentruntime#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.bedrockagentruntime#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.bedrockagentruntime#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.bedrockagentruntime#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.bedrockagentruntime#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -739,6 +1360,12 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "ValidationException": case "com.amazonaws.bedrockagentruntime#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "BadGatewayException": + case "com.amazonaws.bedrockagentruntime#BadGatewayException": + throw await de_BadGatewayExceptionRes(parsedOutput, context); + case "DependencyFailedException": + case "com.amazonaws.bedrockagentruntime#DependencyFailedException": + throw await de_DependencyFailedExceptionRes(parsedOutput, context); case "ModelNotReadyException": case "com.amazonaws.bedrockagentruntime#ModelNotReadyException": throw await de_ModelNotReadyExceptionRes(parsedOutput, context); @@ -1595,6 +2222,28 @@ const se_BedrockRerankingModelConfiguration = ( }); }; +/** + * serializeAws_restJson1BedrockSessionContentBlock + */ +const se_BedrockSessionContentBlock = (input: BedrockSessionContentBlock, context: __SerdeContext): any => { + return BedrockSessionContentBlock.visit(input, { + image: (value) => ({ image: se_ImageBlock(value, context) }), + text: (value) => ({ text: value }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + +/** + * serializeAws_restJson1BedrockSessionContentBlocks + */ +const se_BedrockSessionContentBlocks = (input: BedrockSessionContentBlock[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_BedrockSessionContentBlock(entry, context); + }); +}; + /** * serializeAws_restJson1ByteContentDoc */ @@ -1766,6 +2415,27 @@ const se_GenerationConfiguration = (input: GenerationConfiguration, context: __S // se_GuardrailConfigurationWithArn omitted. +/** + * serializeAws_restJson1ImageBlock + */ +const se_ImageBlock = (input: ImageBlock, context: __SerdeContext): any => { + return take(input, { + format: [], + source: (_) => se_ImageSource(_, context), + }); +}; + +/** + * serializeAws_restJson1ImageSource + */ +const se_ImageSource = (input: ImageSource, context: __SerdeContext): any => { + return ImageSource.visit(input, { + bytes: (value) => ({ bytes: context.base64Encoder(value) }), + s3Location: (value) => ({ s3Location: _json(value) }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + // se_ImplicitFilterConfiguration omitted. /** @@ -1831,6 +2501,16 @@ const se_InputFiles = (input: InputFile[], context: __SerdeContext): any => { // se_InvocationResultMember omitted. +/** + * serializeAws_restJson1InvocationStepPayload + */ +const se_InvocationStepPayload = (input: InvocationStepPayload, context: __SerdeContext): any => { + return InvocationStepPayload.visit(input, { + contentBlocks: (value) => ({ contentBlocks: se_BedrockSessionContentBlocks(value, context) }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + /** * serializeAws_restJson1KnowledgeBase */ @@ -2101,12 +2781,16 @@ const se_RetrieveAndGenerateConfiguration = (input: RetrieveAndGenerateConfigura // se_S3Identifier omitted. +// se_S3Location omitted. + // se_S3ObjectDoc omitted. // se_S3ObjectFile omitted. // se_SessionAttributesMap omitted. +// se_SessionMetadataMap omitted. + /** * serializeAws_restJson1SessionState */ @@ -2126,6 +2810,8 @@ const se_SessionState = (input: SessionState, context: __SerdeContext): any => { // se_StreamingConfigurations omitted. +// se_TagsMap omitted. + /** * serializeAws_restJson1TextInferenceConfig */ @@ -2240,6 +2926,33 @@ const de_Attribution = (output: any, context: __SerdeContext): Attribution => { }) as any; }; +/** + * deserializeAws_restJson1BedrockSessionContentBlock + */ +const de_BedrockSessionContentBlock = (output: any, context: __SerdeContext): BedrockSessionContentBlock => { + if (output.image != null) { + return { + image: de_ImageBlock(output.image, context), + }; + } + if (__expectString(output.text) !== undefined) { + return { text: __expectString(output.text) as any }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restJson1BedrockSessionContentBlocks + */ +const de_BedrockSessionContentBlocks = (output: any, context: __SerdeContext): BedrockSessionContentBlock[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_BedrockSessionContentBlock(__expectUnion(entry), context); + }); + return retVal; +}; + // de_Caller omitted. // de_CallerChain omitted. @@ -2545,6 +3258,33 @@ const de_FlowTraceNodeOutputFields = (output: any, context: __SerdeContext): Flo // de_GuardrailWordPolicyAssessment omitted. +/** + * deserializeAws_restJson1ImageBlock + */ +const de_ImageBlock = (output: any, context: __SerdeContext): ImageBlock => { + return take(output, { + format: __expectString, + source: (_: any) => de_ImageSource(__expectUnion(_), context), + }) as any; +}; + +/** + * deserializeAws_restJson1ImageSource + */ +const de_ImageSource = (output: any, context: __SerdeContext): ImageSource => { + if (output.bytes != null) { + return { + bytes: context.base64Decoder(output.bytes), + }; + } + if (output.s3Location != null) { + return { + s3Location: _json(output.s3Location), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + /** * deserializeAws_restJson1InferenceConfiguration */ @@ -2597,6 +3337,78 @@ const de_InlineAgentTracePart = (output: any, context: __SerdeContext): InlineAg // de_InvocationResultMember omitted. +/** + * deserializeAws_restJson1InvocationStep + */ +const de_InvocationStep = (output: any, context: __SerdeContext): InvocationStep => { + return take(output, { + invocationId: __expectString, + invocationStepId: __expectString, + invocationStepTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + payload: (_: any) => de_InvocationStepPayload(__expectUnion(_), context), + sessionId: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1InvocationStepPayload + */ +const de_InvocationStepPayload = (output: any, context: __SerdeContext): InvocationStepPayload => { + if (output.contentBlocks != null) { + return { + contentBlocks: de_BedrockSessionContentBlocks(output.contentBlocks, context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restJson1InvocationStepSummaries + */ +const de_InvocationStepSummaries = (output: any, context: __SerdeContext): InvocationStepSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_InvocationStepSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1InvocationStepSummary + */ +const de_InvocationStepSummary = (output: any, context: __SerdeContext): InvocationStepSummary => { + return take(output, { + invocationId: __expectString, + invocationStepId: __expectString, + invocationStepTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionId: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1InvocationSummaries + */ +const de_InvocationSummaries = (output: any, context: __SerdeContext): InvocationSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_InvocationSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1InvocationSummary + */ +const de_InvocationSummary = (output: any, context: __SerdeContext): InvocationSummary => { + return take(output, { + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + invocationId: __expectString, + sessionId: __expectString, + }) as any; +}; + // de_KnowledgeBaseLookupInput omitted. /** @@ -3036,10 +3848,41 @@ const de_RoutingClassifierTrace = (output: any, context: __SerdeContext): Routin return { $unknown: Object.entries(output)[0] }; }; +// de_S3Location omitted. + +// de_SessionMetadataMap omitted. + +/** + * deserializeAws_restJson1SessionSummaries + */ +const de_SessionSummaries = (output: any, context: __SerdeContext): SessionSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_SessionSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1SessionSummary + */ +const de_SessionSummary = (output: any, context: __SerdeContext): SessionSummary => { + return take(output, { + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + sessionArn: __expectString, + sessionId: __expectString, + sessionStatus: __expectString, + }) as any; +}; + // de_Span omitted. // de_StopSequences omitted. +// de_TagsMap omitted. + // de_TextPrompt omitted. // de_TextResponsePart omitted. @@ -3126,10 +3969,12 @@ const _cT = "contentType"; const _eI = "executionId"; const _mI = "memoryId"; const _mIa = "maxItems"; +const _mR = "maxResults"; const _mT = "memoryType"; const _nT = "nextToken"; const _sA = "sourceArn"; const _sI = "sessionId"; +const _tK = "tagKeys"; 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 101dcd8dc3d0..bee2e7432bfb 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json @@ -437,6 +437,12 @@ }, { "target": "com.amazonaws.bedrockagentruntime#RetrieveResource" + }, + { + "target": "com.amazonaws.bedrockagentruntime#SessionResource" + }, + { + "target": "com.amazonaws.bedrockagentruntime#TaggingResource" } ], "traits": { @@ -1460,6 +1466,41 @@ "smithy.api#documentation": "

Contains configurations for a reranker model.

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

The text in the invocation step.

", + "smithy.api#length": { + "min": 1 + } + } + }, + "image": { + "target": "com.amazonaws.bedrockagentruntime#ImageBlock", + "traits": { + "smithy.api#documentation": "

The image in the invocation step.

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

A block of content that you pass to, or receive from, a Amazon Bedrock session in an invocation step. You pass the content to a\n session in the payLoad of the PutInvocationStep API operation.\n You retrieve the content with the GetInvocationStep API operation.

\n

For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#BedrockSessionContentBlocks": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#BedrockSessionContentBlock" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, "com.amazonaws.bedrockagentruntime#ByteContentBlob": { "type": "blob", "traits": { @@ -1760,6 +1801,204 @@ } } }, + "com.amazonaws.bedrockagentruntime#CreateInvocation": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#CreateInvocationRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#CreateInvocationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "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": "

Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from\n a conversation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

\n

Related APIs

\n ", + "smithy.api#http": { + "code": 201, + "method": "PUT", + "uri": "/sessions/{sessionIdentifier}/invocations/" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#CreateInvocationRequest": { + "type": "structure", + "members": { + "invocationId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

A unique identifier for the invocation in UUID format.

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

A description for the interactions in the invocation. For example, \"User asking about weather in Seattle\".

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

The unique identifier for the associated session for the invocation. You can specify either the session's sessionId or its Amazon Resource Name (ARN).\n

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#CreateInvocationResponse": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session associated with the invocation.

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

The unique identifier for the invocation.

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

The timestamp for when the invocation was created.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#CreateSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#CreateSessionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#CreateSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source\n frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of\n conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see\n Store and retrieve conversation history and context with Amazon Bedrock sessions.

\n

By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata,\n or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.

\n \n

\n You use a session to store state and conversation history for generative AI applications built with open-source frameworks. \n For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the \n InvokeAgent API operation.\n

\n
\n

Related APIs:

\n ", + "smithy.api#http": { + "code": 201, + "method": "PUT", + "uri": "/sessions/" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#CreateSessionRequest": { + "type": "structure", + "members": { + "sessionMetadata": { + "target": "com.amazonaws.bedrockagentruntime#SessionMetadataMap", + "traits": { + "smithy.api#documentation": "

A map of key-value pairs containing attributes to be persisted across the session. For example, the user's ID, their language preference, \n and the type of device they are using.

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

The Amazon Resource Name (ARN) of the KMS key to use to encrypt the session data. The user or role creating the session must have permission to use the key.\n For more information, see Amazon Bedrock session encryption.\n

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

Specify the key-value pairs for the tags that you want to attach to the session.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#CreateSessionResponse": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session.

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

The Amazon Resource Name (ARN) of the created session.

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

The current status of the session.

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

The timestamp for when the session was created.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagentruntime#CreationMode": { "type": "enum", "members": { @@ -1923,6 +2162,67 @@ "smithy.api#output": {} } }, + "com.amazonaws.bedrockagentruntime#DeleteSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#DeleteSessionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#DeleteSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a session that you ended. You can't delete a session with an ACTIVE status. To delete an active session, you must first end it with the \n EndSession API operation.\n For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "DELETE", + "uri": "/sessions/{sessionIdentifier}/" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#DeleteSessionRequest": { + "type": "structure", + "members": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session to be deleted. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#DeleteSessionResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagentruntime#DependencyFailedException": { "type": "structure", "members": { @@ -1942,24 +2242,107 @@ "smithy.api#httpError": 424 } }, - "com.amazonaws.bedrockagentruntime#ExecutionType": { - "type": "enum", - "members": { - "LAMBDA": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "LAMBDA" - } + "com.amazonaws.bedrockagentruntime#EndSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#EndSessionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#EndSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" }, - "RETURN_CONTROL": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "RETURN_CONTROL" - } - } - } - }, - "com.amazonaws.bedrockagentruntime#ExternalSource": { + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Ends the session. \n After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation.\n For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "PATCH", + "uri": "/sessions/{sessionIdentifier}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#EndSessionRequest": { + "type": "structure", + "members": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session to end. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#EndSessionResponse": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier of the session you ended.

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

The Amazon Resource Name (ARN) of the session you ended.

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

The current status of the session you ended.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "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": { "sourceType": { @@ -3351,6 +3734,193 @@ "smithy.api#output": {} } }, + "com.amazonaws.bedrockagentruntime#GetInvocationStep": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#GetInvocationStepRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#GetInvocationStepResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves the details of a specific invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/{invocationStepId}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetInvocationStepRequest": { + "type": "structure", + "members": { + "invocationIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#InvocationIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the invocation in UUID format.

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

The unique identifier (in UUID format) for the specific invocation step to retrieve.

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

The unique identifier for the invocation step's associated session. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetInvocationStepResponse": { + "type": "structure", + "members": { + "invocationStep": { + "target": "com.amazonaws.bedrockagentruntime#InvocationStep", + "traits": { + "smithy.api#documentation": "

The complete details of the requested invocation step.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#GetSessionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#GetSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves details about a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/sessions/{sessionIdentifier}/" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetSessionRequest": { + "type": "structure", + "members": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

A unique identifier for the session to retrieve. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#GetSessionResponse": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session in UUID format.

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

The Amazon Resource Name (ARN) of the session.

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

The current status of the session.

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

The timestamp for when the session was created.

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

The timestamp for when the session was last modified.

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

A map of key-value pairs containing attributes persisted across the session.

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

The Amazon Resource Name (ARN) of the Key Management Service key used to encrypt the session data.\n For more information, see Amazon Bedrock session encryption.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagentruntime#GuadrailAction": { "type": "enum", "members": { @@ -4174,67 +4744,141 @@ "smithy.api#sensitive": {} } }, - "com.amazonaws.bedrockagentruntime#ImplicitFilterConfiguration": { + "com.amazonaws.bedrockagentruntime#ImageBlock": { "type": "structure", "members": { - "metadataAttributes": { - "target": "com.amazonaws.bedrockagentruntime#MetadataAttributeSchemaList", + "format": { + "target": "com.amazonaws.bedrockagentruntime#ImageFormat", "traits": { - "smithy.api#documentation": "

Metadata that can be used in a filter.

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

The format of the image.

", "smithy.api#required": {} } }, - "modelArn": { - "target": "com.amazonaws.bedrockagentruntime#BedrockModelArn", + "source": { + "target": "com.amazonaws.bedrockagentruntime#ImageSource", "traits": { - "smithy.api#documentation": "

The model that generates the filter.

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

The source for the image.

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

Settings for implicit filtering, where a model generates a metadata filter based on the prompt.

" - } - }, - "com.amazonaws.bedrockagentruntime#InferenceConfig": { - "type": "structure", - "members": { - "textInferenceConfig": { - "target": "com.amazonaws.bedrockagentruntime#TextInferenceConfig", - "traits": { - "smithy.api#documentation": "

Configuration settings specific to text generation while generating responses using RetrieveAndGenerate.

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

The configuration for inference settings when generating responses using RetrieveAndGenerate.

" + "smithy.api#documentation": "

Image content for an invocation step.

" } }, - "com.amazonaws.bedrockagentruntime#InferenceConfiguration": { - "type": "structure", + "com.amazonaws.bedrockagentruntime#ImageFormat": { + "type": "enum", "members": { - "temperature": { - "target": "com.amazonaws.bedrockagentruntime#Temperature", + "PNG": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

" + "smithy.api#enumValue": "png" } }, - "topP": { - "target": "com.amazonaws.bedrockagentruntime#TopP", + "JPEG": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 0.8, the model only selects the next token from the top 80% of the probability distribution of next tokens.

" + "smithy.api#enumValue": "jpeg" } }, - "topK": { - "target": "com.amazonaws.bedrockagentruntime#TopK", + "GIF": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

" + "smithy.api#enumValue": "gif" } }, - "maximumLength": { - "target": "com.amazonaws.bedrockagentruntime#MaximumLength", + "WEBP": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The maximum number of tokens allowed in the generated response.

" + "smithy.api#enumValue": "webp" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#ImageSource": { + "type": "union", + "members": { + "bytes": { + "target": "smithy.api#Blob", + "traits": { + "smithy.api#documentation": "

The raw image bytes for the image. If you use an Amazon Web Services SDK, you don't need to encode the image bytes in base64.

", + "smithy.api#length": { + "min": 1 + } + } + }, + "s3Location": { + "target": "com.amazonaws.bedrockagentruntime#S3Location", + "traits": { + "smithy.api#documentation": "

The path to the Amazon S3 bucket where the image is stored.

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

The source for an image.

" + } + }, + "com.amazonaws.bedrockagentruntime#ImplicitFilterConfiguration": { + "type": "structure", + "members": { + "metadataAttributes": { + "target": "com.amazonaws.bedrockagentruntime#MetadataAttributeSchemaList", + "traits": { + "smithy.api#documentation": "

Metadata that can be used in a filter.

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

The model that generates the filter.

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

Settings for implicit filtering, where a model generates a metadata filter based on the prompt.

" + } + }, + "com.amazonaws.bedrockagentruntime#InferenceConfig": { + "type": "structure", + "members": { + "textInferenceConfig": { + "target": "com.amazonaws.bedrockagentruntime#TextInferenceConfig", + "traits": { + "smithy.api#documentation": "

Configuration settings specific to text generation while generating responses using RetrieveAndGenerate.

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

The configuration for inference settings when generating responses using RetrieveAndGenerate.

" + } + }, + "com.amazonaws.bedrockagentruntime#InferenceConfiguration": { + "type": "structure", + "members": { + "temperature": { + "target": "com.amazonaws.bedrockagentruntime#Temperature", + "traits": { + "smithy.api#documentation": "

The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.

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

While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for Top P determines the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topP to 0.8, the model only selects the next token from the top 80% of the probability distribution of next tokens.

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

While generating a response, the model determines the probability of the following token at each point of generation. The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.

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

The maximum number of tokens allowed in the generated response.

" } }, "stopSequences": { @@ -4577,6 +5221,21 @@ "smithy.api#httpError": 500 } }, + "com.amazonaws.bedrockagentruntime#InvocationDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + } + } + }, + "com.amazonaws.bedrockagentruntime#InvocationIdentifier": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + } + }, "com.amazonaws.bedrockagentruntime#InvocationInput": { "type": "structure", "members": { @@ -4654,6 +5313,23 @@ } } }, + "com.amazonaws.bedrockagentruntime#InvocationResource": { + "type": "resource", + "identifiers": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier" + }, + "invocationIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#InvocationIdentifier" + } + }, + "create": { + "target": "com.amazonaws.bedrockagentruntime#CreateInvocation" + }, + "list": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocations" + } + }, "com.amazonaws.bedrockagentruntime#InvocationResultMember": { "type": "union", "members": { @@ -4674,6 +5350,163 @@ "smithy.api#documentation": "

A result from the invocation of an action. For more information, see Return control to the agent developer and Control session context.

\n

This data type is used in the following API operations:

\n " } }, + "com.amazonaws.bedrockagentruntime#InvocationStep": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier of the session containing the invocation step.

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

The unique identifier (in UUID format) for the invocation that includes the invocation step.

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

The unique identifier (in UUID format) for the invocation step.

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

The timestamp for when the invocation step was created.

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

Payload content, such as text and images, for the invocation step.

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

Stores fine-grained state checkpoints, including text and images, for each interaction in an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationStepPayload": { + "type": "union", + "members": { + "contentBlocks": { + "target": "com.amazonaws.bedrockagentruntime#BedrockSessionContentBlocks", + "traits": { + "smithy.api#documentation": "

The content for the invocation step.

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

Payload content, such as text and images, for the invocation step.

" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationStepResource": { + "type": "resource", + "identifiers": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier" + }, + "invocationIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#InvocationIdentifier" + }, + "invocationStepId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid" + } + }, + "create": { + "target": "com.amazonaws.bedrockagentruntime#PutInvocationStep" + }, + "read": { + "target": "com.amazonaws.bedrockagentruntime#GetInvocationStep" + }, + "list": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocationSteps" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationStepSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#InvocationStepSummary" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationStepSummary": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session associated with the invocation step.

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

A unique identifier for the invocation in UUID format.

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

The unique identifier (in UUID format) for the invocation step.

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

The timestamp for when the invocation step was created.

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

Contains details about an invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#InvocationSummary" + } + }, + "com.amazonaws.bedrockagentruntime#InvocationSummary": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session associated with the invocation.

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

A unique identifier for the invocation in UUID format.

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

The timestamp for when the invocation was created.

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

Contains details about an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

" + } + }, "com.amazonaws.bedrockagentruntime#InvocationType": { "type": "enum", "members": { @@ -5483,32 +6316,371 @@ "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_\\.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$" } }, - "com.amazonaws.bedrockagentruntime#MaxResults": { - "type": "integer", - "traits": { - "smithy.api#documentation": "Max Results.", - "smithy.api#range": { - "min": 1, - "max": 1000 + "com.amazonaws.bedrockagentruntime#ListInvocationSteps": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocationStepsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocationStepsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" } - } - }, - "com.amazonaws.bedrockagentruntime#MaxTokens": { - "type": "integer", + ], "traits": { - "smithy.api#range": { - "min": 0, - "max": 65536 - } + "smithy.api#documentation": "

Lists all invocation steps associated with a session and optionally, an invocation within the session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "invocationStepSummaries" + }, + "smithy.api#readonly": {} } }, - "com.amazonaws.bedrockagentruntime#MaximumLength": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 0, - "max": 8192 - } + "com.amazonaws.bedrockagentruntime#ListInvocationStepsRequest": { + "type": "structure", + "members": { + "invocationIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#InvocationIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier (in UUID format) for the invocation to list invocation steps for.

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

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

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

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

", + "smithy.api#httpQuery": "maxResults" + } + }, + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session associated with the invocation steps. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListInvocationStepsResponse": { + "type": "structure", + "members": { + "invocationStepSummaries": { + "target": "com.amazonaws.bedrockagentruntime#InvocationStepSummaries", + "traits": { + "smithy.api#documentation": "

A list of summaries for each invocation step associated with a session and if you specified it, an invocation within the session.

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

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

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListInvocations": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocationsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#ListInvocationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all invocations associated with a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocations/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "invocationSummaries" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListInvocationsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.bedrockagentruntime#NextToken", + "traits": { + "smithy.api#documentation": "

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

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

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

", + "smithy.api#httpQuery": "maxResults" + } + }, + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session to list invocations for. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListInvocationsResponse": { + "type": "structure", + "members": { + "invocationSummaries": { + "target": "com.amazonaws.bedrockagentruntime#InvocationSummaries", + "traits": { + "smithy.api#documentation": "

A list of invocation summaries associated with the session.

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

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

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListSessions": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#ListSessionsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#ListSessionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all sessions in your Amazon Web Services account. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/sessions/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "sessionSummaries" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListSessionsRequest": { + "type": "structure", + "members": { + "maxResults": { + "target": "com.amazonaws.bedrockagentruntime#MaxResults", + "traits": { + "smithy.api#default": 10, + "smithy.api#documentation": "

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

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

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

", + "smithy.api#httpQuery": "nextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListSessionsResponse": { + "type": "structure", + "members": { + "sessionSummaries": { + "target": "com.amazonaws.bedrockagentruntime#SessionSummaries", + "traits": { + "smithy.api#documentation": "

A list of summaries for each session in your Amazon Web Services account.

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

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

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List all the tags for the resource you specify.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/tags/{resourceArn}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagentruntime#TaggableResourcesArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource for which to list tags.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.bedrockagentruntime#TagsMap", + "traits": { + "smithy.api#documentation": "

The key-value pairs for the tags associated with the resource.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "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": 8192 + } } }, "com.amazonaws.bedrockagentruntime#Memories": { @@ -6831,7 +8003,106 @@ "smithy.api#documentation": "

Contains the parameters in the request body.

" } }, - "com.amazonaws.bedrockagentruntime#QueryGenerationInput": { + "com.amazonaws.bedrockagentruntime#PutInvocationStep": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#PutInvocationStepRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#PutInvocationStepResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "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": "

Add an invocation step to an invocation in a session. An invocation step stores fine-grained state checkpoints, including text and images, for each interaction. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

\n

Related APIs:

\n ", + "smithy.api#http": { + "code": 201, + "method": "PUT", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#PutInvocationStepRequest": { + "type": "structure", + "members": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session to add the invocation step to. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

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

The unique identifier (in UUID format) of the invocation to add the invocation step to.

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

The timestamp for when the invocation step occurred.

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

The payload for the invocation step, including text and images for the interaction.

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

The unique identifier of the invocation step in UUID format.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#PutInvocationStepResponse": { + "type": "structure", + "members": { + "invocationStepId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier of the invocation step in UUID format.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#QueryGenerationInput": { "type": "structure", "members": { "type": { @@ -7351,7 +8622,7 @@ "smithy.api#documentation": "

The text of the document.

", "smithy.api#length": { "min": 1, - "max": 9000 + "max": 32000 } } } @@ -8174,7 +9445,7 @@ "type": { "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateType", "traits": { - "smithy.api#documentation": "

The type of resource that contains your data for retrieving information and generating responses.

\n

If you choose ot use EXTERNAL_SOURCES, then currently only Claude 3 Sonnet models for knowledge bases are supported.

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

The type of resource that contains your data for retrieving information and generating responses.

\n

If you choose to use EXTERNAL_SOURCES, then currently only Anthropic Claude 3 Sonnet models for knowledge bases are supported.

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

\n The identifier information for an Amazon S3 bucket.\n

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

The path to the Amazon S3 bucket where the image is stored.

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

Information about the Amazon S3 bucket where the image is stored.

" + } + }, "com.amazonaws.bedrockagentruntime#S3ObjectDoc": { "type": "structure", "members": { @@ -8876,6 +10162,12 @@ "smithy.api#httpError": 400 } }, + "com.amazonaws.bedrockagentruntime#SessionArn": { + "type": "string", + "traits": { + "smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]+:[0-9]{12}:session/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + } + }, "com.amazonaws.bedrockagentruntime#SessionAttributesMap": { "type": "map", "key": { @@ -8895,6 +10187,81 @@ "smithy.api#pattern": "^[0-9a-zA-Z._:-]+$" } }, + "com.amazonaws.bedrockagentruntime#SessionIdentifier": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]+:[0-9]{12}:session/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$" + } + }, + "com.amazonaws.bedrockagentruntime#SessionMetadataKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.bedrockagentruntime#SessionMetadataMap": { + "type": "map", + "key": { + "target": "com.amazonaws.bedrockagentruntime#SessionMetadataKey" + }, + "value": { + "target": "com.amazonaws.bedrockagentruntime#SessionMetadataValue" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 50 + } + } + }, + "com.amazonaws.bedrockagentruntime#SessionMetadataValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 5000 + } + } + }, + "com.amazonaws.bedrockagentruntime#SessionResource": { + "type": "resource", + "identifiers": { + "sessionIdentifier": { + "target": "com.amazonaws.bedrockagentruntime#SessionIdentifier" + } + }, + "create": { + "target": "com.amazonaws.bedrockagentruntime#CreateSession" + }, + "read": { + "target": "com.amazonaws.bedrockagentruntime#GetSession" + }, + "update": { + "target": "com.amazonaws.bedrockagentruntime#UpdateSession" + }, + "delete": { + "target": "com.amazonaws.bedrockagentruntime#DeleteSession" + }, + "list": { + "target": "com.amazonaws.bedrockagentruntime#ListSessions" + }, + "operations": [ + { + "target": "com.amazonaws.bedrockagentruntime#EndSession" + } + ], + "resources": [ + { + "target": "com.amazonaws.bedrockagentruntime#InvocationResource" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InvocationStepResource" + } + ] + }, "com.amazonaws.bedrockagentruntime#SessionState": { "type": "structure", "members": { @@ -8945,6 +10312,78 @@ "smithy.api#documentation": "

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.

" } }, + "com.amazonaws.bedrockagentruntime#SessionStatus": { + "type": "enum", + "members": { + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "EXPIRED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPIRED" + } + }, + "ENDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENDED" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#SessionSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#SessionSummary" + } + }, + "com.amazonaws.bedrockagentruntime#SessionSummary": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier for the session.

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

The Amazon Resource Name (ARN) of the session.

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

The current status of the session.

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

The timestamp for when the session was created.

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

The timestamp for when the session was last modified.

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

Contains details about a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

" + } + }, "com.amazonaws.bedrockagentruntime#SessionTTL": { "type": "integer", "traits": { @@ -9051,6 +10490,149 @@ } } }, + "com.amazonaws.bedrockagentruntime#TagKey": { + "type": "string", + "traits": { + "smithy.api#documentation": "Key of a tag", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, + "com.amazonaws.bedrockagentruntime#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagentruntime#TagKey" + }, + "traits": { + "smithy.api#documentation": "List of Tag Keys", + "smithy.api#length": { + "min": 1, + "max": 200 + } + } + }, + "com.amazonaws.bedrockagentruntime#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "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": "

Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/tags/{resourceArn}" + } + } + }, + "com.amazonaws.bedrockagentruntime#TagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagentruntime#TaggableResourcesArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource to tag.

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

An object containing key-value pairs that define the tags to attach to the resource.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#TagValue": { + "type": "string", + "traits": { + "smithy.api#documentation": "Value of a tag", + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, + "com.amazonaws.bedrockagentruntime#TaggableResourcesArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of Taggable resources: [session]", + "smithy.api#length": { + "min": 20, + "max": 1011 + }, + "smithy.api#pattern": "(^arn:aws(-[^:]+)?:bedrock:[a-zA-Z0-9-]+:[0-9]{12}:(session)/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$)" + } + }, + "com.amazonaws.bedrockagentruntime#TaggingResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagentruntime#ListTagsForResource" + }, + { + "target": "com.amazonaws.bedrockagentruntime#TagResource" + }, + { + "target": "com.amazonaws.bedrockagentruntime#UntagResource" + } + ] + }, + "com.amazonaws.bedrockagentruntime#TagsMap": { + "type": "map", + "key": { + "target": "com.amazonaws.bedrockagentruntime#TagKey" + }, + "value": { + "target": "com.amazonaws.bedrockagentruntime#TagValue" + }, + "traits": { + "smithy.api#documentation": "A map of tag keys and values", + "smithy.api#length": { + "min": 1, + "max": 200 + } + } + }, "com.amazonaws.bedrockagentruntime#Temperature": { "type": "float", "traits": { @@ -9400,6 +10982,175 @@ } } }, + "com.amazonaws.bedrockagentruntime#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Remove tags from a resource.

", + "smithy.api#http": { + "code": 200, + "method": "DELETE", + "uri": "/tags/{resourceArn}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#UntagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagentruntime#TaggableResourcesArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource from which to remove tags.

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

A list of keys of the tags to remove from the resource.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#UpdateSession": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagentruntime#UpdateSessionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagentruntime#UpdateSessionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagentruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the metadata or encryption settings of a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.

", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/sessions/{sessionIdentifier}/" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagentruntime#UpdateSessionRequest": { + "type": "structure", + "members": { + "sessionMetadata": { + "target": "com.amazonaws.bedrockagentruntime#SessionMetadataMap", + "traits": { + "smithy.api#documentation": "

A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, \n and the type of device they are using.

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

The unique identifier of the session to modify. You can specify either the session's sessionId or its Amazon Resource Name (ARN).

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#UpdateSessionResponse": { + "type": "structure", + "members": { + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#Uuid", + "traits": { + "smithy.api#documentation": "

The unique identifier of the session you updated.

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

The Amazon Resource Name (ARN) of the session that was updated.

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

The status of the session you updated.

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

The timestamp for when the session was created.

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

The timestamp for when the session was last modified.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagentruntime#Usage": { "type": "structure", "members": { @@ -9421,6 +11172,12 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#Uuid": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + } + }, "com.amazonaws.bedrockagentruntime#ValidationException": { "type": "structure", "members": {