Esempio n. 1
0
         PROCESSING: {
             "set_flag": loc_prs.set_flag("art_skill_active"),
             "set_confidence": loc_prs.set_start_confidence,
         },
     },
     "photo_q": {
         RESPONSE: ["Do you like taking photos?"],
         TRANSITIONS: {
             ("photo", "what_photos"):
             cnd.any(
                 [int_cnd.is_yes_vars,
                  cnd.regexp(templates.LIKE_PATTERN)])
         },
         PROCESSING: {
             "set_flag": loc_prs.set_flag("art_skill_active"),
             "set_confidence": int_prs.set_confidence(SUPER_CONFIDENCE),
         },
     },
 },
 "drawing": {
     "what_painter": {
         RESPONSE: "Pictures of what painters do you like?",
         TRANSITIONS: {
             lbl.forward(): cnd.true()
         },
         PROCESSING: {
             "set_confidence": int_prs.set_confidence(HIGH_CONFIDENCE)
         },
     },
     "what_paintings": {
         RESPONSE:
Esempio n. 2
0
     "start": {
         RESPONSE: "",
         TRANSITIONS: {("greeting", "node1"): cnd.true()},
     },
     "fallback": {
         RESPONSE: "Ooops",
         TRANSITIONS: {
             lbl.previous(): cnd.regexp(r"previous", re.IGNORECASE),
             lbl.repeat(0.2): cnd.true(),
         },
     },
 },
 "greeting": {
     LOCAL: {
         PROCESSING: {
             "set_confidence": int_prs.set_confidence(1.0),
             "set_can_continue": int_prs.set_can_continue(),
             # "fill_responses_by_slots": int_prs.fill_responses_by_slots(),
         },
     },
     "node1": {
         RESPONSE: int_rsp.multi_response(replies=["Hi, how are you?", "Hi, what's up?"]),  # several hypothesis
         PROCESSING: {
             "save_slots_to_ctx": int_prs.save_slots_to_ctx({"topic": "science", "user_name": "Gordon Freeman"})
         },
         TRANSITIONS: {"node2": cnd.regexp(r"how are you", re.IGNORECASE)},
     },
     "node2": {
         RESPONSE: loc_rsp.example_response("Good. What do you want to talk about?"),
         # loc_rsp.example_response is just for an example, you can use just str without example_response func
         TRANSITIONS: {"node3": loc_cnd.example_lets_talk_about()},
Esempio n. 3
0
             ("books_general", "book_start"): loc_cnd.start_condition,
             lbl.repeat(): cnd.true(),
         },
     },
     "fallback": {
         RESPONSE: loc_rsp.append_unused(
             initial="Anyway, let's talk about something else! ",
             phrases=[
                 SWITCH_MOVIE_SKILL_PHRASE,
                 OFFER_TALK_ABOUT_SCIENCE,
                 "What's on your mind?",
             ],
         ),
         PROCESSING: {
             "set_flag": loc_prs.set_flag("book_skill_active"),
             "set_confidence": int_prs.set_confidence(ZERO_CONFIDENCE),
             "set_can_continue": int_prs.set_can_continue(CAN_NOT_CONTINUE),
         },
         TRANSITIONS: {},
     },
 },
 "books_general": {
     "book_start": {
         RESPONSE: loc_rsp.append_unused("", [loc_rsp.START_PHRASE]),
         PROCESSING: {
             "set_confidence": int_prs.set_confidence(SUPER_CONFIDENCE),
             "set_flag": loc_prs.set_flag("book_skill_active", True),
             "execute_response": loc_prs.execute_response,
         },
         TRANSITIONS: {
             "dislikes_reading": int_cnd.is_no_vars,
Esempio n. 4
0
     TRANSITIONS: {
         ("funfact", "thematic", 1.1): loc_cnd.thematic_funfact_condition
     },
 },
 "service": {
     LOCAL: {
         TRANSITIONS: {
             ("funfact", "random"): loc_cnd.random_funfact_condition
         }
     },
     "start": {
         RESPONSE: ""
     },
     "fallback": {
         PROCESSING: {
             "set_confidence": int_prs.set_confidence(ZERO_CONFIDENCE)
         },
         RESPONSE: "",
     },
 },
 "funfact": {
     LOCAL: {
         TRANSITIONS: {
             ("funfact", "random"):
             cnd.any([
                 loc_cnd.random_funfact_condition,
                 loc_cnd.another_funfact_condition
             ])
         }
     },
     "random": {
Esempio n. 5
0
                         forecast_requested_condition,
                         forecast_intent_condition
                     ]),
                 ]),
             ]),
             ("weather", "location_request"):
             cnd.any(
                 [forecast_requested_condition, forecast_intent_condition]),
             ("weather", "continue_question"):
             chat_about_weather_condition,
         },
     },
     "fallback": {
         RESPONSE: "Oops",
         PROCESSING: {
             "set_confidence": int_prs.set_confidence(ZERO_CONF)
         },
     },
 },
 "weather": {
     "forecast": {
         RESPONSE: forecast_response,
         TRANSITIONS: {
             "activity_question": cnd.true()
         }
     },
     "location_request": {
         RESPONSE:
         "Hmm. Which particular city would you like a weather forecast for?",
         PROCESSING: {
             "location_request_processing": location_request_processing