Hi, I am using the following versions.
rasa-core==0.14.3 rasa-core-sdk==0.14.0 rasa-nlu==0.15.0
My requirement is to change the internal CollectingDispatcher code. Inside it, I want to change the utter_template method to the following code:
def utter_template(self,
template, # type: Text
tracker, # type: Tracker
silent_fail=False, # type: bool
from_phone=None,
**kwargs # type: Any
):
# type: (...) -> None
""""Send a message to the client based on a template."""
if from_phone == 'desktop':
message = {"template": template + '_d'}
else:
message = {"template": template}
message.update(kwargs)
self.messages.append(message)
The above code will call the template with name ending with _d if the from_phone attribute is desktop. I have changed the code.Changed the file as follows and ran it.
changed the code from:
dispatcher.utter_template("utter_greet", tracker)
to:
dispatcher.utter_template("utter_greet", tracker, from_phone=from_phone)
In my domain file,
utter_greet is “Hi user”
utter_greet_d is “Hi desktop user”
But still I am getting the regular template itself.
My changes to the rasa_core package are not effecting anything. I am using virtual environment.
Please let me know where I went wrong.