How to Access Agent Inputs from Agents Tab?

Hi!

I recently embedded an Agent Chat into my app. This app will later be embedded into a CRM, so each subaccount can access it. Each subaccount has its own ID, so to personalize the experience for each user, I need to pass this ID over to my AI agent.

Under Agent Inputs, I wrote:
{{ {
...agentChat1.agentInputs,
subaccountId: getSubaccountId.data
} }}

Before starting a chat, the preview of that object looks like this:
{
"subaccountId": "defaultID"
}

However, the agent is not recognizing this value (which is never blank; the default value is "defaultID").

These are the instructions I wrote:
"You should check for an input parameter named subaccountId. If the user asks, "What is my subaccountId?" respond to the user referencing the parameter subaccountId. Insert the value provided in the input (for example: "Your subaccount ID is: 12345"). "

But when I ask for the subaccount ID to the agent, the response I receive is always something like "I don't currently have access to your subaccount ID."

Thank you all in advance!

1 Like

Hey @Thiago.Feysu - you'd have to pass that parameter in as part of the message to the agent. This should work:

  "messages": [ 
    { 
      "role": "user",
      "content": "The subaccount id is: {{ subaccountId.value }}" 
    }
  ], 
  "action": "invoke" 
}
1 Like

I believe the above is more or less what we discussed in Office Hours, @Thiago.Feysu. Let us know if you have any additional questions!