【发布时间】:2021-06-21 16:16:53
【问题描述】:
我正在尝试在 Watson 中构建一个 BMI 计算器,但是当您使用“多重条件响应”时,Watson 似乎不支持数字比较。
<? ($weight / ($height * $height) ) < 18.5 ?>
这段代码会报错:
SpelParseException when evaluating dialog node ID [response_8_1624288200413]. Condition [<? ($weight / ($height * $height) ) < 18.5 ?>] could not be parsed. Check the syntax of the expression. SpEL syntax error: Expression [<? ($weight / ($height * $height) ) < 18.5 ?>] converted to [<? (context['weight'] / (context['height'] * context['height']) ) < 18.5 ?>] at position 0: EL1070E: Problem parsing left operand
编辑:解决了。这是我自己的错。如果您在“多个条件响应”中设置条件,请不要包含。
在这种情况下,您只需输入($weight / ($height * $height) ) < 18.5
在“如果助手识别”部分中
【问题讨论】:
标签: ibm-cloud ibm-watson watson-assistant