from parser import nlu request = input() result = nlu(request) for slot in result['slots']: if slot[0] == "time_when" and slot[1] == None: print("Z jakiego okresu czasu chcesz zobaczyć powiadomienia?") while True: response = input() responseResult = nlu(response) liczba = list(filter(lambda s : s[0] == "liczba", responseResult['slots'])) timeunit = list(filter(lambda s : s[0] == "timeunit", responseResult['slots'])) if len(timeunit) != 0: print("{} {}".format(liczba, timeunit)) break else: print("Nieprawidłowy czas, spróbuj jeszcze raz") if slot[0] == "repo" and (slot[1] == None or slot[1] == ""): print("Z jakiego repozytorium?") response = input() print("Wybrane repozytorium: {}".format(response)) if result['act'] == "pomoc": print("Mogę opisać aktywność w Twoich repozytoriach, opowiedzieć o Twoich Pull Requestach.")