import os import time import config_handler from interfaces.local_interface.local_interface import LocalInterface from nlp.conversation_handler import ConversationHandler # Set cwd to this scripts dir so all file paths # still work when calling from another directory. os.chdir(os.path.dirname(os.path.realpath(__file__))) handler = ConversationHandler(LocalInterface()) update_delay = config_handler.get_config_key('config.json', 'update_delay') while True: handler.update() time.sleep(update_delay)
import os import time import config_handler from interfaces.telegram_interface.telegram_interface import TelegramInterface from interfaces.local_interface.local_interface import LocalInterface from nlp.conversation_handler import ConversationHandler # Set cwd to this scripts dir so all file paths # still work when calling from another directory. os.chdir(os.path.dirname(os.path.realpath(__file__))) handler1 = ConversationHandler(LocalInterface()) handler2 = ConversationHandler(TelegramInterface()) update_delay = config_handler.get_config_key('config.json', 'update_delay') while True: handler1.update() handler2.update() time.sleep(update_delay)