Bedrock Agent - Setting User Input parameter through the API

0

When creating or updating an Agent in Bedrock through the management console, you have the option to configure the User Input option ("Select whether the agent can prompt additional information from the user when it does not have enough information to respond to an utterance."). However, when you create an Agent through the API, or CDK (CloudFormation), this option is not available and the default value is False.

Is there a way to modify the default value to True through the service API?

2 réponses
0
Réponse acceptée

The answer about using the Action Group was in the right direction, however, it was missing some details. After some trial and error, I discovered that you need to add another action group to the agent, but it has to have the following details to enable the user input:

        agent.add_action_group(
            action_group_name = "UserInputAction",
            action_group_state="ENABLED",
            parent_action_group_signature="AMAZON.UserInput"
        )
MLGuy
répondu il y a 9 jours
0

Hi There

This is set in the Action Group. See https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#bedrock-agent_CreateAgentActionGroup-request-parentActionGroupSignature

 parentActionGroupSignature

    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.

    Type: String

    Valid Values: AMAZON.UserInput

    Required: No

profile pictureAWS
EXPERT
Matt-B
répondu il y a un mois
profile picture
EXPERT
vérifié il y a un mois
  • @Matt-B, Thank you for your prompt answer. I'm still trying to understand how do I pass this AMAZON.UserInput? It is not a string ("AMAZON.UserInput") and I can't find where it is defined to include it in my CDK code.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions