Migrating 1.0 to 2.0 for query

https://raw.githubusercontent.com/S1LV3RJ1NX/CBOT-rasa/master/data/nlu.md


## intent:query
- Query: [What is for loop in C](stack_query)
- Query: [What is history of C](stack_query)
- Query: [How to declare variables in C](stack_query)
- Query: [What is range of integer in C](stack_query)
- Query: [How to use while loop in C](stack_query)
- Query: [How to break out of loop in C](stack_query)
- Query: [What is use of continue statment in loop](stack_query)
- Query: [What are data types in C](stack_query)
- Query: [What are types of error in C](stack_query)
- Query: [How to declare variable in C](stack_query)
- Query: [break statment in C](stack_query)
- Query: [How are variables declared in C](stack_query)

how do I transform this to work for v 2.0?

I changed it to:


- intent: query
  examples: |
  - [What is for loop in C](stack_query)
  - [What is history of C](stack_query)
  - [How to declare variables in C](stack_query)
  - [What is range of integer in C](stack_query)
  - [How to use while loop in C](stack_query)
  - [How to break out of loop in C](stack_query)
  - [What is use of continue statment in loop](stack_query)
  - [What are data types in C](stack_query)
  - [What are types of error in C](stack_query)
  - [How to declare variable in C](stack_query)
  - [break statment in C](stack_query)
  - [How are variables declared in C](stack_query)
YamlSyntaxException: Failed to read 'data/nlu.yml'. while parsing a block mapping
  in "data/nlu.yml", line 328, column 3:
    - intent: query
      ^ (line: 328)
expected <block end>, but found '-'
  in "data/nlu.yml", line 330, column 3:
      - [What is for loop in C](stack_ ...
      ^ (line: 330)

You can use https://yamlchecker.com/ to validate the YAML syntax of your file.

Thanks

Hi there, this looks almost right:

First off – Do you have these lines at the top of your file?

version: "2.0"
nlu:

Missing the nlu line may be the cause of the first error message you’re seeing. The examples need to be indented further than the examples line, like so:

- intent: query
  examples: |
    - [What is for loop in C](stack_query)
    - [What is history of C](stack_query)
    - [How to declare variables in C](stack_query)
    - [What is range of integer in C](stack_query)
    - [How to use while loop in C](stack_query)
    - [How to break out of loop in C](stack_query)
    - [What is use of continue statment in loop](stack_query)
    - [What are data types in C](stack_query)
    - [What are types of error in C](stack_query)
    - [How to declare variable in C](stack_query)
    - [break statment in C](stack_query)
    - [How are variables declared in C](stack_query)

If this doesn’t work for you, feel free to share the whole file and I can take a look.

Yes it was a silly tab issue. Do you know of any script to help out on migrating 1.0 to 2.0? It seems like it can easily be done…

I’m having problems migrating Story 1

- story: New Story1
  steps: 
  - intent: break_loops
  - action: utter_break_loops
  - action: utter_ask_stack
  - intent: affirm
  - action: utter_refactor_query
  - action: utter_ask_query
  - intent: query{"stack_query":"break statment in C"}
  - action: stack_overflow_form
  - active_loop: stack_overflow_form
  - action: slot{"stack_query":"break statment in C"}
  - action: slot{"stack_query":null}
  - active_loop: null
  - action: slot{"requested_slot":null}
  - intent: goodbye
  - action: utter_thanks

Specifically

- intent: query{"stack_query":"break statment in C"}
 - action: slot{"stack_query":"break statment in C"}

Thanks

Do you know of any script to help out on migrating 1.0 to 2.0?

Yes, have you tried:

rasa data convert nlu -f yaml --data=./data/nlu --out=./data/nlu

rasa data convert core -f yaml --data=./data/stories --out=./data/stories

?

Ok great, any thoughts on query{“stack_query”:“break statment in C”} Is this a legal format?

You’ll need to do:

    - intent: query
    - slot_was_set:
        - stack_query: "break statement in C"