Skip to content

Commit f66d9c4

Browse files
author
awstools
committed
feat(client-bedrock-agent): Add support for computer use tools
1 parent 331d197 commit f66d9c4

File tree

6 files changed

+192
-13
lines changed

6 files changed

+192
-13
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export interface CreateAgentActionGroupCommandOutput extends CreateAgentActionGr
5151
* actionGroupName: "STRING_VALUE", // required
5252
* clientToken: "STRING_VALUE",
5353
* description: "STRING_VALUE",
54-
* parentActionGroupSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
54+
* parentActionGroupSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter" || "ANTHROPIC.Computer" || "ANTHROPIC.Bash" || "ANTHROPIC.TextEditor",
55+
* parentActionGroupSignatureParams: { // ActionGroupSignatureParams
56+
* "<keys>": "STRING_VALUE",
57+
* },
5558
* actionGroupExecutor: { // ActionGroupExecutor Union: only one key present
5659
* lambda: "STRING_VALUE",
5760
* customControl: "RETURN_CONTROL",
@@ -93,7 +96,10 @@ export interface CreateAgentActionGroupCommandOutput extends CreateAgentActionGr
9396
* // description: "STRING_VALUE",
9497
* // createdAt: new Date("TIMESTAMP"), // required
9598
* // updatedAt: new Date("TIMESTAMP"), // required
96-
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
99+
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter" || "ANTHROPIC.Computer" || "ANTHROPIC.Bash" || "ANTHROPIC.TextEditor",
100+
* // parentActionGroupSignatureParams: { // ActionGroupSignatureParams
101+
* // "<keys>": "STRING_VALUE",
102+
* // },
97103
* // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present
98104
* // lambda: "STRING_VALUE",
99105
* // customControl: "RETURN_CONTROL",

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ export interface GetAgentActionGroupCommandOutput extends GetAgentActionGroupRes
5656
* // description: "STRING_VALUE",
5757
* // createdAt: new Date("TIMESTAMP"), // required
5858
* // updatedAt: new Date("TIMESTAMP"), // required
59-
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
59+
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter" || "ANTHROPIC.Computer" || "ANTHROPIC.Bash" || "ANTHROPIC.TextEditor",
60+
* // parentActionGroupSignatureParams: { // ActionGroupSignatureParams
61+
* // "<keys>": "STRING_VALUE",
62+
* // },
6063
* // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present
6164
* // lambda: "STRING_VALUE",
6265
* // customControl: "RETURN_CONTROL",

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export interface UpdateAgentActionGroupCommandOutput extends UpdateAgentActionGr
4646
* actionGroupId: "STRING_VALUE", // required
4747
* actionGroupName: "STRING_VALUE", // required
4848
* description: "STRING_VALUE",
49-
* parentActionGroupSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
49+
* parentActionGroupSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter" || "ANTHROPIC.Computer" || "ANTHROPIC.Bash" || "ANTHROPIC.TextEditor",
50+
* parentActionGroupSignatureParams: { // ActionGroupSignatureParams
51+
* "<keys>": "STRING_VALUE",
52+
* },
5053
* actionGroupExecutor: { // ActionGroupExecutor Union: only one key present
5154
* lambda: "STRING_VALUE",
5255
* customControl: "RETURN_CONTROL",
@@ -88,7 +91,10 @@ export interface UpdateAgentActionGroupCommandOutput extends UpdateAgentActionGr
8891
* // description: "STRING_VALUE",
8992
* // createdAt: new Date("TIMESTAMP"), // required
9093
* // updatedAt: new Date("TIMESTAMP"), // required
91-
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter",
94+
* // parentActionSignature: "AMAZON.UserInput" || "AMAZON.CodeInterpreter" || "ANTHROPIC.Computer" || "ANTHROPIC.Bash" || "ANTHROPIC.TextEditor",
95+
* // parentActionGroupSignatureParams: { // ActionGroupSignatureParams
96+
* // "<keys>": "STRING_VALUE",
97+
* // },
9298
* // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present
9399
* // lambda: "STRING_VALUE",
94100
* // customControl: "RETURN_CONTROL",

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

Lines changed: 107 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ export namespace FunctionSchema {
411411
export const ActionGroupSignature = {
412412
AMAZON_CODEINTERPRETER: "AMAZON.CodeInterpreter",
413413
AMAZON_USERINPUT: "AMAZON.UserInput",
414+
ANTHROPIC_BASH: "ANTHROPIC.Bash",
415+
ANTHROPIC_COMPUTER: "ANTHROPIC.Computer",
416+
ANTHROPIC_TEXTEDITOR: "ANTHROPIC.TextEditor",
414417
} as const;
415418

416419
/**
@@ -454,13 +457,56 @@ export interface CreateAgentActionGroupRequest {
454457
description?: string | undefined;
455458

456459
/**
457-
* <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>. You must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields blank for this action group.</p>
458-
* <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>. You must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields blank for this action group.</p>
459-
* <p>During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html">Observation</a> reprompting the user for more information.</p>
460+
* <p>Specify a built-in or computer use action for this action group. If you specify a value, you must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields empty for this action group. </p>
461+
* <ul>
462+
* <li>
463+
* <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>. </p>
464+
* </li>
465+
* <li>
466+
* <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>.</p>
467+
* </li>
468+
* <li>
469+
* <p>To allow your agent to use an Anthropic computer use tool, specify one of the following values. </p>
470+
* <important>
471+
* <p>
472+
* Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only.
473+
* When operating computer use functionality, we recommend taking additional security precautions,
474+
* such as executing computer actions in virtual environments with restricted data access and limited internet connectivity.
475+
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
476+
* </p>
477+
* </important>
478+
* <ul>
479+
* <li>
480+
* <p>
481+
* <code>ANTHROPIC.Computer</code> - Gives the agent permission to use the mouse and keyboard and
482+
* take screenshots.</p>
483+
* </li>
484+
* <li>
485+
* <p>
486+
* <code>ANTHROPIC.TextEditor</code> - Gives the agent permission to view, create and edit files.</p>
487+
* </li>
488+
* <li>
489+
* <p>
490+
* <code>ANTHROPIC.Bash</code> - Gives the agent permission to run commands in a bash shell.</p>
491+
* </li>
492+
* </ul>
493+
* </li>
494+
* </ul>
460495
* @public
461496
*/
462497
parentActionGroupSignature?: ActionGroupSignature | undefined;
463498

499+
/**
500+
* <p>The configuration settings for a computer use action.</p>
501+
* <important>
502+
* <p>
503+
* Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
504+
* </p>
505+
* </important>
506+
* @public
507+
*/
508+
parentActionGroupSignatureParams?: Record<string, string> | undefined;
509+
464510
/**
465511
* <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.</p>
466512
* @public
@@ -547,6 +593,17 @@ export interface AgentActionGroup {
547593
*/
548594
parentActionSignature?: ActionGroupSignature | undefined;
549595

596+
/**
597+
* <p>The configuration settings for a computer use action.</p>
598+
* <important>
599+
* <p>
600+
* Computer use is a new Anthropic Claude model capability (in beta) available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
601+
* </p>
602+
* </important>
603+
* @public
604+
*/
605+
parentActionGroupSignatureParams?: Record<string, string> | undefined;
606+
550607
/**
551608
* <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.</p>
552609
* @public
@@ -895,12 +952,57 @@ export interface UpdateAgentActionGroupRequest {
895952
description?: string | undefined;
896953

897954
/**
898-
* <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>. You must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields blank for this action group.</p>
955+
* <p>Update the built-in or computer use action for this action group. If you specify a value, you must leave the <code>description</code>, <code>apiSchema</code>, and <code>actionGroupExecutor</code> fields empty for this action group. </p>
956+
* <ul>
957+
* <li>
958+
* <p>To allow your agent to request the user for additional information when trying to complete a task, set this field to <code>AMAZON.UserInput</code>. </p>
959+
* </li>
960+
* <li>
961+
* <p>To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to <code>AMAZON.CodeInterpreter</code>.</p>
962+
* </li>
963+
* <li>
964+
* <p>To allow your agent to use an Anthropic computer use tool, specify one of the following values. </p>
965+
* <important>
966+
* <p>
967+
* Computer use is a new Anthropic Claude model capability (in beta) available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only.
968+
* When operating computer use functionality, we recommend taking additional security precautions,
969+
* such as executing computer actions in virtual environments with restricted data access and limited internet connectivity.
970+
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
971+
* </p>
972+
* </important>
973+
* <ul>
974+
* <li>
975+
* <p>
976+
* <code>ANTHROPIC.Computer</code> - Gives the agent permission to use the mouse and keyboard and
977+
* take screenshots.</p>
978+
* </li>
979+
* <li>
980+
* <p>
981+
* <code>ANTHROPIC.TextEditor</code> - Gives the agent permission to view, create and edit files.</p>
982+
* </li>
983+
* <li>
984+
* <p>
985+
* <code>ANTHROPIC.Bash</code> - Gives the agent permission to run commands in a bash shell.</p>
986+
* </li>
987+
* </ul>
988+
* </li>
989+
* </ul>
899990
* <p>During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html">Observation</a> reprompting the user for more information.</p>
900991
* @public
901992
*/
902993
parentActionGroupSignature?: ActionGroupSignature | undefined;
903994

995+
/**
996+
* <p>The configuration settings for a computer use action.</p>
997+
* <important>
998+
* <p>
999+
* Computer use is a new Anthropic Claude model capability (in beta) available with Claude 3.7 and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
1000+
* </p>
1001+
* </important>
1002+
* @public
1003+
*/
1004+
parentActionGroupSignatureParams?: Record<string, string> | undefined;
1005+
9041006
/**
9051007
* <p>The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.</p>
9061008
* @public
@@ -1250,7 +1352,7 @@ export interface PromptConfiguration {
12501352
inferenceConfiguration?: InferenceConfiguration | undefined;
12511353

12521354
/**
1253-
* <p>Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the <code>promptType</code>. If you set the field as <code>OVERRIDEN</code>, the <code>overrideLambda</code> field in the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html">PromptOverrideConfiguration</a> must be specified with the ARN of a Lambda function.</p>
1355+
* <p>Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the <code>promptType</code>. If you set the field as <code>OVERRIDDEN</code>, the <code>overrideLambda</code> field in the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html">PromptOverrideConfiguration</a> must be specified with the ARN of a Lambda function.</p>
12541356
* @public
12551357
*/
12561358
parserMode?: CreationMode | undefined;

clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ export const se_CreateAgentActionGroupCommand = async (
490490
description: [],
491491
functionSchema: (_) => _json(_),
492492
parentActionGroupSignature: [],
493+
parentActionGroupSignatureParams: (_) => _json(_),
493494
})
494495
);
495496
b.m("PUT").h(headers).b(body);
@@ -1748,6 +1749,7 @@ export const se_UpdateAgentActionGroupCommand = async (
17481749
description: [],
17491750
functionSchema: (_) => _json(_),
17501751
parentActionGroupSignature: [],
1752+
parentActionGroupSignatureParams: (_) => _json(_),
17511753
})
17521754
);
17531755
b.m("PUT").h(headers).b(body);
@@ -3795,6 +3797,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
37953797

37963798
// se_ActionGroupExecutor omitted.
37973799

3800+
// se_ActionGroupSignatureParams omitted.
3801+
37983802
// se_AgentAliasRoutingConfiguration omitted.
37993803

38003804
// se_AgentAliasRoutingConfigurationListItem omitted.
@@ -4515,6 +4519,8 @@ const se_Document = (input: __DocumentType, context: __SerdeContext): any => {
45154519

45164520
// de_ActionGroupExecutor omitted.
45174521

4522+
// de_ActionGroupSignatureParams omitted.
4523+
45184524
/**
45194525
* deserializeAws_restJson1ActionGroupSummaries
45204526
*/
@@ -4587,6 +4593,7 @@ const de_AgentActionGroup = (output: any, context: __SerdeContext): AgentActionG
45874593
createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
45884594
description: __expectString,
45894595
functionSchema: (_: any) => _json(__expectUnion(_)),
4596+
parentActionGroupSignatureParams: _json,
45904597
parentActionSignature: __expectString,
45914598
updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
45924599
}) as any;

0 commit comments

Comments
 (0)