updateAgentActionGroup method

Future<UpdateAgentActionGroupResponse> updateAgentActionGroup({
  1. required String actionGroupId,
  2. required String actionGroupName,
  3. required String agentId,
  4. required String agentVersion,
  5. ActionGroupExecutor? actionGroupExecutor,
  6. ActionGroupState? actionGroupState,
  7. APISchema? apiSchema,
  8. String? description,
  9. FunctionSchema? functionSchema,
  10. ActionGroupSignature? parentActionGroupSignature,
  11. Map<String, String>? parentActionGroupSignatureParams,
})

Updates the configuration for an action group for an agent.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter actionGroupId : The unique identifier of the action group.

Parameter actionGroupName : Specifies a new name for the action group.

Parameter agentId : The unique identifier of the agent for which to update the action group.

Parameter agentVersion : The unique identifier of the agent version for which to update the action group.

Parameter actionGroupExecutor : The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.

Parameter actionGroupState : Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.

Parameter apiSchema : 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.

Parameter description : Specifies a new name for the action group.

Parameter functionSchema : Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.

Parameter parentActionGroupSignature : Update the built-in or computer use action for this action group. If you specify a value, you must leave the description, apiSchema, and actionGroupExecutor fields 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.
    • 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.
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.

Parameter parentActionGroupSignatureParams : The configuration settings for a computer use action.

Implementation

Future<UpdateAgentActionGroupResponse> updateAgentActionGroup({
  required String actionGroupId,
  required String actionGroupName,
  required String agentId,
  required String agentVersion,
  ActionGroupExecutor? actionGroupExecutor,
  ActionGroupState? actionGroupState,
  APISchema? apiSchema,
  String? description,
  FunctionSchema? functionSchema,
  ActionGroupSignature? parentActionGroupSignature,
  Map<String, String>? parentActionGroupSignatureParams,
}) async {
  final $payload = <String, dynamic>{
    'actionGroupName': actionGroupName,
    if (actionGroupExecutor != null)
      'actionGroupExecutor': actionGroupExecutor,
    if (actionGroupState != null) 'actionGroupState': actionGroupState.value,
    if (apiSchema != null) 'apiSchema': apiSchema,
    if (description != null) 'description': description,
    if (functionSchema != null) 'functionSchema': functionSchema,
    if (parentActionGroupSignature != null)
      'parentActionGroupSignature': parentActionGroupSignature.value,
    if (parentActionGroupSignatureParams != null)
      'parentActionGroupSignatureParams': parentActionGroupSignatureParams,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/${Uri.encodeComponent(actionGroupId)}/',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateAgentActionGroupResponse.fromJson(response);
}