示例#1
0
 def create():
     return Output(
         _id=StartSearch.__id(),
         prompt=Prompt(
             items=["Would you like to find a specific style of shoe?"]
             # "Would you like to find a movie that's now playing or coming soon?"
         ),
         children=[
             GetUserInput(children=[
                 # TODO Not sure how this is useful
                 # (0, "input"): {
                 #     (0, "grammar"): {
                 #         "item": "$ (DATE_TIME_RANGE)={DateTime_Mentioned_ENT}"
                 #     },
                 #     (1, "action"): {
                 #         "@varName": "DateTime_Current",
                 #         "@operator": "SET_TO",
                 #         "#text": "<mct:getTime>America/Tijuana</mct:getTime>"
                 #     },
                 #     (2, "goto"): Goto(ref="input_date_time")
                 # },
                 Input(Grammar(
                     watson_items=["neither", "neither", "$ either", "no"]),
                       children=[
                           Output(prompt=GenericPrompt.ok(),
                                  children=[HowCanHelpYouOutput.goto()])
                       ]),
                 Input(
                     GenericGrammar.yes_okay(wildcard=False),
                     children=[
                         Output(Prompt(items=[
                             "Please tell me the style you would like then.",
                             "Ok great what style would you like?"
                         ]),
                                children=[
                                    StylePreferenceProfileCheckInput.goto()
                                ])
                     ]),
                 Input(Grammar(watson_items=[
                     "My name is", "$ my name is", "$ I am", "$ I'm",
                     "$ called", "$ call me", "$ known as"
                 ]),
                       children=[
                           Output(prompt=Prompt(items=["Sorry."]),
                                  children=[
                                      Goto(ref="input_user_knownas_name")
                                  ])
                       ]),
                 PreliminarySequencesSearch.goto()
             ])
         ])
示例#2
0
 def create():
     return Output(
         _id=StartSearch.__id(),
         prompt=Prompt(
             items=["Would you like to find a specific style of shoe?"]
             # "Would you like to find a movie that's now playing or coming soon?"
         ),
         children=[
             GetUserInput(
                 children=[
                     # TODO Not sure how this is useful
                     # (0, "input"): {
                     #     (0, "grammar"): {
                     #         "item": "$ (DATE_TIME_RANGE)={DateTime_Mentioned_ENT}"
                     #     },
                     #     (1, "action"): {
                     #         "@varName": "DateTime_Current",
                     #         "@operator": "SET_TO",
                     #         "#text": "<mct:getTime>America/Tijuana</mct:getTime>"
                     #     },
                     #     (2, "goto"): Goto(ref="input_date_time")
                     # },
                     Input(
                         Grammar(
                                 watson_items=[
                                     "neither",
                                     "neither",
                                     "$ either",
                                     "no"
                                 ]
                             ),
                         children=[
                             Output(
                                 prompt=GenericPrompt.ok(),
                                 children=[HowCanHelpYouOutput.goto()]
                             )
                         ]
                     ),
                     Input(
                         GenericGrammar.yes_okay(wildcard=False),
                         children=[
                             Output(
                                 Prompt(
                                     items=[
                                         "Please tell me the style you would like then.",
                                         "Ok great what style would you like?"
                                     ]
                                 ),
                                 children=[StylePreferenceProfileCheckInput.goto()]
                             )
                         ]
                     ),
                     Input(
                         Grammar(
                                 watson_items=[
                                     "My name is",
                                     "$ my name is",
                                     "$ I am",
                                     "$ I'm",
                                     "$ called",
                                     "$ call me",
                                     "$ known as"
                                 ]
                             ),
                         children=[
                             Output(
                                 prompt=Prompt(items=["Sorry."]),
                                 children=[
                                     Goto(ref="input_user_knownas_name")
                                 ]
                             )
                         ]
                     ),
                     PreliminarySequencesSearch.goto()
                 ]
             )
         ]
     )
示例#3
0
 def create():
     return GetUserInput(
             _id=ColorPreferenceProfileCheckInput.__id(),
             children=[
                 Input(
                         Grammar(
                                 watson_items=[
                                     "What",
                                     "$ what",
                                     "$ which",
                                     "$ tell me"
                                 ]
                         ),
                         children=[
                             Input(
                                     Grammar(
                                             watson_items=[
                                                 "colors",
                                                 "$ they",
                                                 "$ ones",
                                                 "$ choices",
                                                 "$ options",
                                                 "$ ratings",
                                                 "$ certifications",
                                                 "$ what else"
                                             ]
                                     ),
                                     children=[
                                         Output(
                                                 Prompt(
                                                         items=["Black, White, Red, Brown or Green <br> <br>"]
                                                 ),
                                                 children=[ColorPreferenceProfileCheckInput.goto()]
                                         )
                                     ]
                             )
                         ]
                 ),
                 Input(
                         Grammar(
                                 watson_items=[
                                     "Color",
                                     "$ (COLOR)={Color_Preference}"
                                 ]
                         ),
                         children=[
                             CurrentIndexAction.set_to_zero(),
                             PageAction.set_to_new(),
                             SearchNowAction.set_to_no(),
                             ColorPreferenceAction.set_to_value(),
                             Goto(ref="output_ok_do_search")
                         ]
                 ),
                 # TODO NOT SUPPORTED PATH
                 # {
                 #     (0, "grammar"): {
                 #         "item": [
                 #             "NC-17",
                 #             "$ NC-17"
                 #         ]
                 #     },
                 #     (1, "output"): {
                 #         (0, "prompt"): {
                 #             "item": "I'm afraid I cannot look up NC-17-rated movies.",
                 #             "@selectionType": "RANDOM"
                 #         },
                 #         (1, "goto"): {
                 #             "@ref": "getUserInput_2443780a"
                 #         }
                 #     }
                 # },
                 Input(
                         Grammar(
                                 watson_items=[
                                     "No",
                                     "$ don't care",
                                     "$ don't know",
                                     "$ no preference",
                                     "$ no",
                                     "$ none",
                                     "$ all",
                                     "$ any",
                                     "$ anything",
                                     "$ whatever",
                                     "$ nothing specific",
                                     "$ don't have a preference"
                                 ]
                         ),
                         children=[
                             CurrentIndexAction.set_to_zero(),
                             PageAction.set_to_new(),
                             Goto(ref="output_2456875")
                         ]
                 ),
                 Input(
                         GenericGrammar.yes_okay(wildcard=False),
                         children=[
                             Output(
                                     Prompt(items=["Which one?"]),
                                     children=[ColorPreferenceProfileCheckInput.goto()]
                             )
                         ]
                 ),
                 PreliminarySequencesSearch.goto()
             ]
     )