Skip to content

Commit

Permalink
feat(client-bedrock-agent): Custom Orchestration API release for AWSB…
Browse files Browse the repository at this point in the history
…edrockAgents.
  • Loading branch information
awstools committed Nov 26, 2024
1 parent c7fdd8b commit 9f83f11
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 35 deletions.
12 changes: 12 additions & 0 deletions clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* instruction: "STRING_VALUE",
* foundationModel: "STRING_VALUE",
* description: "STRING_VALUE",
* orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
* customOrchestration: { // CustomOrchestration
* executor: { // OrchestrationExecutor Union: only one key present
* lambda: "STRING_VALUE",
* },
* },
* idleSessionTTLInSeconds: Number("int"),
* agentResourceRoleArn: "STRING_VALUE",
* customerEncryptionKeyArn: "STRING_VALUE",
Expand Down Expand Up @@ -128,6 +134,12 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
* // foundationModel: "STRING_VALUE",
* // description: "STRING_VALUE",
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
* // customOrchestration: { // CustomOrchestration
* // executor: { // OrchestrationExecutor Union: only one key present
* // lambda: "STRING_VALUE",
* // },
* // },
* // idleSessionTTLInSeconds: Number("int"), // required
* // agentResourceRoleArn: "STRING_VALUE", // required
* // customerEncryptionKeyArn: "STRING_VALUE",
Expand Down
6 changes: 6 additions & 0 deletions clients/client-bedrock-agent/src/commands/GetAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export interface GetAgentCommandOutput extends GetAgentResponse, __MetadataBeare
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
* // foundationModel: "STRING_VALUE",
* // description: "STRING_VALUE",
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
* // customOrchestration: { // CustomOrchestration
* // executor: { // OrchestrationExecutor Union: only one key present
* // lambda: "STRING_VALUE",
* // },
* // },
* // idleSessionTTLInSeconds: Number("int"), // required
* // agentResourceRoleArn: "STRING_VALUE", // required
* // customerEncryptionKeyArn: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetAgentKnowledgeBaseRequest, GetAgentKnowledgeBaseResponse } from "../models/models_0";
import { GetAgentKnowledgeBaseRequest } from "../models/models_0";
import { GetAgentKnowledgeBaseResponse } from "../models/models_1";
import { de_GetAgentKnowledgeBaseCommand, se_GetAgentKnowledgeBaseCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetKnowledgeBaseRequest, GetKnowledgeBaseResponse } from "../models/models_0";
import { GetKnowledgeBaseRequest, GetKnowledgeBaseResponse } from "../models/models_1";
import { de_GetKnowledgeBaseCommand, se_GetKnowledgeBaseCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
12 changes: 12 additions & 0 deletions clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* instruction: "STRING_VALUE",
* foundationModel: "STRING_VALUE", // required
* description: "STRING_VALUE",
* orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
* customOrchestration: { // CustomOrchestration
* executor: { // OrchestrationExecutor Union: only one key present
* lambda: "STRING_VALUE",
* },
* },
* idleSessionTTLInSeconds: Number("int"),
* agentResourceRoleArn: "STRING_VALUE", // required
* customerEncryptionKeyArn: "STRING_VALUE",
Expand Down Expand Up @@ -94,6 +100,12 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required
* // foundationModel: "STRING_VALUE",
* // description: "STRING_VALUE",
* // orchestrationType: "DEFAULT" || "CUSTOM_ORCHESTRATION",
* // customOrchestration: { // CustomOrchestration
* // executor: { // OrchestrationExecutor Union: only one key present
* // lambda: "STRING_VALUE",
* // },
* // },
* // idleSessionTTLInSeconds: Number("int"), // required
* // agentResourceRoleArn: "STRING_VALUE", // required
* // customerEncryptionKeyArn: "STRING_VALUE",
Expand Down
156 changes: 123 additions & 33 deletions clients/client-bedrock-agent/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,64 @@ export const AgentStatus = {
*/
export type AgentStatus = (typeof AgentStatus)[keyof typeof AgentStatus];

/**
* <p>
* Contains details about the Lambda function containing the orchestration logic carried out upon invoking the custom orchestration.
* </p>
* @public
*/
export type OrchestrationExecutor = OrchestrationExecutor.LambdaMember | OrchestrationExecutor.$UnknownMember;

/**
* @public
*/
export namespace OrchestrationExecutor {
/**
* <p>
* The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
* </p>
* @public
*/
export interface LambdaMember {
lambda: string;
$unknown?: never;
}

/**
* @public
*/
export interface $UnknownMember {
lambda?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
lambda: (value: string) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: OrchestrationExecutor, visitor: Visitor<T>): T => {
if (value.lambda !== undefined) return visitor.lambda(value.lambda);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}

/**
* <p>
* Details of custom orchestration.
* </p>
* @public
*/
export interface CustomOrchestration {
/**
* <p>
* The structure of the executor invoking the actions in custom orchestration.
* </p>
* @public
*/
executor?: OrchestrationExecutor | undefined;
}

/**
* <p>Details about a guardrail associated with a resource.</p>
* @public
Expand Down Expand Up @@ -1006,6 +1064,20 @@ export interface MemoryConfiguration {
storageDays?: number | undefined;
}

/**
* @public
* @enum
*/
export const OrchestrationType = {
CUSTOM_ORCHESTRATION: "CUSTOM_ORCHESTRATION",
DEFAULT: "DEFAULT",
} as const;

/**
* @public
*/
export type OrchestrationType = (typeof OrchestrationType)[keyof typeof OrchestrationType];

/**
* <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>
* @public
Expand Down Expand Up @@ -1251,6 +1323,22 @@ export interface Agent {
*/
description?: string | undefined;

/**
* <p>
* Specifies the orchestration strategy for the agent.
* </p>
* @public
*/
orchestrationType?: OrchestrationType | undefined;

/**
* <p>
* Contains custom orchestration configurations for the agent.
* </p>
* @public
*/
customOrchestration?: CustomOrchestration | undefined;

/**
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
* <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>
Expand Down Expand Up @@ -1679,6 +1767,22 @@ export interface CreateAgentRequest {
*/
description?: string | undefined;

/**
* <p>
* Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.
* </p>
* @public
*/
orchestrationType?: OrchestrationType | undefined;

/**
* <p>
* Contains details of the custom orchestration configured for the agent.
* </p>
* @public
*/
customOrchestration?: CustomOrchestration | undefined;

/**
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
* <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>
Expand Down Expand Up @@ -1964,6 +2068,22 @@ export interface UpdateAgentRequest {
*/
description?: string | undefined;

/**
* <p>
* Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.
* </p>
* @public
*/
orchestrationType?: OrchestrationType | undefined;

/**
* <p>
* Contains details of the custom orchestration configured for the agent.
* </p>
* @public
*/
customOrchestration?: CustomOrchestration | undefined;

/**
* <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
* <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>
Expand Down Expand Up @@ -9029,39 +9149,6 @@ export interface GetAgentKnowledgeBaseRequest {
knowledgeBaseId: string | undefined;
}

/**
* @public
*/
export interface GetAgentKnowledgeBaseResponse {
/**
* <p>Contains details about a knowledge base attached to an agent.</p>
* @public
*/
agentKnowledgeBase: AgentKnowledgeBase | undefined;
}

/**
* @public
*/
export interface GetKnowledgeBaseRequest {
/**
* <p>The unique identifier of the knowledge base you want to get information on.</p>
* @public
*/
knowledgeBaseId: string | undefined;
}

/**
* @public
*/
export interface GetKnowledgeBaseResponse {
/**
* <p>Contains details about the knowledge base.</p>
* @public
*/
knowledgeBase: KnowledgeBase | undefined;
}

/**
* @internal
*/
Expand Down Expand Up @@ -9149,6 +9236,7 @@ export const PromptOverrideConfigurationFilterSensitiveLog = (obj: PromptOverrid
export const AgentFilterSensitiveLog = (obj: Agent): any => ({
...obj,
...(obj.instruction && { instruction: SENSITIVE_STRING }),
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
});

Expand All @@ -9158,6 +9246,7 @@ export const AgentFilterSensitiveLog = (obj: Agent): any => ({
export const CreateAgentRequestFilterSensitiveLog = (obj: CreateAgentRequest): any => ({
...obj,
...(obj.instruction && { instruction: SENSITIVE_STRING }),
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
});

Expand All @@ -9183,6 +9272,7 @@ export const GetAgentResponseFilterSensitiveLog = (obj: GetAgentResponse): any =
export const UpdateAgentRequestFilterSensitiveLog = (obj: UpdateAgentRequest): any => ({
...obj,
...(obj.instruction && { instruction: SENSITIVE_STRING }),
...(obj.customOrchestration && { customOrchestration: obj.customOrchestration }),
...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }),
});

Expand Down
33 changes: 33 additions & 0 deletions clients/client-bedrock-agent/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@ import {
StorageConfiguration,
} from "./models_0";

/**
* @public
*/
export interface GetAgentKnowledgeBaseResponse {
/**
* <p>Contains details about a knowledge base attached to an agent.</p>
* @public
*/
agentKnowledgeBase: AgentKnowledgeBase | undefined;
}

/**
* @public
*/
export interface GetKnowledgeBaseRequest {
/**
* <p>The unique identifier of the knowledge base you want to get information on.</p>
* @public
*/
knowledgeBaseId: string | undefined;
}

/**
* @public
*/
export interface GetKnowledgeBaseResponse {
/**
* <p>Contains details about the knowledge base.</p>
* @public
*/
knowledgeBase: KnowledgeBase | undefined;
}

/**
* @public
*/
Expand Down
Loading

0 comments on commit 9f83f11

Please sign in to comment.