https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> I am adding variables via A...
# ❓・ai-evy-support
f
@AI Evy I am adding variables via API call to my agent that uses gpt 4o model, however I am storing the data such as customer name ect. in the metadata part of the JSON and the agent cannot seem to get the for example it literally would say on the call " hi is this customer_name instead of the {{customer_name}} variable . where should I oust them instead so they get processed
a
Thanks for tagging me @freekzy. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [LLM WebSocket]() * [Dynamic Variables]() * [Audio WebSocket (Deprecated)]() * [LLM Playground]() -----------------------------
### Answer For outbound calls, you need to place the variables inside the
retell_llm_dynamic_variables
field when making the API call [(1)]() . Here's the correct format:
Copy code
json
{
  "user_name": "John Smith",
  "product_name": "Premium Plan",
  "account_status": "active"
}
You cannot send variables outside of the retell_llm_dynamic_variables object [(2)]() . Any variables within that object will be mapped within the prompt using the format {{whatever_variable_name_you_used}} . When using these variables in your prompt, they should be surrounded by double curly braces, like this:
Copy code
json
"Hello {{user_name}}, I understand you're interested in {{product_name}}. How can I help you today?"
[(1)]() If a dynamic variable is not assigned a value, it will remain unchanged in the output and appear as {{variable_name}} in the agent's speech .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.