You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, more of a Colang question (let me know if there's another place for these).
I'm trying to set a variable in a simple example script which looks like:
define user express greeting
"hello"
"hi"
"how are you"
define user give name
"James"
"Julio"
"Mary"
"Putu"
define bot name greeting
"Hey $name!"
define flow greeting
user express greeting
if $name
bot name greeting
else
bot express greeting
bot ask name
define flow give name
user give name
$name = $last_user_message
bot name greeting
Here I'd expect $name to be set to the same value as $last_user_message, but it is set to None and returns "Hey None!"
Any idea how this should work? I saw set in the Colang Language Reference doc, but that doesn't seem to do anything. I understand I can use actions to do this, but I was hoping for a simpler way if possible, any idea on how I should set the $name variable here?
The text was updated successfully, but these errors were encountered:
The advantage of this approach is that if the user responds with "My name is John", in this approach the name will be extracted correctly, whereas in your initial code the name would have been the full sentence.
Hi, more of a Colang question (let me know if there's another place for these).
I'm trying to set a variable in a simple example script which looks like:
Here I'd expect
$name
to be set to the same value as$last_user_message
, but it is set toNone
and returns"Hey None!"
Any idea how this should work? I saw
set
in the Colang Language Reference doc, but that doesn't seem to do anything. I understand I can use actions to do this, but I was hoping for a simpler way if possible, any idea on how I should set the$name
variable here?The text was updated successfully, but these errors were encountered: