diff --git a/ai_ta_backend/nomic_logging.py b/ai_ta_backend/nomic_logging.py index 146b572c..cf5bc699 100644 --- a/ai_ta_backend/nomic_logging.py +++ b/ai_ta_backend/nomic_logging.py @@ -82,7 +82,10 @@ def log_convo_to_nomic(course_name: str, conversation) -> str: print("type of conversation:", type(conversation)) #conversation = json.loads(conversation) messages = conversation['conversation']['messages'] - user_email = conversation['conversation']['user_email'] + if 'user_email' not in conversation['conversation']: + user_email = "NULL" + else: + user_email = conversation['conversation']['user_email'] conversation_id = conversation['conversation']['id'] # we have to upload whole conversations