Working waitFunction syntax just stopped
# support
e
Was the waitFunction parameter handling just changed? This was working fine:
Copy code
waitFunction: "(x <= 0.5 ? 100 : (x <= 0.8 ? 200 : 300))"
But all of a sudden it started returning:
Copy code
"startSpeakingPlan.smartEndpointingPlan.waitFunction:

The expression 'f(x) = (x <= 0.8 ? 100 : (x <= 0.5 ? 100 : (x <= 0.8 ? 200 : 300))' has invalid syntax.

Math.js error: Invalid left hand side of assignment operator (char 4)"
  ],
  "error": "Bad Request",
  "statusCode": 400
}
Seems like something was changed on Vapi's side (something to do with f(x) maybe) What was changed please and can we please get it fixed asap! It was working well
v
It appears that the
waitFunction
parameter now only supports direct mathematical expressions and not ternary (
? :
) or assignment (
=
) syntax.
To resolve the error, use a formula like:
Copy code
waitFunction: "200 + 8000 * x"
This will map
x
(probability) to a wait time in milliseconds. For more complex logic, you may need to approximate with a continuous function instead of conditional logic. [See documentation for details.](https://docs.vapi.ai/customization/speech-configuration) Sources: - [Speech configuration documentation](https://docs.vapi.ai/customization/speech-configuration) - [Changelog May 7, 2025](https://docs.vapi.ai/changelog/2025/5/7)
k
Can you send me the CURL request what you are sending?