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 Risposte
0
Risposta accettata

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
con risposta 10 giorni fa
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
ESPERTO
Matt-B
con risposta un mese fa
profile picture
ESPERTO
verificato un mese fa
  • @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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande