Exemplo n.º 1
0
    def test_regular(self):
        actual = Target(
            children=[
                Input(
                    Mock(),
                    children=[Mock()]
                ),
                Output(Mock(), children=[Mock()]),
                Goto()
            ]
        )

        folder = Folder(
            children=[actual]
        )
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(
            dialog,
            actual.children[0].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[1].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[2].dialog
        )
Exemplo n.º 2
0
    def test_regular(self):
        actual = Target(
            Prompt(
                items=[Mock()]
            ),
            children=[
                Action("var_name_value", "operator_value"),
                Goto()
            ]
        )

        folder = Folder(
            children=[actual]
        )
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(
            dialog,
            actual.children[0].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[1].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[2].dialog
        )
Exemplo n.º 3
0
    def test_regular(self):
        actual = Target(
            Mock(),
            children=[
                Grammar(watson_items=[Mock()]),
                Action(var_name="var_name_value", operator="operator_value"),
                Goto()
            ]
        )

        folder = Folder(
            children=[actual]
        )
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(
            dialog,
            actual.children[0].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[1].dialog
        )
        self.assertEqual(
            dialog,
            actual.children[2].dialog
        )
Exemplo n.º 4
0
    def test_regular(self):
        actual = Target(
            folders=[Folder(children=[Mock()]),
                     Folder(children=[Mock()])])

        dialog = Dialog(flow=actual)

        self.assertEqual(dialog, actual.folders[0].dialog)
        self.assertEqual(dialog, actual.folders[1].dialog)
Exemplo n.º 5
0
 def create():
     return Folder(label="Library",
                   children=[
                       SystemInitiatedSequences.create(),
                       PreliminarySequencesFolder.create(),
                       RoutingSequences.create(),
                       BaseSequences.create(),
                       GlobalSequences.create(),
                       Folder(label="Storage")
                   ])
Exemplo n.º 6
0
    def test_regular(self):
        actual = Target(
            Prompt(items=[Mock()]),
            children=[Action("var_name_value", "operator_value"),
                      Goto()])

        folder = Folder(children=[actual])
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(dialog, actual.children[0].dialog)
        self.assertEqual(dialog, actual.children[1].dialog)
        self.assertEqual(dialog, actual.children[2].dialog)
Exemplo n.º 7
0
    def test_regular(self):
        actual = Target(children=[
            Input(Mock(), children=[Mock()]),
            Output(Mock(), children=[Mock()]),
            Goto()
        ])

        folder = Folder(children=[actual])
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(dialog, actual.children[0].dialog)
        self.assertEqual(dialog, actual.children[1].dialog)
        self.assertEqual(dialog, actual.children[2].dialog)
Exemplo n.º 8
0
    def create():
        return Folder(
            label="UI ACTIONS",
            children=[
                Input(
                    Grammar(watson_items=["USER CLICKS BOX"]),
                    children=[
                        Output(
                            prompt=Prompt(
                                items=["{Selected_Movie}."]
                            ),
                            children=[
                                If(
                                    elements=[
                                        Condition(name="Popularity_Score", operator="GREATER_THEN", root_text="6.9"),
                                        Output(
                                            Prompt(
                                                items=[
                                                    "Great choice! That gets fabulous ratings.",
                                                    "That's a good one! You will love it.",
                                                    " I hear that's a really good movie!"
                                                ]
                                            ),
                                            children=[AfterSearchResults.goto()]
                                        )
                                    ]
                                ),
                                If(
                                    elements=[
                                        Condition(name="Popularity_Score", operator="LESS_THEN", root_text="4"),
                                        Output(
                                            Prompt(
                                                items=[
                                                    "Hmm, I hear that's not such a great movie.",
                                                    "Um, that one gets low ratings.",
                                                    "Are you sure about that? The ratings are terrible."
                                                ]
                                            ),
                                            children=[AfterSearchResults.goto()]
                                        )

                                    ]
                                ),
                                Output(
                                    prompt=Prompt(
                                        items=[
                                            "Okay.",
                                            "All right.",
                                            "Sure thing!",
                                            "Coming right up!"
                                        ]
                                    ),
                                    children=[AfterSearchResults.goto()]
                                )
                            ]
                        )
                    ]
                )
            ]
        )
Exemplo n.º 9
0
    def test_regular(self):
        actual = Target(Mock(),
                        children=[
                            Grammar(watson_items=[Mock()]),
                            Action(var_name="var_name_value",
                                   operator="operator_value"),
                            Goto()
                        ])

        folder = Folder(children=[actual])
        dialog = Mock()
        folder._set_dialog(dialog)

        self.assertEqual(dialog, actual.children[0].dialog)
        self.assertEqual(dialog, actual.children[1].dialog)
        self.assertEqual(dialog, actual.children[2].dialog)
Exemplo n.º 10
0
 def create():
     return Folder(
         _id="folder_routing_sequences",
         label="ROUTING SEQUENCES",
         children=[
             GreetingAction.reset(),
             SmallTalkAction.set_to_zero(),
             Input(Grammar(watson_items=[
                 "out-of-scope movie topics", "$ (OTHER_MOVIE)={Topic}"
             ]),
                   children=[
                       TopicAction.set_to_value(),
                       Goto(ref="output_no_topic_lookup")
                   ]),
             Input(Grammar(watson_items=[
                 "by out-of-scope movie topics",
                 "$ (BY_OTHER_MOVIE)={Topic}"
             ]),
                   children=[
                       TopicAction.set_to_value(),
                       Goto(ref="output_2503370")
                   ]),
             Input(Grammar(watson_items=[
                 "unsupported genres", "$ (UNSUPPORTED_GENRES)={Topic}"
             ]),
                   children=[
                       TopicAction.set_to_value(),
                       Goto(ref="output_2510164")
                   ]),
             Input(Grammar(watson_items=[
                 "old movies", "$ old movies", "$ classic movies",
                 "$ oldies", "$ classics"
             ]),
                   children=[Goto(ref="output_2503380")]),
             Input(Grammar(watson_items=[
                 "Review", "$ review", "$ find movies by rating",
                 "$ look up movies by rating", "$ highest rating",
                 "$ highest rated", "$ best rating", "$ best rated",
                 "$ lowest rating", "$ lowest rated", "$ oscar winners",
                 "$ best movie", "$ best movies"
             ]),
                   children=[
                       GreetingAction.reset(),
                       SmallTalkAction.set_to_zero(),
                       Goto(ref="output_2469539")
                   ]),
             Input(Grammar(["Movie theaters", "$ movie theaters"]),
                   children=[Goto(ref="output_2503320")]),
             Input(Grammar(
                 watson_items=["trailer", "$ trailer", "$ trailers"]),
                   children=[
                       GreetingAction.reset(),
                       SmallTalkAction.set_to_zero(),
                       Goto(ref="output_2510290")
                   ])
         ])
Exemplo n.º 11
0
 def create():
     return Folder(label="Color",
                   children=[
                       Concept(_id="red",
                               grammars=[Grammar(watson_items=["red"])]),
                       Concept(_id="white",
                               grammars=[Grammar(watson_items=["white"])]),
                       Concept(_id="black",
                               grammars=[Grammar(watson_items=["black"])])
                   ])
Exemplo n.º 12
0
 def create():
     return Folder(
         # "@selectionType": "RANDOM",
         label="GLOBAL SEQUENCES",
         _id="folder_global_sequences",
         children=[
             UIActionsSequences.create(),
             OpeningSequences.create(),
             ClosingSequences.create(),
             RepairSequences.create(),
             SmallTalkSequences.create()
         ])
Exemplo n.º 13
0
 def create():
     return Folder(
         label="BASE SEQUENCES",
         _id="folder_base_sequences",
         children=[
             GreetingAction.reset(),
             SmallTalkAction.set_to_zero(),
             FavoritesInput.create(),
             DetailsInput.create(),
             # ShowtimesInput.create(),
             MainSearchCriteriaInput.create()
         ]
     )
Exemplo n.º 14
0
 def create():
     return Folder(
         label="Style",
         children=[
             Concept(
                 _id="high heels",
                 grammars=[
                     Grammar(watson_items=["high heels", "high-heels"])
                 ]
             ),
             Concept(
                 _id="boots",
                 grammars=[
                     Grammar(watson_items=["boots", "boot"])
                 ]
             )
         ]
     )
Exemplo n.º 15
0
 def create():
     return Folder(
         label="CLOSING SEQUENCES",
         children=[
             Input(Grammar(watson_items=[
                 "I should be going", "$ should be going", "$ should go",
                 "$ need to go", "$ got to go", "$ gotta run", "$ gotta go",
                 "$ need to run", "$ need to leave", "$ have to leave",
                 "$ have to go", "$ gtg"
             ]),
                   children=[
                       Output(
                           _id="output_2449675",
                           prompt=GenericPrompt.ok(),
                           children=[
                               Goto(ref="output_did_find_what_looking_for")
                           ])
                   ]),
             Input(Grammar(watson_items=[
                 "Thanks for your help", "$ thank you for your help",
                 "$ thanks for your help"
             ]),
                   children=[
                       Output(
                           Prompt(items=["You are welcome."]),
                           children=[
                               Goto(ref="output_did_find_what_looking_for")
                           ])
                   ]),
             Input(Grammar(watson_items=["Goodbye"]),
                   children=[
                       If(elements=[
                           TerminalExchangeConditions.is_yes(),
                           Goto(ref="output_end_of_conversation")
                       ]),
                       If(elements=[
                           TerminalExchangeConditions.is_no(),
                           Goto(ref="output_2449675")
                       ])
                   ])
         ])
Exemplo n.º 16
0
    def create():
        return Folder(
            label="Main",
            children=[
                Output(
                    prompt=GenericPrompt.what_is_your_name(),
                    children=[
                        GetUserInput(
                            children=[
                                Input(
                                    Grammar(
                                        watson_items=[
                                            "Movies",
                                            "$ (Color)={Color_Preference}",
                                            "$ (Style)={Style_Preference}",
                                            "$ movies",
                                            "$ want to see something",
                                            "$ planning to go see",
                                            "$ planning to go to the",
                                            "$ going out to see",
                                            "$ planning to see",
                                            "$ want to go see",
                                            "$ thinking of seeing",
                                            "$ thinking we want to see",
                                            "$ what do you recommend",
                                            "$ can you recommend something",
                                            "$ what are your recommendations"
                                        ]
                                    ),
                                    children=[
                                        ColorPreferenceAction.set_to_value(),
                                        # CertificationPreferenceAction.set_to_value(),
                                        StylePreferenceAction.set_to_value(),
                                        TopicAction.set_to_shoes(),
                                        PreliminarySequencesSearch.goto()
                                    ]
                                ),
                                Input(
                                    Grammar(
                                        watson_items=[
                                            "Movie-related",
                                            "$ (OTHER_MOVIE)={Topic}",
                                            "$ (BY_OTHER_MOVIE)={Topic}",
                                            "$ showtimes",
                                            "$ theaters",
                                            "$ fandango",
                                            "$ reviews",
                                            "$ review",
                                            "$ critiques",
                                            "$ critique",
                                            "$ old movies",
                                            "$ classic movies",
                                            "$ oldies",
                                            "$ classics",
                                            "$ trailers",
                                            "$ reviews",
                                            "$ (DINING)={Topic}",
                                            "$ (WEATHER)={Topic}",
                                            "$ (TRAFFIC)={Topic}"
                                        ]
                                    ),
                                    children=[PreliminarySequencesSearch.goto()]
                                ),
                                Input(
                                    grammar=FeelingGrammar.create_preliminaries(),
                                    children=[

                                        PreliminarySequencesSearch.goto()
                                    ]
                                ),
                                Input(
                                    Grammar(
                                        watson_items=[
                                            "Why do you need to know?",
                                            "$ why",
                                            "$ need to know",
                                            "$ use it",
                                            "$ do with it"
                                        ]
                                    ),
                                    children=[
                                        Output(
                                            prompt=Prompt(
                                                items=["Just trying to be friendly."]
                                            ),
                                            children=[StartSearch.goto()]
                                        )
                                    ]
                                ),
                                Input(
                                    Grammar(
                                        watson_items=[
                                            "I don't want to give it!",
                                            "$ don't want",
                                            "$ no",
                                            "$ refuse",
                                            "$ none of your business"
                                        ]
                                    ),
                                    children=[
                                        Output(
                                            Prompt(items=["That's fine."]),
                                            children=[StartSearch.goto()]
                                        )
                                    ]
                                ),
                                Input(
                                    ProfileGrammar.create_my_name_is_dynamic_data(),
                                    children=[
                                        UserNameAction.set_to_source(),
                                        Output(
                                            prompt=Prompt(items=["Hi {User_Name}!"]),
                                            children=[StartSearch.goto()]
                                        )
                                    ],
                                    _id="input_user_knownas_name"
                                )
                            ],
                            _id="getUserInput_what_is_your_name"
                        ),
                        StartSearch.create(),
                        HowCanHelpYouOutput.create()
                    ],
                    _id="output_what_is_name"
                )
            ]
        )
Exemplo n.º 17
0
 def create():
     # Folder
     return Folder(
         label="SYSTEM INITIATED SEQUENCES",
         children=[
             Output(
                 _id=SystemInitiatedSequences.__id(),
                 prompt=Prompt(
                     items=["Is there anything else I can help you with?"]),
                 children=[
                     PageAction.set_to_new(),
                     Action(var_name="Current_Index",
                            operator="SET_TO",
                            text="0"),
                     ColorPreferenceAction.set_to_blank(),
                     # RecencyPreferenceAction.set_to_blank(),
                     StylePreferenceAction.set_to_blank(),
                     Action(var_name="Search_Now", operator="SET_TO_NO"),
                     Action(var_name="Terminal_Exchange",
                            operator="SET_TO_BLANK"),
                     Action(var_name="Topic", operator="SET_TO_BLANK"),
                     Action(var_name="ZIP_Code_Preference",
                            operator="SET_TO_BLANK"),
                     Action(var_name="Display_Trailer",
                            operator="SET_TO_NO"),
                     Action(var_name="Selected_Movie",
                            operator="SET_TO_BLANK"),
                     Action(var_name="Display_Movie_Details",
                            operator="SET_TO_NO"),
                     Action(var_name="Display_Reviews",
                            operator="SET_TO_NO"),
                     Action(var_name="Popularity_Score",
                            operator="SET_TO",
                            text="0.5"),
                     GetUserInput(children=[
                         Input(GenericGrammar.yes(),
                               children=[HowCanHelpYouOutput.goto()]),
                         Input(
                             GenericGrammar.no(),
                             children=[
                                 Output(
                                     prompt=GenericPrompt.ok(),
                                     children=[
                                         Goto(
                                             ref=
                                             "output_did_find_what_looking_for"
                                         )
                                     ])
                             ]),
                         PreliminarySequencesSearch.goto()
                     ])
                 ]),
             Output(
                 _id="output_did_find_what_looking_for",
                 prompt=Prompt(items=[
                     "Did you find what you were looking for, {User_Name}?"
                 ]),
                 children=[
                     GetUserInput(children=[
                         Input(
                             GenericGrammar().yes(),
                             children=[
                                 RequestSuccessAction.set_to_yes(),
                                 Output(
                                     prompt=Prompt(items=["Great!"]),
                                     children=[
                                         Output(
                                             _id="output_goodbye",
                                             prompt=Prompt(items=[
                                                 "Goodbye.<br> <br>"
                                             ]),
                                             children=[
                                                 TerminalExchangeAction.
                                                 set_to_yes(),
                                                 GreetingAction.reset(),
                                                 GetUserInput(children=[
                                                     Input(
                                                         Grammar(watson_items
                                                                 =[
                                                                     "Goodbye",
                                                                     "$ goodbye"
                                                                 ]),
                                                         children
                                                         =[
                                                             Output(
                                                                 _id=
                                                                 "output_end_of_conversation",
                                                                 prompt=
                                                                 Prompt(
                                                                     items
                                                                     ="&lt;i&gt;Say anything to continue.&lt;/i&gt;"
                                                                 ),
                                                                 children=[
                                                                     GetUserInput(children=[
                                                                         Output(
                                                                             _id
                                                                             ="output_welcome_back",
                                                                             prompt
                                                                             =Prompt(
                                                                                 items
                                                                                 =[
                                                                                     "Welcome back!"
                                                                                 ]
                                                                             ),
                                                                             children
                                                                             =[
                                                                                 HowCanHelpYouOutput
                                                                                 .
                                                                                 goto(
                                                                                 )
                                                                             ]
                                                                         )
                                                                     ])
                                                                 ]),
                                                         ]),
                                                     HowCanHelpYouOutput.
                                                     goto()
                                                 ])
                                             ])
                                     ])
                             ]),
                         Input(
                             GenericGrammar.no(),
                             children=[
                                 RequestSuccessAction.set_to_no(),
                                 Output(
                                     prompt=Prompt(
                                         items=[
                                             "Oh no. Do you want to try again?"
                                         ]),
                                     children=[
                                         GetUserInput(children=[
                                             Input(
                                                 GenericGrammar.no(),
                                                 children=
                                                 [
                                                     TerminalExchangeAction.
                                                     set_to_no(),
                                                     Output(
                                                         prompt
                                                         =GenericPrompt.ok(
                                                         ),
                                                         children=[
                                                             Goto(ref=
                                                                  "output_goodbye"
                                                                  )
                                                         ])
                                                 ]),
                                             Input(
                                                 GenericGrammar.yes(),
                                                 children=[
                                                     Output(prompt=Prompt(
                                                         items=[
                                                             "Okay. What can I do for you?"
                                                         ]),
                                                            children=[
                                                                Goto(
                                                                    "getUserInput_how_can_i_help_you"
                                                                )
                                                            ])
                                                 ])
                                         ])
                                     ])
                             ]),
                         PreliminarySequencesSearch.goto()
                     ])
                 ]),
             Output(
                 _id="output_too_much_small_talk",
                 prompt=Prompt(items=[
                     "This is fun, but wouldn't you like to look up some movies?"
                 ]),
                 children=[
                     GetUserInput(children=[
                         Input(
                             GenericGrammar.yes(),
                             children=[StylePreferenceProfileCheck.goto()]),
                         Input(GenericGrammar.no(),
                               children=[
                                   SmallTalkAction.set_to_zero(),
                                   Output(GenericPrompt.ok_fine())
                               ]),
                         Input(
                             GenericGrammar.ok(),
                             children=[StylePreferenceProfileCheck.goto()]),
                         PreliminarySequencesSearch.goto()
                     ])
                 ])
         ])
Exemplo n.º 18
0
    def create():
        from dialog.schema.factories.folder.sequences import SystemInitiatedSequences

        return Folder(
                label="REPAIR SEQUENCES",
                children=[
                    Input(
                            Grammar(
                                    watson_items=[
                                        "Help",
                                        "$ help",
                                        "$ how does this work",
                                        "$ what do I do",
                                        "$ what can I do",
                                        "$ don't know",
                                        "$ I'm not sure"
                                    ]
                            ),
                            children=[
                                Output(
                                        Prompt(
                                                items=[
                                                    "Say <i>Never mind</i> or <i>nvm</i> to start over.\nSay <i>okay</i> or <i>thanks</i> if my response is acceptable.\nSay <i>What does X mean?</i> for a definition of X.\nSay <i>got to go</i> or <i>bye</i> when you're finished."
                                                ]
                                        )
                                )
                            ]
                    ),
                    Input(
                            Grammar(
                                    watson_items=[
                                        "Say that again",
                                        "$ say that again",
                                        "$ say again",
                                        "$ what did you say",
                                        "$ come again",
                                        "$ say what"
                                    ]
                            ),
                            children=[
                                Output(
                                        Prompt(items=["I said..."]),
                                        children=[Goto(ref="##special_DNR_GUI_PREVIOUS_OUTPUT_NODE_ID")]
                                )
                            ]
                    ),
                    Input(
                            Grammar(
                                    watson_items=[
                                        "Never mind",
                                        "$ Nevermind",
                                        "$ Never mind",
                                        "$ nvm",
                                        "$ start over",
                                        "$ start again",
                                        "$ restart",
                                        "$ redo",
                                        "$ do over",
                                        "$ start from * beginning",
                                        "$ clear * selections"
                                    ]
                            ),
                            children=[
                                Output(
                                        Prompt(items=["Okay. Whatever you say, {User_Name}!"]),
                                        children=[SystemInitiatedSequences.goto()]
                                )
                            ]
                    ),
                    Input(
                            Grammar(
                                    watson_items=[
                                        "what does * mean",
                                        "$ what does * mean",
                                        "$ what does * stand for",
                                        "$ do you mean by ",
                                        "$ what are examples of",
                                        "$ what is an example of"
                                    ]
                            ),
                            children=[
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "trailers",
                                                    "$ trailer",
                                                    "$ trailers"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "<i>Trailers</i> are video previews for movies. <br> <br>"]
                                                    ),
                                                    children=[
                                                        GetUserInput(
                                                                children=[
                                                                    Input(
                                                                            Grammar(watson_items=["okay"]),
                                                                            children=[
                                                                                Output(
                                                                                        Prompt(items=[
                                                                                            "Sure, happy to help. <br> <br>"]),
                                                                                        children=[Goto(
                                                                                                ref="##special_DNR_GET_USER_INPUT_NODE_ID")]
                                                                                )
                                                                            ]
                                                                    )
                                                                ]
                                                        )
                                                    ],
                                                    is_insert_DNR_statement=True
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "genre",
                                                    "$ genre",
                                                    "$ genres"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "The <i>genre</i> is the category of movie, like Drama, Comedy, Action, etc. <br> <br>"
                                                            ]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "rating",
                                                    "$ rating",
                                                    "$ ratings",
                                                    "$ mpaa"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "The <i>rating</i> is a recommendation by the Motion Picture Association of America about the suitability of a movie's content for particular age groups. For example, G is for general audiences, while R is restricted to people 17 and older.<br> <br>"]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "G",
                                                    "$ G"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "G stands for <i>General Audience</i> and is appropriate for everyone.", ]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "PG-13",
                                                    "$ PG-13"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "PG-13 means <i>Parents Strongly Cautioned</i> or that some material may not be suitable for children under 13 years old.",
                                                            ]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "Current",
                                                    "$ current"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "<i>Current</i> movies are those that have been playing for the past 28 days."
                                                            ]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "Upcoming",
                                                    "$ upcoming"
                                                ]
                                        ),
                                        children=[
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "<i>Upcoming</i> movies are those that will come out within the next 6 months."
                                                            ]
                                                    )
                                            )
                                        ]
                                ),
                                Input(
                                        Grammar(
                                                watson_items=[
                                                    "$ (GENRE)={Topic}",
                                                    "$ (UNSUPPORTED_GENRES)={Topic}"
                                                ]
                                        ),
                                        children=[
                                            TopicAction.set_to_value(),
                                            Output(
                                                    Prompt(
                                                            items=[
                                                                "I'm afraid I don't have definitions of the different genres."
                                                            ]
                                                    )
                                            )
                                        ]
                                )
                            ]
                    ),
                    Input(
                            Grammar(
                                    watson_items=[
                                        "I already told you!",
                                        "$ already told you",
                                        "$ already said it"
                                    ]
                            ),
                            children=[
                                Output(
                                        Prompt(
                                                items=["I'm sorry, please repeat it for me."]
                                        ),
                                        children=[Goto(ref="getUserInput_how_can_i_help_you")]
                                )
                            ]
                    )
                ]
        )
Exemplo n.º 19
0
from dialog.elements import Goto, Prompt, Output, GetUserInput, Folder
from dialog.elements.default import Default
from dialog.elements.search import Search
from dialog.schema.factories.search import PreliminarySequencesSearch

folder_how_can_i_help_sequences = Folder(
    _id="folder_how_can_i_help_you_sequences",
    children=[
        PreliminarySequencesSearch.create(),
        Search(ref="folder_routing_sequences"),
        Search(_id="search_2414740", ref="folder_base_sequences"),
        Default(children=[
            Output(
                is_insert_DNR_statement=True,
                prompt=Prompt(items=[
                    "I'm not sure what you mean. I can understand things like <i>Show me recent PG13-rated Action movies.</i>"
                ])
                # ,
                # children=[Goto(ref="##special_DNR_GET_USER_INPUT_NODE_ID")]
            )
        ])
    ])


class HowCanHelpYouInput:
    @staticmethod
    def goto():
        return Goto(ref=HowCanHelpYouInput.__id())

    @staticmethod
    def __id():
Exemplo n.º 20
0
 def create():
     return Folder(label="Global",
                   children=[Search(ref="folder_global_sequences")])
Exemplo n.º 21
0
 def create():
     return Folder(
         label="cdh",
         children=[
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Monday",
                         "Mon"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Tuesday",
                         "Tues"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Wednesday",
                         "Wed"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Thursday",
                         "Thurs",
                         "Thu"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Friday",
                         "Fri"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Saturday",
                         "Sat"
                     ]
                 )
             ),
             Concept(
                 grammar=Grammar(
                     watson_items=[
                         "Sunday",
                         "Sun"
                     ]
                 )
             )
         ]
     )
Exemplo n.º 22
0
 def create():
     from dialog.schema.factories.folder.sequences import SystemInitiatedSequences
     return Folder(
         selection_type="RANDOM",
         label="SMALL TALK SEQUENCES",
         children=[
             SmallTalkAction.create_increment(),
             Input(
                 Grammar(watson_items=[
                     "What is your name?", "$ your name", "$ you called",
                     "$ they call you", "$ what can I call you"
                 ]),
                 children=[
                     SmallTalkConditions.too_much_small_talk_goto(),
                     Output(
                         Prompt(items=["My name is Jemboo."]),
                         children=[
                             If(elements=[
                                 UserNameConditions.is_blank(),
                                 Output(
                                     Prompt(items=["What's your name?"]),
                                     children=[
                                         Goto(
                                             ref=
                                             "getUserInput_what_is_your_name"
                                         )
                                     ])
                             ]),
                             GetUserInput(children=[
                                 Input(Grammar(watson_items=[
                                     "Okay", "okay", "hi", "hi jemboo"
                                 ]),
                                       children=[
                                           Goto(ref="output_what_is_name")
                                       ]),
                                 Input(
                                     Grammar(
                                         watson_items=[
                                             "My name is", "$ my name",
                                             "$ call me", "$ I'm called",
                                             "$ I am called", "$ known as"
                                         ]),
                                     children=[
                                         Goto(ref="input_user_knownas_name")
                                     ]),
                                 PreliminarySequencesSearch.goto()
                             ])
                         ])
                 ]),
             Input(
                 Grammar(
                     watson_items=["Siri", "$ (VIRTUAL_AGENTS)={Topic}"]),
                 children=[
                     TopicAction.set_to_value(),
                     SmallTalkConditions.too_much_small_talk_goto(),
                     Input(
                         Grammar(watson_items=[
                             "is better", "$ better", "$ smarter"
                         ]),
                         children=[
                             Output(Prompt(
                                 items=["Now you're hurting my feelings."]),
                                    children=[
                                        GetUserInput(children=[
                                            Input(Grammar(watson_items=[
                                                "Okay", "$ sorry"
                                            ]),
                                                  children=[
                                                      SystemInitiatedSequences
                                                      .goto()
                                                  ]),
                                            PreliminarySequencesSearch.goto(
                                            )
                                        ])
                                    ])
                         ])
                 ]),
             Input(
                 Grammar(watson_items=[
                     "Do you speak English", "$ speak English",
                     "$ understand English", "$ know English",
                     "$ get English"
                 ]),
                 children=[
                     SmallTalkConditions.too_much_small_talk_goto(),
                     Output(
                         Prompt(items=[
                             "I'm sorry, English is my second language. My native tongue is Binary. 01110011 01101111 01110010 01110010 01111001"
                         ]),
                         children=[
                             GetUserInput(children=[
                                 Input(Grammar(watson_items=["haha", "ok"]),
                                       children=
                                       [SystemInitiatedSequences.goto()]),
                                 Input(Grammar(watson_items=[
                                     "01101110 01110000",
                                     "01101110 01101111 00100000 01110000 01110010 01101111 01100010 01101100 01100101 01101101",
                                     "01101110 01110000",
                                     "01100100 01101111 01101110 00100111 01110100 00100000 01110111 01101111 01110010 01110010 01111001"
                                 ]),
                                       children=[
                                           Output(
                                               Prompt(
                                                   items=[
                                                       "haha, you're good!"
                                                   ]),
                                               children=[
                                                   SystemInitiatedSequences.
                                                   goto()
                                               ])
                                       ]),
                                 PreliminarySequencesSearch.goto()
                             ])
                         ])
                 ])
         ])
Exemplo n.º 23
0
 def create():
     return Folder(
         label="Concepts",
         children=[
             StyleConcept.create(),
             ColorConcept.create(),
             CDHFolder.create(),
             Concept(grammar=GenericGrammar.create_hello()),
             Concept(grammar=GenericGrammar.create_yes_goodbye()),
             Concept(grammar=GenericGrammar.create_ok_thanks()),
             Concept(grammar=GenericGrammar.create_yes_full()),
             Concept(grammar=GenericGrammar.no()),
             Concept(grammar=GenericGrammar.create_haha()),
             Concept(grammar=GenericGrammar.create_sorry()),
             Concept(grammar=GenericGrammar.create_you()),
             Concept(grammar=Grammar(watson_items=[
                 "movie", "movies", "film", "films", "flick", "flicks"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "theater", "theaters", "theatre", "theatres", "cinema",
                 "cinemas"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "showtime", "showtimes", "show time", "show times",
                 "movie time", "movie times"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "dining", "restaurant", "restaurants", "place to eat",
                 "places to eat", "diner", "diners", "cafe", "cafes",
                 "cafeteria", "cafeterias", "Bar", "Bars", "Pub", "Pubs",
                 "Tavern", "Taverns", "Brewery", "Breweries",
                 "somewhere to eat", "eatery", "place to dine",
                 "somewhere nice to eat", "eateries", "places to dine",
                 "bistro", "a bistro", "bistros", "coffee shop",
                 "coffee shops", "coffee place", "coffee places",
                 "eating house", "eating houses", "snack bar", "snack bars",
                 "juice bar", "juice bars", "health food shop",
                 "fast food outlet", "fast food shop", "fast food outlets",
                 "fast food shops", "food court", "food courts",
                 "food mall", "food malls"
             ]),
                     _id="concept_place_to_eat"),
             Concept(grammar=Grammar(watson_items=[
                 "weather", "Rain", "Raining", "Snow", "Snowing", "Sunny",
                 "Cloudy", "Sleet", "Freezing Rain", "Windy", "Tornado",
                 "Hurricane"
             ]),
                     _id="concept_weather"),
             Concept(grammar=Grammar(watson_items=[
                 "traffic", "Traffic conditions", "Driving conditions",
                 "Road conditions", "Streets", "Roads", "Freeways",
                 "Highways", "Driving", "Rush hour", "Bus", "Buses",
                 "Train", "Trains", "Car", "Cars", "Automobile",
                 "Automobiles", "Bicycle", "Bicycles", "Bike", "Bikes",
                 "Motorcycle", "Motorcycles", "Walking", "Driving",
                 "Pedestrian"
             ]),
                     _id="concept_2456118"),
             Concept(grammar=Grammar(watson_items=["what is", "what's"])),
             Concept(grammar=Grammar(watson_items=[
                 "Review", "Reviews", "Critique", "Critiques", "Popularity",
                 "Tomatoes", "stars"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "Ratings", "Rating", "Popularity", "Tomatoes", "stars"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "it", "that", "Popularity", "Tomatoes", "stars"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "family-friendly", "family", "child", "children",
                 "childrens", "children's", "kiddy", "kids", "kid's", "kid",
                 "family friendly", "family safe", "kid friendly",
                 "child friendly", "safe for kids", "kid safe",
                 "suitable for children", "suitable for kids",
                 "suitable for a child", "suitable for a kid",
                 "child appropriate", "appropriate for children",
                 "not adult", "for families", "for a family", "no sex",
                 "no violence", "clean"
             ]),
                     _id="concept_family_friendly"),
             Concept(grammar=Grammar(watson_items=[
                 "near me", "by me", "my area", "close to me", "close by",
                 "nearby", "in the neighborhood", "local", "locally",
                 "fairly close", "close to us", "near to us", "short drive",
                 "short walk", "a short drive", "a short walk", "close",
                 "near", "around the corner", "just around the corner",
                 "short distance", "a short distance", "close at hand",
                 "short distance awat", "a short distance away",
                 "walking distance", "within walking distance",
                 "not a long distance", "not far", "not too far",
                 "not far away", "not too far away", "in my area",
                 "in the city", "my zipcode", "dowtown"
             ])),
             Concept(grammar=Grammar(watson_items=[
                 "Adult", "Adults Only", "NC 17", "NC-17", "NC17",
                 "NC 17 rated", "NC-17 rated", "NC-17-rated", "NC 17-rated",
                 "NC17 rated", "NC17-rated", "X", "X-rated", "X rated",
                 "XXX", "XXX-rated", "XXX rated", "Triple X",
                 "Triple X-rated", "Triple X rated", "NC seventeen",
                 "NC-seventeen"
             ]),
                     _id="concept_porn")
         ])
Exemplo n.º 24
0
 def create():
     return Folder(
         selection_type="RANDOM",
         label="OPENING SEQUENCES",
         children=[
             Input(
                 GenericGrammar.create_hello(),
                 children=[
                     GreetingAction.create_increment(),
                     If(elements=[
                         Condition(name=NAME_TERMINAL_EXCHANGE,
                                   operator="EQUAL_TO_YES"),
                         Goto(ref="output_welcome_back")
                     ]),
                     If(match_type="ANY",
                        elements=[
                            Condition(name=NAME_GREETING_COUNT,
                                      operator="GREATER_THEN",
                                      root_text="2"),
                            Condition(name=NAME_SMALL_TALK_COUNT,
                                      operator="GREATER_THEN",
                                      root_text="2"),
                            Goto(ref="output_end_of_small_talk")
                        ]),
                     Output(
                         Prompt(items=["Hello.", "Hi.", "Hi there."]),
                         children=[
                             Output(
                                 _id="output_how_are_you",
                                 prompt=Prompt(items=[
                                     "How are you today?",
                                     "How are you feeling today?",
                                     "How is it going?"
                                 ]),
                                 children=[
                                     GetUserInput(children=[
                                         Input(Grammar(watson_items=[
                                             "Movies",
                                             "$ (STYLE)={Style_Preference}",
                                             "$ (COLOR)={Color_Preference}",
                                             "$ movies"
                                         ]),
                                               children=[
                                                   Goto(
                                                       ref=
                                                       "input_main_search_criteria"
                                                   )
                                               ]),
                                         Input(
                                             FeelingGrammar.
                                             create_not_so_good(),
                                             children=[
                                                 Goto(
                                                     ref=
                                                     "output_sorry_to_hear_that"
                                                 )
                                             ]),
                                         Input(
                                             FeelingGrammar.
                                             create_not_so_bad(),
                                             children=[
                                                 Goto(ref=
                                                      "output_good_to_hear")
                                             ]),
                                         Input(
                                             FeelingGrammar.
                                             create_feeling_fine(),
                                             children=[
                                                 Output(
                                                     _id=
                                                     "output_good_to_hear",
                                                     prompt=Prompt(items=[
                                                         "Good to hear! <br> <br>"
                                                     ]),
                                                     children=[
                                                         HowCanHelpYouOutput
                                                         .goto()
                                                     ])
                                             ]),
                                         Input(
                                             FeelingGrammar.
                                             create_feeling_great(),
                                             children=[
                                                 Output(Prompt(items=[
                                                     "Fantastic! So glad to hear it. <br> <br>"
                                                 ]),
                                                        children=[
                                                            HowCanHelpYouOutput
                                                            .goto()
                                                        ])
                                             ]),
                                         Input(
                                             FeelingGrammar.
                                             create_feeling_bad(),
                                             children=[
                                                 Output(
                                                     _id=
                                                     "output_sorry_to_hear_that",
                                                     prompt=Prompt(items=[
                                                         "I'm sorry to hear that. <br> <br>"
                                                     ]),
                                                     children=[
                                                         HowCanHelpYouOutput
                                                         .goto()
                                                     ])
                                             ]),
                                         PreliminarySequencesSearch.goto()
                                     ])
                                 ])
                         ])
                 ]),
             Input(
                 Grammar(watson_items=[
                     "How are you", "$ how have you been doing",
                     "$ how is it going", "$ how are you",
                     "$ what's shaking", "$ what's up"
                 ]),
                 children=[
                     GreetingAction.create_increment(),
                     If(elements=[
                         Condition(name=NAME_GREETING_COUNT,
                                   operator="GREATER_THEN",
                                   root_text="2"),
                         Condition(name=NAME_SMALL_TALK_COUNT,
                                   operator="GREATER_THEN",
                                   root_text="2"),
                         Output(
                             _id="output_end_of_small_talk",
                             prompt=Prompt(items=[
                                 "You're very polite, but don't you want me to look up movies for you?"
                             ]),
                             children=[
                                 GetUserInput(children=[
                                     Input(GenericGrammar.yes(),
                                           children=[
                                               StylePreferenceProfileCheck.
                                               goto()
                                           ]),
                                     Input(GenericGrammar.no(),
                                           children=[
                                               GreetingAction.reset(),
                                               Output(
                                                   GenericPrompt.ok_fine())
                                           ]),
                                     Input(GenericGrammar.ok(),
                                           children=[
                                               StylePreferenceProfileCheck.
                                               goto()
                                           ]),
                                     PreliminarySequencesSearch.goto()
                                 ])
                             ])
                     ]),
                     Input(Grammar(watson_items=[
                         "Fine", "$ excellent", "$ outstanding",
                         "$ fabulous", "$ terrific", "$ not good",
                         "$ not so good", "$ not well", "$ not so well",
                         "$ terrible", "$ awful", "$ worst", "$ bored",
                         "$ sad", "$ good", "$ well", "$ fine", "$ thirsty",
                         "$ hungry", "$ tired"
                     ]),
                           children=[
                               Output(Prompt(
                                   items=["I am doing well, thanks."]),
                                      children=[HowCanHelpYouOutput.goto()])
                           ]),
                     Output(Prompt(items=["I am doing well, thanks."]),
                            children=[Goto(ref="output_how_are_you")])
                 ]),
             Input(
                 Grammar(watson_items=[
                     "Nice to meet you", "$ nice to meet you",
                     "$ pleasure to meet you", "$ make your acquaintance"
                 ]),
                 children=[
                     If(elements=[
                         Condition(name="Greeting_Count",
                                   operator="GREATER_THEN",
                                   root_text="2"),
                         Output(Prompt(items=[
                             "You're very polite, but don't you want me to look up movies for you?"
                         ]),
                                children=[
                                    GetUserInput(children=[
                                        Input(
                                            GenericGrammar.yes(),
                                            children=[
                                                StylePreferenceProfileCheck.
                                                goto()
                                            ]),
                                        Input(GenericGrammar.no(),
                                              children=[
                                                  GreetingAction.reset(),
                                                  Output(GenericPrompt.
                                                         ok_fine())
                                              ]),
                                        Input(
                                            GenericGrammar.ok(),
                                            children=[
                                                StylePreferenceProfileCheck.
                                                goto()
                                            ]),
                                        PreliminarySequencesSearch.goto()
                                    ])
                                ])
                     ]),
                     Output(Prompt(
                         items=["Nice to meet you too, {User_Name}!"]),
                            children=[HowCanHelpYouOutput.goto()])
                 ])
         ])
Exemplo n.º 25
0
 def create():
     return Folder(
         label="PRELIMINARY SEQUENCES",
         _id=PreliminarySequencesFolder._id(),
         children=[
             GreetingAction.reset(),
             SmallTalkAction.set_to_zero(),
             Input(
                 Grammar(watson_items=[
                     "Do you know", "$ do you know", "$ can you",
                     "$ do you have information", "$ can I",
                     "$ can you tell", "$ what kind of",
                     "$ what else do you know"
                 ]),
                 children=[
                     GreetingAction.reset(),
                     SmallTalkAction.set_to_zero(),
                     Input(
                         Grammar(watson_items=[
                             "out-of-scope movie topics",
                             "$ (OTHER_MOVIE)={Topic}"
                         ]),
                         children=[
                             TopicAction.set_to_value(),
                             Input(Grammar(watson_items=["what", "$ what"]),
                                   children=[
                                       Goto(ref="output_no_topic_lookup")
                                   ]),
                             Output(
                                 Prompt(items=["No."]),
                                 children=[
                                     Output(
                                         _id="output_no_topic_lookup",
                                         prompt=Prompt(items=[
                                             "I'm afraid I can't look up movies by {Topic}, only by Genre or MPAA Rating."
                                         ]),
                                         children=[
                                             GetUserInput(children=[
                                                 Input(
                                                     GenericGrammar.ok(),
                                                     children=[
                                                         HowCanHelpYouOutput
                                                         .goto()
                                                     ]),
                                                 PreliminarySequencesSearch.
                                                 goto()
                                             ])
                                         ])
                                 ])
                         ]),
                     Input(
                         Grammar(watson_items=[
                             "by out-of-scope movie topics",
                             "$ (BY_OTHER_MOVIE)={Topic}"
                         ]),
                         children=[
                             TopicAction.set_to_value(),
                             Input(
                                 Grammar(watson_items=["what", "$ what"]),
                                 children=[Goto(ref="output_2503370")]),
                             Output(
                                 Prompt(items=["No."]),
                                 children=[
                                     Output(
                                         _id="output_2503370",
                                         prompt=Prompt(items=[
                                             "I'm afraid I can't look up {Topic}, only Current and Upcoming movies by Genre or MPAA Rating.",
                                         ]),
                                         children=[
                                             GetUserInput(children=[
                                                 Input(Grammar(
                                                     watson_items=["Okay."
                                                                   ]),
                                                       children=[
                                                           HowCanHelpYouOutput
                                                           .goto()
                                                       ]),
                                                 PreliminarySequencesSearch.
                                                 goto()
                                             ])
                                         ])
                                 ])
                         ]),
                     Input(
                         Grammar(watson_items=[
                             "unsupported genres",
                             "$ (UNSUPPORTED_GENRES)={Topic}"
                         ]),
                         children=[
                             TopicAction.set_to_value(),
                             Input(
                                 grammar=Grammar(
                                     watson_items=["what", "$ what"]),
                                 children=[Goto(ref="output_2510164")]),
                             Output(
                                 Prompt(items=["No."]),
                                 children=[
                                     Output(
                                         _id="output_2510164",
                                         prompt=Prompt(items=[
                                             "I'm afraid {Topic} isn't a movie genre I know. Please try another one."
                                         ]),
                                         children=[
                                             GetUserInput(children=[
                                                 Input(grammar=Grammar(
                                                     watson_items=["Okay."
                                                                   ]),
                                                       children=[
                                                           HowCanHelpYouOutput
                                                           .goto()
                                                       ]),
                                                 PreliminarySequencesSearch.
                                                 goto()
                                             ])
                                         ])
                                 ])
                         ]),
                     # {
                     #     (0, "grammar"): {
                     #         "item": [
                     #             "theaters",
                     #             "$ theaters",
                     #             "$ fandango"
                     #         ]
                     #     },
                     #     (1, "input"): {
                     #         (0, "grammar"): {
                     #             "item": [
                     #                 "what",
                     #                 "$ what"
                     #             ]
                     #         },
                     #         (1, "goto"): {
                     #             "@ref": "output_2503320"
                     #         }
                     #     },
                     #     (2, "output"): {
                     #         (0, "prompt"): {
                     #             "item": "No."
                     #         },
                     #         (1, "output"): {
                     #             "@id": "output_2503320",
                     #             (0, "prompt"): {
                     #                 "item": "I'm afraid I cannot look up theaters myself, but I can give you a link to Fandango.com where you can buy tickets in your ZIP code. ",
                     #                 "@selectionType": "RANDOM"
                     #             },
                     #             (1, "getUserInput"): {
                     #                 (0, "input"): {
                     #                     (0, "grammar"): GenericGrammar.ok(),
                     #                     (1, "goto"): HowCanHelpYouOutput.goto()
                     #                 },
                     #                 (1, "goto"): PreliminarySequencesSearch.goto()
                     #             }
                     #         }
                     #     }
                     # },
                     Input(Grammar(
                         watson_items=["$ (STYLE)={Style_Preference}"]),
                           children=[
                               StylePreferenceAction.set_to_value(),
                               Goto(ref="search_2414740")
                           ]),
                     Input(
                         Grammar(watson_items=["genres", "$ genres"]),
                         children=[
                             Output(Prompt(items=[
                                 "Action, adventure, animated, comedy, crime, documentary, drama, family, fantasy, foreign, historical, horror, music, mystery, romance, science fiction, TV movie, thriller, war movies and western.  <br> <br>"
                             ]),
                                    children=[
                                        GetUserInput(children=[
                                            Input(GenericGrammar.ok(),
                                                  children=[
                                                      HowCanHelpYouOutput.
                                                      goto()
                                                  ]),
                                            PreliminarySequencesSearch.goto(
                                            )
                                        ])
                                    ])
                         ]),
                     # {
                     #     (0, "grammar"): {
                     #         "item": [
                     #             "old movies",
                     #             "$ old movies",
                     #             "$ classic movies",
                     #             "$ oldies",
                     #             "$ classics"
                     #         ]
                     #     },
                     #     (1, "input"): {
                     #         (0, "grammar"): {
                     #             "item": [
                     #                 "what",
                     #                 "$ what"
                     #             ]
                     #         },
                     #         (1, "goto"): {
                     #             "@ref": "output_2503380"
                     #         }
                     #     },
                     #     (2, "output"): {
                     #         (0, "prompt"): {
                     #             "item": "No."
                     #         },
                     #         (1, "output"): {
                     #             "@id": "output_2503380",
                     #             (0, "prompt"): {
                     #                 "item": "I'm afraid I cannot look up Old Movies, only Current and Upcoming.",
                     #                 "@selectionType": "RANDOM"
                     #             },
                     #             (1, "getUserInput"): {
                     #                 (0, "input"): {
                     #                     (0, "grammar"): GenericGrammar.ok(),
                     #                     (1, "goto"): HowCanHelpYouOutput.goto()
                     #                 },
                     #                 (1, "goto"): PreliminarySequencesSearch.goto()
                     #             }
                     #         }
                     #     }
                     # },
                     Input(
                         Grammar(watson_items=["shoes", "$ shoes"]),
                         children=[
                             TopicAction.set_to_shoes(),
                             Input(
                                 Grammar(watson_items=["what", "$ what"]),
                                 children=[
                                     Goto(ref="output_what_jemboo_knows")
                                 ]),
                             Output(
                                 prompt=Prompt(items=["Yes."]),
                                 children=[
                                     Output(
                                         _id="output_what_jemboo_knows",
                                         prompt=Prompt(items=[
                                             "I can look up current and upcoming movies by Genre or MPAA Rating and show you trailers for them. But I'm afraid I cannot search by number of stars or by movie titles or actor and director names at this time.",
                                         ]),
                                         children=[
                                             GetUserInput(children=[
                                                 Input(
                                                     GenericGrammar.ok(),
                                                     children=[
                                                         HowCanHelpYouOutput
                                                         .goto()
                                                     ]),
                                                 PreliminarySequencesSearch.
                                                 goto()
                                             ])
                                         ])
                                 ])
                         ]),
                     # {
                     #     (0, "grammar"): {
                     #         "item": [
                     #             "trailer",
                     #             "$ trailer",
                     #             "$ trailers"
                     #         ]
                     #     },
                     #     (1, "input"): {
                     #         (0, "grammar"): {
                     #             "item": [
                     #                 "what",
                     #                 "$ what"
                     #             ]
                     #         },
                     #         (1, "goto"): {
                     #             "@ref": "output_2510290"
                     #         }
                     #     },
                     #     (2, "output"): {
                     #         (0, "prompt"): {
                     #             "item": "Yes."
                     #         },
                     #         (1, "output"): {
                     #             "@id": "output_2510290",
                     #             (0, "prompt"): {
                     #                 "item": "After searching for movies, you can click on a particular movie result to watch its <i>trailer</i>, or video preview.",
                     #                 "@selectionType": "RANDOM"
                     #             },
                     #             (1, "getUserInput"): {
                     #                 (0, "input"): {
                     #                     (0, "grammar"): GenericGrammar.ok(),
                     #                     (1, "goto"): HowCanHelpYouOutput.goto()
                     #                 },
                     #                 (1, "goto"): PreliminarySequencesSearch.goto()
                     #             }
                     #         }
                     #     }
                     # },
                     Input(
                         Grammar(watson_items=[
                             "out-of-scope topics", "$ (DINING)={Topic}",
                             "$ (WEATHER)={Topic}", "$ (TRAFFIC)={Topic}"
                         ]),
                         children=[
                             TopicAction.set_to_value(),
                             OutOfScopeCountAction.increment(),
                             If(elements=[
                                 OutOfScopeCountConditions.is_greater_then(
                                     "2"),
                                 Output(Prompt(items=[
                                     "I'm sorry I don't know about that. Can I look up some shoes for you?"
                                 ]),
                                        children=[
                                            GetUserInput(children=[
                                                Input(
                                                    GenericGrammar.yes(),
                                                    children=[
                                                        StylePreferenceProfileCheck
                                                        .goto()
                                                    ]),
                                                Input(
                                                    GenericGrammar.no(),
                                                    children=[
                                                        Action(
                                                            var_name=
                                                            "Out-of-Scope_Count",
                                                            operator=
                                                            "SET_TO",
                                                            text="0"),
                                                        Output(prompt=
                                                               GenericPrompt
                                                               .ok_fine())
                                                    ]),
                                                Input(
                                                    GenericGrammar.ok(),
                                                    children=[
                                                        StylePreferenceProfileCheck
                                                        .goto()
                                                    ]),
                                                PreliminarySequencesSearch.
                                                goto()
                                            ])
                                        ])
                             ]),
                             Input(Grammar(watson_items=["what", "$ what"]),
                                   children=[Goto(ref="output_2497989")]),
                             Output(
                                 Prompt(items=["No."]),
                                 children=[
                                     Output(
                                         _id="output_2497989",
                                         prompt=Prompt(items=[
                                             "I'm afraid I don't know much about {Topic}. Just movies."
                                         ]),
                                         children=[
                                             GetUserInput(children=[
                                                 Input(Grammar(
                                                     watson_items=["Okay."
                                                                   ]),
                                                       children=[
                                                           HowCanHelpYouOutput
                                                           .goto()
                                                       ]),
                                                 PreliminarySequencesSearch.
                                                 goto()
                                             ])
                                         ])
                                 ])
                         ]),
                     Goto(ref="output_what_jemboo_knows")
                 ])
         ])