diff --git a/chat_client/app.py b/chat_client/app.py index 96ad43dd..8272eb9b 100644 --- a/chat_client/app.py +++ b/chat_client/app.py @@ -114,9 +114,10 @@ async def custom_http_exception_handler(request, exc): allow_methods=["*"], allow_headers=["*"], ) - static_suffix = ( - "/build" if os.environ.get("KLAT_ENV", "dev").upper() == "PROD" else "" - ) + # static_suffix = ( + # "/build" if os.environ.get("KLAT_ENV", "dev").upper() == "PROD" else "" + # ) + static_suffix = "" chat_app.mount( "/css", StaticFiles(directory=f"chat_client/static/css{static_suffix}"), diff --git a/chat_server/sio.py b/chat_server/sio.py index 4216b2ab..bbb41dd5 100644 --- a/chat_server/sio.py +++ b/chat_server/sio.py @@ -234,7 +234,12 @@ async def user_message(sid, data): mongo_queries.add_shout(data=new_shout_data) if is_announcement == "0" and data.get("prompt_id"): - is_ok = MongoDocumentsAPI.PROMPTS.add_shout_to_prompt(data) + is_ok = MongoDocumentsAPI.PROMPTS.add_shout_to_prompt( + prompt_id=data["prompt_id"], + user_id=data["userID"], + message_id=data["message_id"], + prompt_state=data["promptState"], + ) if is_ok: await sio.emit( "new_prompt_message", @@ -312,6 +317,8 @@ async def prompt_completed(sid, data): """ prompt_id = data["context"]["prompt"]["prompt_id"] + LOG.info(f"setting {prompt_id = } as completed") + MongoDocumentsAPI.PROMPTS.set_completed( prompt_id=prompt_id, prompt_context=data["context"] ) @@ -704,6 +711,7 @@ async def emit_error( """ if not context: context = {} + LOG.error(message) await sio.emit( context.pop("callback_event", "klatchat_sio_error"), data={"msg": message}, diff --git a/services/klatchat_observer/controller.py b/services/klatchat_observer/controller.py index f8a3b141..c6e71647 100644 --- a/services/klatchat_observer/controller.py +++ b/services/klatchat_observer/controller.py @@ -712,19 +712,19 @@ def handle_saving_prompt_data(self, body: dict): @create_mq_callback() def on_stt_response(self, body: dict): """Handles receiving STT response""" - LOG.info(f"Received STT Response: {body}") + LOG.debug(f"Received STT Response: {body}") self.sio.emit("stt_response", data=body) @create_mq_callback() def on_tts_response(self, body: dict): """Handles receiving TTS response""" - LOG.info(f"Received TTS Response: {body}") + LOG.debug(f"Received TTS Response: {body}") self.sio.emit("tts_response", data=body) @create_mq_callback() def on_subminds_state(self, body: dict): """Handles receiving subminds state message""" - LOG.info(f"Received submind state: {body}") + LOG.debug(f"Received submind state: {body}") body["msg_type"] = "subminds_state" self.sio.emit("broadcast", data=body) diff --git a/utils/database_utils/mongo_utils/queries/dao/prompts.py b/utils/database_utils/mongo_utils/queries/dao/prompts.py index c09731f3..f1ec6c55 100644 --- a/utils/database_utils/mongo_utils/queries/dao/prompts.py +++ b/utils/database_utils/mongo_utils/queries/dao/prompts.py @@ -127,7 +127,7 @@ def get_prompts( def add_shout_to_prompt( self, prompt_id: str, user_id: str, message_id: str, prompt_state: PromptStates - ): + ) -> bool: prompt = self.get_item(item_id=prompt_id) if prompt and prompt["is_completed"] == "0": if ( @@ -157,6 +157,7 @@ def add_shout_to_prompt( data={f"data.{store_key}": store_data}, data_action="push" if store_type == list else "set", ) + return True def _add_participant(self, prompt_id: str, user_id: str): return self._execute_query(