Skip to content

Commit 9f83f11

Browse files
author
awstools
committed
feat(client-bedrock-agent): Custom Orchestration API release for AWSBedrockAgents.
1 parent c7fdd8b commit 9f83f11

File tree

9 files changed

+286
-35
lines changed

9 files changed

+286
-35
lines changed

clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
7777
* instruction: "STRING_VALUE",
7878
* foundationModel: "STRING_VALUE",
7979
* description: "STRING_VALUE",
80+
* orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
81+
* customOrchestration: { // CustomOrchestration
82+
* executor: { // OrchestrationExecutor Union: only one key present
83+
* lambda: "STRING_VALUE",
84+
* },
85+
* },
8086
* idleSessionTTLInSeconds: Number("int"),
8187
* agentResourceRoleArn: "STRING_VALUE",
8288
* customerEncryptionKeyArn: "STRING_VALUE",
@@ -128,6 +134,12 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
128134
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
129135
* // foundationModel: "STRING_VALUE",
130136
* // description: "STRING_VALUE",
137+
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
138+
* // customOrchestration: { // CustomOrchestration
139+
* // executor: { // OrchestrationExecutor Union: only one key present
140+
* // lambda: "STRING_VALUE",
141+
* // },
142+
* // },
131143
* // idleSessionTTLInSeconds: Number("int"), // required
132144
* // agentResourceRoleArn: "STRING_VALUE", // required
133145
* // customerEncryptionKeyArn: "STRING_VALUE",

clients/client-bedrock-agent/src/commands/GetAgentCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export interface GetAgentCommandOutput extends GetAgentResponse, __MetadataBeare
5151
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
5252
* // foundationModel: "STRING_VALUE",
5353
* // description: "STRING_VALUE",
54+
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
55+
* // customOrchestration: { // CustomOrchestration
56+
* // executor: { // OrchestrationExecutor Union: only one key present
57+
* // lambda: "STRING_VALUE",
58+
* // },
59+
* // },
5460
* // idleSessionTTLInSeconds: Number("int"), // required
5561
* // agentResourceRoleArn: "STRING_VALUE", // required
5662
* // customerEncryptionKeyArn: "STRING_VALUE",

clients/client-bedrock-agent/src/commands/GetAgentKnowledgeBaseCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { GetAgentKnowledgeBaseRequest, GetAgentKnowledgeBaseResponse } from "../models/models_0";
9+
import { GetAgentKnowledgeBaseRequest } from "../models/models_0";
10+
import { GetAgentKnowledgeBaseResponse } from "../models/models_1";
1011
import { de_GetAgentKnowledgeBaseCommand, se_GetAgentKnowledgeBaseCommand } from "../protocols/Aws_restJson1";
1112

1213
/**

clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { GetKnowledgeBaseRequest, GetKnowledgeBaseResponse } from "../models/models_0";
9+
import { GetKnowledgeBaseRequest, GetKnowledgeBaseResponse } from "../models/models_1";
1010
import { de_GetKnowledgeBaseCommand, se_GetKnowledgeBaseCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
4646
* instruction: "STRING_VALUE",
4747
* foundationModel: "STRING_VALUE", // required
4848
* description: "STRING_VALUE",
49+
* orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
50+
* customOrchestration: { // CustomOrchestration
51+
* executor: { // OrchestrationExecutor Union: only one key present
52+
* lambda: "STRING_VALUE",
53+
* },
54+
* },
4955
* idleSessionTTLInSeconds: Number("int"),
5056
* agentResourceRoleArn: "STRING_VALUE", // required
5157
* customerEncryptionKeyArn: "STRING_VALUE",
@@ -94,6 +100,12 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
94100
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
95101
* // foundationModel: "STRING_VALUE",
96102
* // description: "STRING_VALUE",
103+
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
104+
* // customOrchestration: { // CustomOrchestration
105+
* // executor: { // OrchestrationExecutor Union: only one key present
106+
* // lambda: "STRING_VALUE",
107+
* // },
108+
* // },
97109
* // idleSessionTTLInSeconds: Number("int"), // required
98110
* // agentResourceRoleArn: "STRING_VALUE", // required
99111
* // customerEncryptionKeyArn: "STRING_VALUE",

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

Lines changed: 123 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,64 @@ export const AgentStatus = {
957957
*/
958958
export type AgentStatus = (typeof AgentStatus)[keyof typeof AgentStatus];
959959

960+
/**
961+
* <p>
962+
* Contains details about the Lambda function containing the orchestration logic carried out upon invoking the custom orchestration.
963+
* </p>
964+
* @public
965+
*/
966+
export type OrchestrationExecutor = OrchestrationExecutor.LambdaMember | OrchestrationExecutor.$UnknownMember;
967+
968+
/**
969+
* @public
970+
*/
971+
export namespace OrchestrationExecutor {
972+
/**
973+
* <p>
974+
* The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
975+
* </p>
976+
* @public
977+
*/
978+
export interface LambdaMember {
979+
lambda: string;
980+
$unknown?: never;
981+
}
982+
983+
/**
984+
* @public
985+
*/
986+
export interface $UnknownMember {
987+
lambda?: never;
988+
$unknown: [string, any];
989+
}
990+
991+
export interface Visitor<T> {
992+
lambda: (value: string) => T;
993+
_: (name: string, value: any) => T;
994+
}
995+
996+
export const visit = <T>(value: OrchestrationExecutor, visitor: Visitor<T>): T => {
997+
if (value.lambda !== undefined) return visitor.lambda(value.lambda);
998+
return visitor._(value.$unknown[0], value.$unknown[1]);
999+
};
1000+
}
1001+
1002+
/**
1003+
* <p>
1004+
* Details of custom orchestration.
1005+
* </p>
1006+
* @public
1007+
*/
1008+
export interface CustomOrchestration {
1009+
/**
1010+
* <p>
1011+
* The structure of the executor invoking the actions in custom orchestration.
1012+
* </p>
1013+
* @public
1014+
*/
1015+
executor?: OrchestrationExecutor | undefined;
1016+
}
1017+
9601018
/**
9611019
* <p>Details about a guardrail associated with a resource.</p>
9621020
* @public
@@ -1006,6 +1064,20 @@ export interface MemoryConfiguration {
10061064
storageDays?: number | undefined;
10071065
}
10081066

1067+
/**
1068+
* @public
1069+
* @enum
1070+
*/
1071+
export const OrchestrationType = {
1072+
CUSTOM_ORCHESTRATION: "CUSTOM_ORCHESTRATION",
1073+
DEFAULT: "DEFAULT",
1074+
} as const;
1075+
1076+
/**
1077+
* @public
1078+
*/
1079+
export type OrchestrationType = (typeof OrchestrationType)[keyof typeof OrchestrationType];
1080+
10091081
/**
10101082
* <p>Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the <code>promptType</code>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
10111083
* @public
@@ -1251,6 +1323,22 @@ export interface Agent {
12511323
*/
12521324
description?: string | undefined;
12531325

1326+
/**
1327+
* <p>
1328+
* Specifies the orchestration strategy for the agent.
1329+
* </p>
1330+
* @public
1331+
*/
1332+
orchestrationType?: OrchestrationType | undefined;
1333+
1334+
/**
1335+
* <p>
1336+
* Contains custom orchestration configurations for the agent.
1337+
* </p>
1338+
* @public
1339+
*/
1340+
customOrchestration?: CustomOrchestration | undefined;
1341+
12541342
/**
12551343
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
12561344
* <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
@@ -1679,6 +1767,22 @@ export interface CreateAgentRequest {
16791767
*/
16801768
description?: string | undefined;
16811769

1770+
/**
1771+
* <p>
1772+
* Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.
1773+
* </p>
1774+
* @public
1775+
*/
1776+
orchestrationType?: OrchestrationType | undefined;
1777+
1778+
/**
1779+
* <p>
1780+
* Contains details of the custom orchestration configured for the agent.
1781+
* </p>
1782+
* @public
1783+
*/
1784+
customOrchestration?: CustomOrchestration | undefined;
1785+
16821786
/**
16831787
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
16841788
* <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
@@ -1964,6 +2068,22 @@ export interface UpdateAgentRequest {
19642068
*/
19652069
description?: string | undefined;
19662070

2071+
/**
2072+
* <p>
2073+
* Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.
2074+
* </p>
2075+
* @public
2076+
*/
2077+
orchestrationType?: OrchestrationType | undefined;
2078+
2079+
/**
2080+
* <p>
2081+
* Contains details of the custom orchestration configured for the agent.
2082+
* </p>
2083+
* @public
2084+
*/
2085+
customOrchestration?: CustomOrchestration | undefined;
2086+
19672087
/**
19682088
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
19692089
* <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
@@ -9029,39 +9149,6 @@ export interface GetAgentKnowledgeBaseRequest {
90299149
knowledgeBaseId: string | undefined;
90309150
}
90319151

9032-
/**
9033-
* @public
9034-
*/
9035-
export interface GetAgentKnowledgeBaseResponse {
9036-
/**
9037-
* <p>Contains details about a knowledge base attached to an agent.</p>
9038-
* @public
9039-
*/
9040-
agentKnowledgeBase: AgentKnowledgeBase | undefined;
9041-
}
9042-
9043-
/**
9044-
* @public
9045-
*/
9046-
export interface GetKnowledgeBaseRequest {
9047-
/**
9048-
* <p>The unique identifier of the knowledge base you want to get information on.</p>
9049-
* @public
9050-
*/
9051-
knowledgeBaseId: string | undefined;
9052-
}
9053-
9054-
/**
9055-
* @public
9056-
*/
9057-
export interface GetKnowledgeBaseResponse {
9058-
/**
9059-
* <p>Contains details about the knowledge base.</p>
9060-
* @public
9061-
*/
9062-
knowledgeBase: KnowledgeBase | undefined;
9063-
}
9064-
90659152
/**
90669153
* @internal
90679154
*/
@@ -9149,6 +9236,7 @@ export const PromptOverrideConfigurationFilterSensitiveLog = (obj: PromptOverrid
91499236
export const AgentFilterSensitiveLog = (obj: Agent): any => ({
91509237
...obj,
91519238
...(obj.instruction && { instruction: SENSITIVE_STRING }),
9239+
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
91529240
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
91539241
});
91549242

@@ -9158,6 +9246,7 @@ export const AgentFilterSensitiveLog = (obj: Agent): any => ({
91589246
export const CreateAgentRequestFilterSensitiveLog = (obj: CreateAgentRequest): any => ({
91599247
...obj,
91609248
...(obj.instruction && { instruction: SENSITIVE_STRING }),
9249+
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
91619250
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
91629251
});
91639252

@@ -9183,6 +9272,7 @@ export const GetAgentResponseFilterSensitiveLog = (obj: GetAgentResponse): any =
91839272
export const UpdateAgentRequestFilterSensitiveLog = (obj: UpdateAgentRequest): any => ({
91849273
...obj,
91859274
...(obj.instruction && { instruction: SENSITIVE_STRING }),
9275+
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
91869276
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
91879277
});
91889278

clients/client-bedrock-agent/src/models/models_1.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,39 @@ import {
2424
StorageConfiguration,
2525
} from "./models_0";
2626

27+
/**
28+
* @public
29+
*/
30+
export interface GetAgentKnowledgeBaseResponse {
31+
/**
32+
* <p>Contains details about a knowledge base attached to an agent.</p>
33+
* @public
34+
*/
35+
agentKnowledgeBase: AgentKnowledgeBase | undefined;
36+
}
37+
38+
/**
39+
* @public
40+
*/
41+
export interface GetKnowledgeBaseRequest {
42+
/**
43+
* <p>The unique identifier of the knowledge base you want to get information on.</p>
44+
* @public
45+
*/
46+
knowledgeBaseId: string | undefined;
47+
}
48+
49+
/**
50+
* @public
51+
*/
52+
export interface GetKnowledgeBaseResponse {
53+
/**
54+
* <p>Contains details about the knowledge base.</p>
55+
* @public
56+
*/
57+
knowledgeBase: KnowledgeBase | undefined;
58+
}
59+
2760
/**
2861
* @public
2962
*/

0 commit comments

Comments
 (0)