create_agent_action_group
async
¶
create_agent_action_group(
agent_id: Id,
agent_version: DraftVersion,
action_group_name: Name,
*,
config_overrides: Optional[AsyncBedrockAgentClientConfig] = None,
client_token: Optional[ClientToken] = None,
description: Optional[Description] = None,
parent_action_group_signature: Optional[ActionGroupSignature] = None,
parent_action_group_signature_params: Optional[ActionGroupSignatureParams] = None,
action_group_executor: Optional[ActionGroupExecutor] = None,
api_schema: Optional[APISchema] = None,
action_group_state: Optional[ActionGroupState] = None,
function_schema: Optional[FunctionSchema] = None,
) -> CreateAgentActionGroupResponse
Creates an action group for an agent. An action group represents the actions that an agent can carry out for the customer by defining the APIs that an agent can call and the logic for calling them.
To allow your agent to request the user for additional information when trying to complete a task, add an action group with the parentActionGroupSignature field set to AMAZON.UserInput.
To allow your agent to generate, run, and troubleshoot code when trying to complete a task, add an action group with the parentActionGroupSignature field set to AMAZON.CodeInterpreter.
You must leave the description, apiSchema, and actionGroupExecutor fields blank for this action group. 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 Observation reprompting the user for more information.
Parameters:
-
agent_id(Id) –The unique identifier of the agent for which to create the action group.
-
agent_version(DraftVersion) –The version of the agent for which to create the action group.
-
action_group_name(Name) –The name to give the action group.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
-
description(Optional[Description], default:None) –A description of the action group.
-
parent_action_group_signature(Optional[ActionGroupSignature], default:None) –Specify a built-in or computer use action for this action group. If you specify a value, you must leave the
description,apiSchema, andactionGroupExecutorfields empty for this action group.-
To allow your agent to request the user for additional information when trying to complete a task, set this field to
AMAZON.UserInput. -
To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to
AMAZON.CodeInterpreter. -
To allow your agent to use an Anthropic computer use tool, specify one of the following values.
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. When operating computer use functionality, we recommend taking additional security precautions, such as executing computer actions in virtual environments with restricted data access and limited internet connectivity. For more information, see Configure an Amazon Bedrock Agent to complete tasks with computer use tools.
-
ANTHROPIC.Computer- Gives the agent permission to use the mouse and keyboard and take screenshots. -
ANTHROPIC.TextEditor- Gives the agent permission to view, create and edit files. -
ANTHROPIC.Bash- Gives the agent permission to run commands in a bash shell.
-
-
-
parent_action_group_signature_params(Optional[ActionGroupSignatureParams], default:None) –The configuration settings for a computer use action.
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 Configure an Amazon Bedrock Agent to complete tasks with computer use tools.
-
action_group_executor(Optional[ActionGroupExecutor], default:None) –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.
-
api_schema(Optional[APISchema], default:None) –Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see Action group OpenAPI schemas.
-
action_group_state(Optional[ActionGroupState], default:None) –Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
-
function_schema(Optional[FunctionSchema], default:None) –Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–There was a conflict performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent/_services/async_bedrock_agent.py
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | |