Skip to content

Commit

Permalink
Merge branch 'nomic-map-creation' of https://github.com/UIUC-Chatbot/…
Browse files Browse the repository at this point in the history
…ai-ta-backend into nomic-map-creation
  • Loading branch information
star-nox committed Nov 20, 2023
2 parents c5d9aae + 1ffa5bd commit caf58ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ai_ta_backend/nomic_logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datetime
import inspect
import os
import time
import traceback
import requests
import nomic
import numpy as np
Expand Down Expand Up @@ -141,8 +143,9 @@ def log_convo_to_nomic(course_name: str, conversation) -> str:
return f"Successfully logged for {course_name}"
else:
# for rest of the errors - return fail
print("ERROR in log_convo_to_nomic():", e)
return f"Logging failed for {course_name}"
err = f"❌❌ Error in log_convo_to_nomic() for course `{course_name}`: {e}\nTraceback: {traceback.extract_tb(e.__traceback__)}" # type: ignore
print(err)
return err


def get_nomic_map(course_name: str):
Expand Down Expand Up @@ -442,8 +445,9 @@ def create_map_for_all_courses():
project.create_index(index_name, build_topic_model=True)
return "Maps created for all courses!"
except Exception as e:
print("Failed to create map due to error: ", e)
return "Failed!"
err = f"❌❌ Failed to create map create_map_for_all_courses(): {e}\nTraceback: {traceback.extract_tb(e.__traceback__)}" # type: ignore
print(err)
return err

if __name__ == '__main__':
pass

0 comments on commit caf58ca

Please sign in to comment.