Skip to content

Commit

Permalink
testing for json error
Browse files Browse the repository at this point in the history
  • Loading branch information
star-nox committed Sep 13, 2023
1 parent aee14dd commit c321225
Show file tree
Hide file tree
Showing 3 changed files with 1,922 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ai_ta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ def logToNomic():

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

return response


if __name__ == '__main__':
Expand Down
3 changes: 3 additions & 0 deletions ai_ta_backend/nomic_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def log_convo_to_nomic(course_name: str, conversation) -> str:
embeddings = map_embeddings_df[prev_index-1].reshape(1, 1536)
prev_convo = prev_data['conversation'].values[0]
prev_id = prev_data['id'].values[0]
print("prev_id: ", prev_id)
prev_created_at = prev_data['created_at'].values[0]
print("prev_created_at: ", prev_created_at)
print("before delete")

# delete that convo data point from Nomic
project.delete_data([prev_id])
Expand Down
Loading

0 comments on commit c321225

Please sign in to comment.