Closed jamescalam closed 1 year ago
Hi @jamescalam! Thanks for reporting this. It is indeed a bug. I've already tested a fix and will be pushed to the main branch in the next day or so.
Meanwhile, you can try an alternative method, which will work even better (although at the cost of an extra LLM call):
define flow give name
user give name
# Extract the user's name
$name = ...
bot name greeting
It uses the mechanism for extracting user provided values: https://github.com/NVIDIA/NeMo-Guardrails/blob/main/docs/user_guide/advanced/extract-user-provided-values.md.
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.
I'll close this once the fix is pushed.
Thanks again!
For the record, this is now fixed (https://github.com/NVIDIA/NeMo-Guardrails/commit/1ace2a7891c56469ad786397cc5bce1e0e1e0fa9).
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?