https://discord.gg/botpress logo
#🤝help
Error when using generative ai
# 🤝help
o

orange-carpet-90806

01/04/2024, 3:49 PM
i get this error an error when using gen ai expression An unexpected error occurred. [SyntaxError, Unexpected token 'return'] {"scope":"dm"}
c

crooked-van-25152

01/04/2024, 3:50 PM
Hello!
Can you please send a screenshot of your node? How did you set it up?
o

orange-carpet-90806

01/04/2024, 4:23 PM
here is the screenshot of the node and the expression and the error
c

crooked-van-25152

01/04/2024, 5:05 PM
Can you also share a report ID?
f

fresh-fireman-491

01/04/2024, 8:06 PM
You can't use return as a condition in your expression card since its a statement. You can use JavaScript expressions. What condition are you trying to check?
o

orange-carpet-90806

01/05/2024, 10:00 AM
thanks for getting back to me. I am trying to check whether at least 3 of the conditions in the node is true to move forward in the process otherwise they are ineligible.
f

fresh-fireman-491

01/05/2024, 10:50 AM
Can you try without the return statement and use && between each of the conditions
o

orange-carpet-90806

01/05/2024, 11:05 AM
ive changed the condition to this. i am no longer getting an error but it just ends the conversation
f

fresh-fireman-491

01/05/2024, 11:07 AM
You still have Return in the condition. What do you want to check with each variable?
o

orange-carpet-90806

01/05/2024, 12:17 PM
if out of the four workflows redness,pain,swelling and hot skin at least 3 are true i want to proceed to a node currently named standard12 otherwise they are forwarded to node standard13
f

fresh-fireman-491

01/05/2024, 3:49 PM
Had to upload it like that
Else discord would format the text
That could should work
The || and the && are logical operators
|| just means or
&& means and
Let me know if it works