https://retellai.com/?utm_source=discord&utm_medium=seo logo
Dynamic Variables
# ❓・bug-report
b
Good evening. I have a question regarding dynamic variables. I created an inbound agent to handle three types of leads. I set up the prompt so that the agent will respond based on the user's lead type. The lead type is the variable, but for some reason, the agent is not receiving the correct value. I know it's working since the agent correctly retrieves the user's name from Make.com. It also shows on Make.com that the correct lead type is being sent. However, despite tweaking the prompts multiple times, the agent is still providing the incorrect response. One thing I noticed is that when I added the lead type variable to the welcome message to test if the agent was receiving the correct value, the agent suddenly provided the correct response. However, as soon as I removed the lead type variable from the welcome message, the error reappeared. I hope you can provide some assistance.
r
@bcx.jkd So, you're sending the "lead type" as a response to the inbound dynamic variables webhook? I would do something like having a "Context" section in the system prompt, then "the user's lead type is: {{lead_type}}." In your "task" section or wherever you're instructing the agent, "If the user's lead type is X, do... 1.) 2.) 3.) 4.), etc..." "if the user's lead type is Y, do..." etc.
b
That is exactly what I'm already doing. If the user's lead type is x, then do this. It is not working. And if I ask the agent what my lead type is, it provides the incorrect one, even though the webhook is sending the correct information. I confirmed this by adding the {{lead_type}} variable to the welcome message. One thing I find strange is that when I test it with the {{lead_type}} variable in the welcome message, the assistant provides the correct responses. If I ask what my lead type is, it gives the correct answer. The agent only seems to get it right when the {{lead_type}} is in the greeting. The moment I remove it from the welcome message, the agent goes back to providing the incorrect lead type and responses. Note that the lead type is internal, and I don't want the agent to share that information with the user. I'm only adding it to the welcome message and allowing the agent to tell me my lead type for testing purposes.
r
@bcx.jkd what type of agent is this? single prompt?
b
Yes, single prompt. I also tried conversational flow just in case, but it is also not working.
Any update regarding the issue?
@Reece - Integration @ Retell AI
r
Will private message you