Skip to content

Commit

Permalink
removed executor bec of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
star-nox committed Mar 28, 2024
1 parent 9c0c031 commit 78e92e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ai_ta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,15 @@ def createConversationMap(service: NomicService):
return response

@app.route('/logToConversationMap', methods=['GET'])
def logToConversationMap(service: NomicService):
def logToConversationMap(service: NomicService, flaskExecutor: ExecutorInterface):
course_name: str = request.args.get('course_name', default='', type=str)

if course_name == '':
# proper web error "400 Bad request"
abort(400, description=f"Missing required parameter: 'course_name' must be provided. Course name: `{course_name}`")

map_id = service.log_to_conversation_map(course_name)
#map_id = flaskExecutor.submit(service.log_to_conversation_map, course_name)

response = jsonify(map_id)
response.headers.add('Access-Control-Allow-Origin', '*')
Expand All @@ -244,7 +245,8 @@ def logToNomic(service: NomicService, flaskExecutor: ExecutorInterface):
print(f"In /onResponseCompletion for course: {course_name}")

# background execution of tasks!!
response = flaskExecutor.submit(service.log_convo_to_nomic, course_name, data)
#response = flaskExecutor.submit(service.log_convo_to_nomic, course_name, data)
response = flaskExecutor.submit(service.log_to_conversation_map, course_name)
response = jsonify({'outcome': 'success'})
response.headers.add('Access-Control-Allow-Origin', '*')
return response
Expand Down

0 comments on commit 78e92e6

Please sign in to comment.