

# Configure agent to request information from user to increase accuracy of function prediction
<a name="agents-user-input"></a>

You can configure your agent to request more information from the user if it doesn't have enough information to accomplish a task. If your agent has action groups or APIs with some parameters, by default, the agent will use the default values for those parameters or Foundation Model hallucinates to assume the values of the parameter to complete the API request if it is not provided by the user. This might lead to agent inaccurately predicting the next function or the method to invoke based on the current interaction and causing hallucination. 

To increase you agent’s accuracy, configure your agent to ask user to provide more information by enabling `User input` field in the Amazon Bedrock console, using the API, or using the AWS SDKs. Amazon Bedrock Agent model user input is a builtin ActionGroup that you'll need to add as an action group to your agent.

# Enable user input in Amazon Bedrock
<a name="agents-enable-user-input"></a>

If user input is enabled, agent reprompts the user for information about the missing parameters.

You can enable user input in the Amazon Bedrock console when you [create](https://docs.aws.amazon.com//bedrock/latest/userguide/agents-create.html) or [modify](https://docs.aws.amazon.com//bedrock/latest/userguide/agents-manage.html#agents-edit) your agent. If you are using API or SDKs, you can enable user input when you [create](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) or [update](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html) action group.

To learn how to enable user input in Amazon Bedrock, choose the tab for your preferred method, and then follow the steps:

------
#### [ Console ]

**To enable user input for your agent**

1. If you're not already in the agent builder, do the following:

   1. Sign in to the AWS Management Console with an IAM identity that has permissions to use the Amazon Bedrock console. Then, open the Amazon Bedrock console at [https://console.aws.amazon.com/bedrock](https://console.aws.amazon.com/bedrock).

   1. Select **Agents** from the left navigation pane. Then, choose an agent in the **Agents** section.

   1. Choose **Edit in Agent Builder**

1. Go to **Additional settings** and expand the section.

1. For **User input**, select **Enabled**.  
![\[Configure your agent to ask user for more information if the required information is not there to complete a task. You can configure the agent by enabling user input in your agent's action group.\]](http://docs.aws.amazon.com/bedrock/latest/userguide/images/agents/agents-user-input.png)

1. Make sure to first **Save** and then **Prepare** to apply the changes you have made to the agent before testing it.

------
#### [ API ]

To enable user input for your agent, send an [CreateActionGroup](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) request (see link for request and response formats and field details) with an [Agents for Amazon Bedrock build-time endpoint](https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bra-bt) and specify the following fields:


****  

| Field | Short description | 
| --- | --- | 
| actionGroupName | Name of the action group | 
| parentActionGroupSignature | Specify AMAZON.UserInput to allow the agent to request information from the user | 
| actionGroupState | Specify ENABLED to allow the agent to request information from user | 

The following shows the general format of the required fields for enabling user input with an [CreateActionGroup](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) request.

```
CreateAgentActionGroup:
{
  "actionGroupName": "AskUserAction",
  "parentActionGroupSignature": "AMAZON.UserInput",
  "actionGroupState": "ENABLED"
}
```

------

# Disable user input in Amazon Bedrock
<a name="agents-disable-user-input"></a>

If you disable user input, the agent doesn't request the user for additional details. if it needs to invoke an API in an action group, but doesn't have enough information to complete the API request. Instead, the model within the agent will use the default values and make a best guess at invoking the appropriate function or the method. This might cause agent to hallucinate on the function call prediction. 

You can disable user input in Amazon Bedrock at any time.

To learn how to disable user input, choose the tab for your preferred method, and then follow the steps:

------
#### [ Console ]

**To disable user input,**

1. Sign in to the AWS Management Console with an IAM identity that has permissions to use the Amazon Bedrock console. Then, open the Amazon Bedrock console at [https://console.aws.amazon.com/bedrock](https://console.aws.amazon.com/bedrock).

1. Select **Agents** from the left navigation pane. Then, choose an agent in the **Agents** section.

1. Choose **Edit in Agent builder**.

1. Expand **Additional setting** section, choose **Disabled** for **User input**.

1. Select **Prepare** at the top of the page. And then select **Save** to save the changes to your agent.

------
#### [ API ]

To disable user input, send an [UpdateAgentActionGroup](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html) request (see link for request and response formats and field details) with an [Agents for Amazon Bedrock build-time endpoint](https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bra-bt) and specify the following fields:


****  

| Field | Short description | 
| --- | --- | 
| actionGroupName | Name of the action group | 
| parentActionGroupSignature | Specify AMAZON.UserInput to disable the user input for agent | 
| actionGroupState | Specify DISABLED to disable user input for the agent | 

The following example shows the general format for specifying the required fields to disable user input.

```
CreateAgentActionGroup:
{
  "actionGroupName": "AskUserAction",
  "parentActionGroupSignature": "AMAZON.UserInput",
  "actionGroupState": "DISABLED"
}
```

------

After you've disabled user input for your agent, make sure to send a [PrepareAgent](https://docs.aws.amazon.com//bedrock/latest/APIReference/API_agent_PrepareAgent.html) request (see link for request and response formats and field details) with an [Agents for Amazon Bedrock build-time endpoint](https://docs.aws.amazon.com/general/latest/gr/bedrock.html#bra-bt).