diff --git a/.gitignore b/.gitignore index e43c0393..5c21aeab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__ # python local dev venv +.venv .DS_Store .idea diff --git a/core/cat/looking_glass/cheshire_cat.py b/core/cat/looking_glass/cheshire_cat.py index 4b43e270..4dc91968 100644 --- a/core/cat/looking_glass/cheshire_cat.py +++ b/core/cat/looking_glass/cheshire_cat.py @@ -84,6 +84,8 @@ def __init__(self): # i.e. finished uploading a file self.ws_messages: Dict[str, asyncio.Queue] = {} + self._loop = asyncio.get_event_loop() + def load_natural_language(self): """Load Natural Language related objects. @@ -379,7 +381,7 @@ def send_ws_message(self, content: str, msg_type: MSG_TYPES = "notification", wo raise ValueError(f"The message type `{msg_type}` is not valid. Valid types: {', '.join(options)}") if msg_type == "error": - asyncio.run( + self._loop.create_task( working_memory.ws_messages.put( { "type": msg_type, @@ -389,7 +391,7 @@ def send_ws_message(self, content: str, msg_type: MSG_TYPES = "notification", wo ) ) else: - asyncio.run( + self._loop.create_task( working_memory.ws_messages.put( { "type": msg_type,