October 28, 2021, 6:00am
I would like to ask if i can remove my answers from the domain file, create local files with them (like txt or any format), and then connect with some way like reference. This came up beacause my data may change in the future and it would be easier to make any change just from file and not in code.
Thank you in advance!!
October 28, 2021, 6:47am
Welcome to the community
You can use
Custom Actions to read your answers from a file as you would with regular Python code, then utter the contents of the file.
async def run(self, dispatcher, tracker, domain):
with open('my_answer_file.txt', 'r') as f:
my_text = f.read()
dispatcher.utter_message(text = my_text)
October 28, 2021, 6:58am
Thank you for your quick response!!
Generally, is this right strategy for Rasa implementation? I mean is this breaks the basic structure?
Thank you again!
October 28, 2021, 9:49am
Sorry, I’m not sure what you mean.
This does not break anything and is supported by Rasa (since it’s in the docs). Please read the links in my post above for more info.