Skip to content

Commit

Permalink
feat(client-bedrock-agent-runtime): Introduces query decomposition, e…
Browse files Browse the repository at this point in the history
…nhanced Agents integration with Knowledge bases, session summary generation, and code interpretation (preview) for Claude V3 Sonnet and Haiku models. Also introduces Prompt Flows (preview) to link prompts, foundational models, and resources for end-to-end solutions.
  • Loading branch information
awstools committed Jul 10, 2024
1 parent 427a732 commit f2f40c1
Show file tree
Hide file tree
Showing 15 changed files with 4,023 additions and 343 deletions.
24 changes: 24 additions & 0 deletions clients/client-bedrock-agent-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,37 @@ see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
DeleteAgentMemory
</summary>

[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/)

</details>
<details>
<summary>
GetAgentMemory
</summary>

[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/)

</details>
<details>
<summary>
InvokeAgent
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/InvokeAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeAgentCommandOutput/)

</details>
<details>
<summary>
InvokeFlow
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent-runtime/command/InvokeFlowCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeFlowCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent-runtime/Interface/InvokeFlowCommandOutput/)

</details>
<details>
<summary>
Expand Down
56 changes: 56 additions & 0 deletions clients/client-bedrock-agent-runtime/src/BedrockAgentRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import { BedrockAgentRuntimeClient, BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient";
import {
DeleteAgentMemoryCommand,
DeleteAgentMemoryCommandInput,
DeleteAgentMemoryCommandOutput,
} from "./commands/DeleteAgentMemoryCommand";
import {
GetAgentMemoryCommand,
GetAgentMemoryCommandInput,
GetAgentMemoryCommandOutput,
} from "./commands/GetAgentMemoryCommand";
import { InvokeAgentCommand, InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand";
import { InvokeFlowCommand, InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
import {
RetrieveAndGenerateCommand,
RetrieveAndGenerateCommandInput,
Expand All @@ -12,12 +23,46 @@ import {
import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";

const commands = {
DeleteAgentMemoryCommand,
GetAgentMemoryCommand,
InvokeAgentCommand,
InvokeFlowCommand,
RetrieveCommand,
RetrieveAndGenerateCommand,
};

export interface BedrockAgentRuntime {
/**
* @see {@link DeleteAgentMemoryCommand}
*/
deleteAgentMemory(
args: DeleteAgentMemoryCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteAgentMemoryCommandOutput>;
deleteAgentMemory(
args: DeleteAgentMemoryCommandInput,
cb: (err: any, data?: DeleteAgentMemoryCommandOutput) => void
): void;
deleteAgentMemory(
args: DeleteAgentMemoryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteAgentMemoryCommandOutput) => void
): void;

/**
* @see {@link GetAgentMemoryCommand}
*/
getAgentMemory(
args: GetAgentMemoryCommandInput,
options?: __HttpHandlerOptions
): Promise<GetAgentMemoryCommandOutput>;
getAgentMemory(args: GetAgentMemoryCommandInput, cb: (err: any, data?: GetAgentMemoryCommandOutput) => void): void;
getAgentMemory(
args: GetAgentMemoryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetAgentMemoryCommandOutput) => void
): void;

/**
* @see {@link InvokeAgentCommand}
*/
Expand All @@ -29,6 +74,17 @@ export interface BedrockAgentRuntime {
cb: (err: any, data?: InvokeAgentCommandOutput) => void
): void;

/**
* @see {@link InvokeFlowCommand}
*/
invokeFlow(args: InvokeFlowCommandInput, options?: __HttpHandlerOptions): Promise<InvokeFlowCommandOutput>;
invokeFlow(args: InvokeFlowCommandInput, cb: (err: any, data?: InvokeFlowCommandOutput) => void): void;
invokeFlow(
args: InvokeFlowCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: InvokeFlowCommandOutput) => void
): void;

/**
* @see {@link RetrieveCommand}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from "./commands/DeleteAgentMemoryCommand";
import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "./commands/GetAgentMemoryCommand";
import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "./commands/InvokeAgentCommand";
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "./commands/InvokeFlowCommand";
import {
RetrieveAndGenerateCommandInput,
RetrieveAndGenerateCommandOutput,
Expand All @@ -79,12 +82,24 @@ export { __Client };
/**
* @public
*/
export type ServiceInputTypes = InvokeAgentCommandInput | RetrieveAndGenerateCommandInput | RetrieveCommandInput;
export type ServiceInputTypes =
| DeleteAgentMemoryCommandInput
| GetAgentMemoryCommandInput
| InvokeAgentCommandInput
| InvokeFlowCommandInput
| RetrieveAndGenerateCommandInput
| RetrieveCommandInput;

/**
* @public
*/
export type ServiceOutputTypes = InvokeAgentCommandOutput | RetrieveAndGenerateCommandOutput | RetrieveCommandOutput;
export type ServiceOutputTypes =
| DeleteAgentMemoryCommandOutput
| GetAgentMemoryCommandOutput
| InvokeAgentCommandOutput
| InvokeFlowCommandOutput
| RetrieveAndGenerateCommandOutput
| RetrieveCommandOutput;

/**
* @public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import {
BedrockAgentRuntimeClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../BedrockAgentRuntimeClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { DeleteAgentMemoryRequest, DeleteAgentMemoryResponse } from "../models/models_0";
import { de_DeleteAgentMemoryCommand, se_DeleteAgentMemoryCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link DeleteAgentMemoryCommand}.
*/
export interface DeleteAgentMemoryCommandInput extends DeleteAgentMemoryRequest {}
/**
* @public
*
* The output of {@link DeleteAgentMemoryCommand}.
*/
export interface DeleteAgentMemoryCommandOutput extends DeleteAgentMemoryResponse, __MetadataBearer {}

/**
* <p>Deletes memory from the specified memory identifier.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { BedrockAgentRuntimeClient, DeleteAgentMemoryCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
* // const { BedrockAgentRuntimeClient, DeleteAgentMemoryCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
* const client = new BedrockAgentRuntimeClient(config);
* const input = { // DeleteAgentMemoryRequest
* agentId: "STRING_VALUE", // required
* agentAliasId: "STRING_VALUE", // required
* memoryId: "STRING_VALUE",
* };
* const command = new DeleteAgentMemoryCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param DeleteAgentMemoryCommandInput - {@link DeleteAgentMemoryCommandInput}
* @returns {@link DeleteAgentMemoryCommandOutput}
* @see {@link DeleteAgentMemoryCommandInput} for command's `input` shape.
* @see {@link DeleteAgentMemoryCommandOutput} for command's `response` shape.
* @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
*
* @throws {@link BadGatewayException} (server fault)
* <p>There was an issue with a dependency due to a server issue. Retry your request.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>There was a conflict performing an operation. Resolve the conflict and retry your request.</p>
*
* @throws {@link DependencyFailedException} (client fault)
* <p>There was an issue with a dependency. Check the resource configurations and retry the request.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An internal server error occurred. Retry your request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>Input validation failed. Check your request parameters and retry the request.</p>
*
* @throws {@link BedrockAgentRuntimeServiceException}
* <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
*
* @public
*/
export class DeleteAgentMemoryCommand extends $Command
.classBuilder<
DeleteAgentMemoryCommandInput,
DeleteAgentMemoryCommandOutput,
BedrockAgentRuntimeClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: BedrockAgentRuntimeClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonBedrockAgentRunTimeService", "DeleteAgentMemory", {})
.n("BedrockAgentRuntimeClient", "DeleteAgentMemoryCommand")
.f(void 0, void 0)
.ser(se_DeleteAgentMemoryCommand)
.de(de_DeleteAgentMemoryCommand)
.build() {}
Loading

0 comments on commit f2f40c1

Please sign in to comment.