RASA 1.0 HTTP API /model/train error

Using HTTP API I am trying to train rasa but getting the following error

{ “version”: “1.0.2”, “status”: “failure”, “message”: “An unexpected error occurred during training. Error: list indices must be integers or slices, not str”, “reason”: “TrainingError”, “details”: {}, “help”: null, “code”: 500 }

Here is the request json which I am sending

{ “domain”: “intents:\n - greet\n - goodbye\n - affirm\n - deny\n - mood_great\n - mood_unhappy\n\nactions: - utter_greet - utter_cheer_up - utter_did_that_help - utter_happy - utter_goodbye\ntemplates:\n utter_greet:\n - text: “Hey! How are you?”\n\n utter_cheer_up:\n - text: “Here is something to cheer you up:”\n image: “https://i.imgur.com/nGF1K8f.jpg”\n\n utter_did_that_help:\n - text: “Did that help you?”\n\n utter_happy:\n - text: “Great carry on!”\n\n utter_goodbye:\n - text: “Bye””, “config”: “# Configuration for Rasa NLU. # https://rasa.com/docs/nlu/components/ language: en pipeline: supervised_embeddings\n# Configuration for Rasa Core. # https://rasa.com/docs/core/policies policies:\n - name: MemoizationPolicy\n - name: KerasPolicy”, “nlu”: “## intent:greet - hey - hello\n## intent:goodbye - cu - goodbye”, “stories”: “## happy path * greet\n - utter_greet\n* mood_great\n - utter_happy\n\n## sad path 1 * greet\n - utter_greet\n* mood_unhappy”, “out”: “models”, “force”: false }

Please let me know what could be the issue, I guess there is nothing wrong with the requested json.

True. Even though using the Sample request from the Document it self it gives the same error.

On Serve side if you see the rasa_core.log then it says … “Configuration file ‘/tmp/tmp2ycld908/config.yml’ is missing mandatory parameters: policies, language, pipeline. Filling missing parameters from fallback configuration file: ‘/usr/local/lib/python3.6/dist-packages/rasa/cli/default_config.yml’.”

Which means, the config file it created using the request parameters you shared under /tmp/ directory is not having “policies, language, pipeline” and that’s true …If you will check the config.yml file under the temporary directory it created under /tmp due to this request , you will find this parameters as commented.

I tried many trial and error in the Example the provided … and at last this worked…though one error is there…but it created the model(.tar)

see the difference and learn. syntax issue in Domain and config

{ “domain”: “intents:\n - greet\n - goodbye\n - affirm\n - deny\n - mood_great\n - mood_unhappy\n\nactions:\n - utter_greet\n - utter_cheer_up\n - utter_did_that_help\n - utter_happy\n - utter_goodbye\ntemplates:\n utter_greet:\n - text: “Hey! How are you?”\n\n utter_cheer_up:\n - text: “Here is something to cheer you up:”\n image: “https://i.imgur.com/nGF1K8f.jpg”\n\n utter_did_that_help:\n - text: “Did that help you?”\n\n utter_happy:\n - text: “Great carry on!”\n\n utter_goodbye:\n - text: “Bye””, “config”: “language: en \npipeline: supervised_embeddings\npolicies:\n - name: MemoizationPolicy\n - name: KerasPolicy”, “nlu”: “## intent:greet - hey - hello\n## intent:goodbye - cu - goodbye”, “stories”: “## happy path * greet\n - utter_greet\n* mood_great\n - utter_happy\n\n## sad path 1 * greet\n - utter_greet\n* mood_unhappy”, “out”: “models2”, “force”: false }

Actually after few changes in the JSON according to your inputs, I am getting the following error, I guess there is an issue with the YML format conversion to string. Below is the error

{ “version”: “1.0.2”, “status”: “failure”, “message”: “An unexpected error occurred during training. Error: mapping values are not allowed in this context\n in “”, line 2, column 23”, “reason”: “TrainingError”, “details”: {}, “help”: null, “code”: 500 }

Here is my json in the request

{ “domain”: “intents:\n - greet\n - goodbye\n - affirm\n - deny\n - mood_great\n - mood_unhappy\n\nactions: - utter_greet - utter_cheer_up - utter_did_that_help - utter_happy - utter_goodbye\ntemplates:\n utter_greet:\n - text: “Hey! How are you?”\n\n utter_cheer_up:\n - text: “Here is something to cheer you up:”\n image: “https://i.imgur.com/nGF1K8f.jpg”\n\n utter_did_that_help:\n - text: “Did that help you?”\n\n utter_happy:\n - text: “Great carry on!”\n\n utter_goodbye:\n - text: “Bye””, “config”: “language: en\n pipeline: supervised_embeddings\npolicies:\n - name: MemoizationPolicy\n - name: KerasPolicy”, “nlu”: “## intent:greet - hey - hello\n## intent:goodbye - cu - goodbye”, “stories”: “## happy path * greet\n - utter_greet\n* mood_great\n - utter_happy\n\n## sad path 1 * greet\n - utter_greet\n* mood_unhappy”, “out”: “models”, “force”: false }

Buddy …If you will see in domain: actions…You need to put \n ahead each action …check in the content which I shared…Or verify it character to character and you will get the difference . At last you can simply copy -paste whatever I have shared.

Thank you so much for the response it worked, Sorry I have posted the wrong json above I have actually added \n for each action also, the mistake is I hv given two spaces instead of one at some places in the json looking at config.yml file due to which the error is occuring.