diff --git a/ai_ta_backend/main.py b/ai_ta_backend/main.py index b8edc68d..afc32c71 100644 --- a/ai_ta_backend/main.py +++ b/ai_ta_backend/main.py @@ -448,12 +448,13 @@ def nomic_map(): @app.route('/onResponseCompletion', methods=['POST']) def logToNomic(): - # data = request.get_json() - # course_name = data['course_name'] - # conversation = data['conversation'] + + data = request.get_json() + course_name = data['course_name'] + conversation = data['conversation'] - course_name: str = request.args.get('course_name', default='', type=str) - conversation: str = request.args.get('conversation', default='', type=str) + #course_name: str = request.args.get('course_name', default='', type=str) + #conversation: str = request.args.get('conversation', default='', type=str) if course_name == '' or conversation == '': # proper web error "400 Bad request" @@ -465,8 +466,8 @@ def logToNomic(): print(f"In /onResponseCompletion for course: {course_name}") # background execution of tasks!! - #response = executor.submit(log_convo_to_nomic, course_name, data) - response = executor.submit(log_convo_to_nomic, course_name, conversation) + response = executor.submit(log_convo_to_nomic, course_name, data) + #response = executor.submit(log_convo_to_nomic, course_name, conversation) response = jsonify({'outcome': 'success'}) response.headers.add('Access-Control-Allow-Origin', '*') return response