PRP
03/22/2025, 12:49 PMVapi Support Bot
03/22/2025, 12:51 PMassistantOverrides
, follow these best practices:
### 1. Use the Correct Syntax for Variable Interpolation
Make sure you're using the proper syntax when referencing variables in tool calls:
json
{
"body": {
"message": {
"toolCalls": [
{
"function": {
"name": "send_to_endpoint",
"arguments": {
"mc_number": "{{mc_verification.output.mc_number}}"
}
}
}
]
}
}
}
### 2. Structure Your assistantOverrides
Correctly
When setting up your assistantOverrides
with variableValues
, use this structure:
javascript
const assistantOverrides = {
variableValues: {
name: "Alice",
},
};
vapi.start("your-assistant-id", assistantOverrides);
According to [Vapi's documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables), dynamic variables are defined using double curly braces {{variableName}}
and must be added in this format in all your prompts.
## Debugging Strategies
If you're still experiencing issues, try these debugging approaches:
1. **Check Variable Names and Syntax**: Ensure variable names in variableValues
exactly match those expected by the assistant.
2. **Review Execution Order and Variable Scope**: Make sure the block setting the variable executes before the block using it, and that variables are in the correct scope.
3. **Examine Call Logs**: Look into logs associated with the call ID to diagnose the issue further.Vapi Support Bot
03/22/2025, 12:51 PMvariableValues
and the assistant's configuration.
3. Issues with synchronous execution if the order of operations is important.
Is there anything specific about your implementation that you'd like me to help troubleshoot further?
Source:
- [Vapi's documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables)Kyle
03/23/2025, 2:39 PM