Create rasa nlu.yml, responses.yml and stories.yml from sql table

hi my project have a need to have put the nlu record from sql record. The idea from sql table, there is a python that fetched it, put it into python dictionary and create nlu.yml.

But i got stuck in the making of the yml.

As we know the pattern of regular nlu.yml is like this : image

my python code is like :

output : image

with sql is like this : image

I already browsing all over the search result and find out that “|” is the sign of multiline and the - is still unknown and i don’t know how to combine “|” with -

i don’t know how to make pattern examples: |

  • examples 1
  • examples 2

in yaml generated from python dictionary

thank you i hope i can be replied as soon as possible

You can try creating an SQLTrainingDataImporter consider this example

As you can see, you need the TrainingData Message Format before you can pass it on the train method

You can use a CustomImporter as described here

I think this is a lot more suitable than creating a yaml file that you can pass to rasa train. Importers are easier to manage in your case.