diff --git a/dialog_with_nlg.py b/dialog_with_nlg.py index 1a47879..83dc51e 100644 --- a/dialog_with_nlg.py +++ b/dialog_with_nlg.py @@ -1,5 +1,6 @@ import string from typing import Any, List, Tuple +import os import jsgf from unidecode import unidecode @@ -255,9 +256,25 @@ class NLG(): return random.choice(self.messages["reqmore"]) elif act == "offer": - return "Proszę oto menu zeskanuj kod QR aby je zobaczyć." + return "Oto nasze menu: tatar, poledwica, pizza, tiramisu, zrazy [wolowe], pyzy, placki, makaron, picia, zupa, ryba, zupe grzybowa, stek \n Pragniemy zaznaczyć, że nie które dania mogą być niedostępne" +def ascii_jarvis(): + print('''' + ____. _____ ______________ ____.___ _________ + | | / _ ______ \ \ / /| |/ _____/ + | |/ /_\ \| _/\ Y / | |\_____ \ + /\__| / | \ | \ \ / | |/ | + \________\____|__ /____|_ / \___/ |___/_______ / + \/ \/ \/ ' ''') + +def clear_console(): + operating_system = os.name + if operating_system == 'nt': + os.system('cls') + else: + os.system('clear') + def dialogue_test(): model = Model() @@ -329,21 +346,18 @@ def dialogue_test(): if __name__ == "__main__": model = Model() - print('''' - ____. _____ ______________ ____.___ _________ - | | / _ ______ \ \ / /| |/ _____/ - | |/ /_\ \| _/\ Y / | |\_____ \ - /\__| / | \ | \ \ / | |/ | - \________\____|__ /____|_ / \___/ |___/_______ / - \/ \/ \/ ' ''') + ascii_jarvis() print("Chatbot Jarvis\n--------------") + print("Dostępe komendy: \n\n- SYSTEM_FINISH - zakończenie rozmowy\n- Pokaz menu - wyświetlenie menu\n") while True: print("\nUżytkownik: ") user_input = input() while user_input == "SYSTEM_FINISH": - print("\n\n\n\n\n\n\n\n\n\n\n\n") + clear_console() model = Model() + ascii_jarvis() print("Chatbot Jarvis\n--------------") + print("Dostępe komendy: \n- SYSTEM_FINISH - zakończenie rozmowy\n- Pokaz menu - wyświetlenie menu\n") print("\nUżytkownik: ") user_input = input() response = model(user_input, debug=False)