2024/08/23 - Agents for Amazon Bedrock - 3 updated api methods
Changes Releasing the support for Action User Confirmation.
{'functionSchema': {'functions': {'requireConfirmation': 'ENABLED | DISABLED'}}}Response
{'agentActionGroup': {'functionSchema': {'functions': {'requireConfirmation': 'ENABLED ' '| ' 'DISABLED'}}}}
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.
See also: AWS API Documentation
Request Syntax
client.create_agent_action_group( actionGroupExecutor={ 'customControl': 'RETURN_CONTROL', 'lambda': 'string' }, actionGroupName='string', actionGroupState='ENABLED'|'DISABLED', agentId='string', agentVersion='string', apiSchema={ 'payload': 'string', 's3': { 's3BucketName': 'string', 's3ObjectKey': 'string' } }, clientToken='string', description='string', functionSchema={ 'functions': [ { 'description': 'string', 'name': 'string', 'parameters': { 'string': { 'description': 'string', 'required': True|False, 'type': 'string'|'number'|'integer'|'boolean'|'array' } }, 'requireConfirmation': 'ENABLED'|'DISABLED' }, ] }, parentActionGroupSignature='AMAZON.UserInput'|'AMAZON.CodeInterpreter' )
dict
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.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: customControl, lambda.
customControl (string) --
To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .
lambda (string) --
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
string
[REQUIRED]
The name to give the action group.
string
Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
string
[REQUIRED]
The unique identifier of the agent for which to create the action group.
string
[REQUIRED]
The version of the agent for which to create the action group.
dict
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.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: payload, s3.
payload (string) --
The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3 (dict) --
Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3BucketName (string) --
The name of the S3 bucket.
s3ObjectKey (string) --
The S3 object key for the S3 resource.
string
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.
This field is autopopulated if not provided.
string
A description of the action group.
dict
Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: functions.
functions (list) --
A list of functions that each define an action in the action group.
(dict) --
Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
This data type is used in the following API operations:
description (string) --
A description of the function and its purpose.
name (string) -- [REQUIRED]
A name for the function.
parameters (dict) --
The parameters that the agent elicits from the user to fulfill the function.
(string) --
(dict) --
Contains details about a parameter in a function for an action group.
This data type is used in the following API operations:
description (string) --
A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.
required (boolean) --
Whether the parameter is required for the agent to complete the function for action group invocation.
type (string) -- [REQUIRED]
The data type of the parameter.
requireConfirmation (string) --
Contains information if user confirmation is required to invoke the function.
string
To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput . You must leave the description , apiSchema , and actionGroupExecutor fields blank for this action group.
To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field 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.
dict
Response Syntax
{ 'agentActionGroup': { 'actionGroupExecutor': { 'customControl': 'RETURN_CONTROL', 'lambda': 'string' }, 'actionGroupId': 'string', 'actionGroupName': 'string', 'actionGroupState': 'ENABLED'|'DISABLED', 'agentId': 'string', 'agentVersion': 'string', 'apiSchema': { 'payload': 'string', 's3': { 's3BucketName': 'string', 's3ObjectKey': 'string' } }, 'clientToken': 'string', 'createdAt': datetime(2015, 1, 1), 'description': 'string', 'functionSchema': { 'functions': [ { 'description': 'string', 'name': 'string', 'parameters': { 'string': { 'description': 'string', 'required': True|False, 'type': 'string'|'number'|'integer'|'boolean'|'array' } }, 'requireConfirmation': 'ENABLED'|'DISABLED' }, ] }, 'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter', 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) --
agentActionGroup (dict) --
Contains details about the action group that was created.
actionGroupExecutor (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: customControl, lambda. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
customControl (string) --
To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .
lambda (string) --
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
actionGroupId (string) --
The unique identifier of the action group.
actionGroupName (string) --
The name of the action group.
actionGroupState (string) --
Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
agentId (string) --
The unique identifier of the agent to which the action group belongs.
agentVersion (string) --
The version of the agent to which the action group belongs.
apiSchema (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: payload, s3. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
payload (string) --
The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3 (dict) --
Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3BucketName (string) --
The name of the S3 bucket.
s3ObjectKey (string) --
The S3 object key for the S3 resource.
clientToken (string) --
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.
createdAt (datetime) --
The time at which the action group was created.
description (string) --
The description of the action group.
functionSchema (dict) --
Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: functions. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
functions (list) --
A list of functions that each define an action in the action group.
(dict) --
Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
This data type is used in the following API operations:
description (string) --
A description of the function and its purpose.
name (string) --
A name for the function.
parameters (dict) --
The parameters that the agent elicits from the user to fulfill the function.
(string) --
(dict) --
Contains details about a parameter in a function for an action group.
This data type is used in the following API operations:
description (string) --
A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.
required (boolean) --
Whether the parameter is required for the agent to complete the function for action group invocation.
type (string) --
The data type of the parameter.
requireConfirmation (string) --
Contains information if user confirmation is required to invoke the function.
parentActionSignature (string) --
If this field is set as AMAZON.UserInput , the agent can request the user for additional information when trying to complete a task. The description , apiSchema , and actionGroupExecutor fields must be blank for this action group.
During orchestration, if the 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.
updatedAt (datetime) --
The time at which the action group was last updated.
{'agentActionGroup': {'functionSchema': {'functions': {'requireConfirmation': 'ENABLED ' '| ' 'DISABLED'}}}}
Gets information about an action group for an agent.
See also: AWS API Documentation
Request Syntax
client.get_agent_action_group( actionGroupId='string', agentId='string', agentVersion='string' )
string
[REQUIRED]
The unique identifier of the action group for which to get information.
string
[REQUIRED]
The unique identifier of the agent that the action group belongs to.
string
[REQUIRED]
The version of the agent that the action group belongs to.
dict
Response Syntax
{ 'agentActionGroup': { 'actionGroupExecutor': { 'customControl': 'RETURN_CONTROL', 'lambda': 'string' }, 'actionGroupId': 'string', 'actionGroupName': 'string', 'actionGroupState': 'ENABLED'|'DISABLED', 'agentId': 'string', 'agentVersion': 'string', 'apiSchema': { 'payload': 'string', 's3': { 's3BucketName': 'string', 's3ObjectKey': 'string' } }, 'clientToken': 'string', 'createdAt': datetime(2015, 1, 1), 'description': 'string', 'functionSchema': { 'functions': [ { 'description': 'string', 'name': 'string', 'parameters': { 'string': { 'description': 'string', 'required': True|False, 'type': 'string'|'number'|'integer'|'boolean'|'array' } }, 'requireConfirmation': 'ENABLED'|'DISABLED' }, ] }, 'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter', 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) --
agentActionGroup (dict) --
Contains details about the action group.
actionGroupExecutor (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: customControl, lambda. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
customControl (string) --
To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .
lambda (string) --
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
actionGroupId (string) --
The unique identifier of the action group.
actionGroupName (string) --
The name of the action group.
actionGroupState (string) --
Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
agentId (string) --
The unique identifier of the agent to which the action group belongs.
agentVersion (string) --
The version of the agent to which the action group belongs.
apiSchema (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: payload, s3. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
payload (string) --
The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3 (dict) --
Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3BucketName (string) --
The name of the S3 bucket.
s3ObjectKey (string) --
The S3 object key for the S3 resource.
clientToken (string) --
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.
createdAt (datetime) --
The time at which the action group was created.
description (string) --
The description of the action group.
functionSchema (dict) --
Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: functions. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
functions (list) --
A list of functions that each define an action in the action group.
(dict) --
Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
This data type is used in the following API operations:
description (string) --
A description of the function and its purpose.
name (string) --
A name for the function.
parameters (dict) --
The parameters that the agent elicits from the user to fulfill the function.
(string) --
(dict) --
Contains details about a parameter in a function for an action group.
This data type is used in the following API operations:
description (string) --
A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.
required (boolean) --
Whether the parameter is required for the agent to complete the function for action group invocation.
type (string) --
The data type of the parameter.
requireConfirmation (string) --
Contains information if user confirmation is required to invoke the function.
parentActionSignature (string) --
If this field is set as AMAZON.UserInput , the agent can request the user for additional information when trying to complete a task. The description , apiSchema , and actionGroupExecutor fields must be blank for this action group.
During orchestration, if the 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.
updatedAt (datetime) --
The time at which the action group was last updated.
{'functionSchema': {'functions': {'requireConfirmation': 'ENABLED | DISABLED'}}}Response
{'agentActionGroup': {'functionSchema': {'functions': {'requireConfirmation': 'ENABLED ' '| ' 'DISABLED'}}}}
Updates the configuration for an action group for an agent.
See also: AWS API Documentation
Request Syntax
client.update_agent_action_group( actionGroupExecutor={ 'customControl': 'RETURN_CONTROL', 'lambda': 'string' }, actionGroupId='string', actionGroupName='string', actionGroupState='ENABLED'|'DISABLED', agentId='string', agentVersion='string', apiSchema={ 'payload': 'string', 's3': { 's3BucketName': 'string', 's3ObjectKey': 'string' } }, description='string', functionSchema={ 'functions': [ { 'description': 'string', 'name': 'string', 'parameters': { 'string': { 'description': 'string', 'required': True|False, 'type': 'string'|'number'|'integer'|'boolean'|'array' } }, 'requireConfirmation': 'ENABLED'|'DISABLED' }, ] }, parentActionGroupSignature='AMAZON.UserInput'|'AMAZON.CodeInterpreter' )
dict
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: customControl, lambda.
customControl (string) --
To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .
lambda (string) --
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
string
[REQUIRED]
The unique identifier of the action group.
string
[REQUIRED]
Specifies a new name for the action group.
string
Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
string
[REQUIRED]
The unique identifier of the agent for which to update the action group.
string
[REQUIRED]
The unique identifier of the agent version for which to update the action group.
dict
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.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: payload, s3.
payload (string) --
The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3 (dict) --
Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3BucketName (string) --
The name of the S3 bucket.
s3ObjectKey (string) --
The S3 object key for the S3 resource.
string
Specifies a new name for the action group.
dict
Contains details about the function schema for the action group or the JSON or YAML-formatted payload defining the schema.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: functions.
functions (list) --
A list of functions that each define an action in the action group.
(dict) --
Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
This data type is used in the following API operations:
description (string) --
A description of the function and its purpose.
name (string) -- [REQUIRED]
A name for the function.
parameters (dict) --
The parameters that the agent elicits from the user to fulfill the function.
(string) --
(dict) --
Contains details about a parameter in a function for an action group.
This data type is used in the following API operations:
description (string) --
A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.
required (boolean) --
Whether the parameter is required for the agent to complete the function for action group invocation.
type (string) -- [REQUIRED]
The data type of the parameter.
requireConfirmation (string) --
Contains information if user confirmation is required to invoke the function.
string
To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput . 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.
dict
Response Syntax
{ 'agentActionGroup': { 'actionGroupExecutor': { 'customControl': 'RETURN_CONTROL', 'lambda': 'string' }, 'actionGroupId': 'string', 'actionGroupName': 'string', 'actionGroupState': 'ENABLED'|'DISABLED', 'agentId': 'string', 'agentVersion': 'string', 'apiSchema': { 'payload': 'string', 's3': { 's3BucketName': 'string', 's3ObjectKey': 'string' } }, 'clientToken': 'string', 'createdAt': datetime(2015, 1, 1), 'description': 'string', 'functionSchema': { 'functions': [ { 'description': 'string', 'name': 'string', 'parameters': { 'string': { 'description': 'string', 'required': True|False, 'type': 'string'|'number'|'integer'|'boolean'|'array' } }, 'requireConfirmation': 'ENABLED'|'DISABLED' }, ] }, 'parentActionSignature': 'AMAZON.UserInput'|'AMAZON.CodeInterpreter', 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) --
agentActionGroup (dict) --
Contains details about the action group that was updated.
actionGroupExecutor (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: customControl, lambda. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
customControl (string) --
To return the action group invocation results directly in the InvokeAgent response, specify RETURN_CONTROL .
lambda (string) --
The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action.
actionGroupId (string) --
The unique identifier of the action group.
actionGroupName (string) --
The name of the action group.
actionGroupState (string) --
Specifies whether the action group is available for the agent to invoke or not when sending an InvokeAgent request.
agentId (string) --
The unique identifier of the agent to which the action group belongs.
agentVersion (string) --
The version of the agent to which the action group belongs.
apiSchema (dict) --
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: payload, s3. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
payload (string) --
The JSON or YAML-formatted payload defining the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3 (dict) --
Contains details about the S3 object containing the OpenAPI schema for the action group. For more information, see Action group OpenAPI schemas.
s3BucketName (string) --
The name of the S3 bucket.
s3ObjectKey (string) --
The S3 object key for the S3 resource.
clientToken (string) --
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.
createdAt (datetime) --
The time at which the action group was created.
description (string) --
The description of the action group.
functionSchema (dict) --
Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: functions. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
functions (list) --
A list of functions that each define an action in the action group.
(dict) --
Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
This data type is used in the following API operations:
description (string) --
A description of the function and its purpose.
name (string) --
A name for the function.
parameters (dict) --
The parameters that the agent elicits from the user to fulfill the function.
(string) --
(dict) --
Contains details about a parameter in a function for an action group.
This data type is used in the following API operations:
description (string) --
A description of the parameter. Helps the foundation model determine how to elicit the parameters from the user.
required (boolean) --
Whether the parameter is required for the agent to complete the function for action group invocation.
type (string) --
The data type of the parameter.
requireConfirmation (string) --
Contains information if user confirmation is required to invoke the function.
parentActionSignature (string) --
If this field is set as AMAZON.UserInput , the agent can request the user for additional information when trying to complete a task. The description , apiSchema , and actionGroupExecutor fields must be blank for this action group.
During orchestration, if the 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.
updatedAt (datetime) --
The time at which the action group was last updated.