From 1e350daf0f182f9423e72cbf75e5938775b4ce9b Mon Sep 17 00:00:00 2001 From: star-nox Date: Wed, 8 Nov 2023 12:54:59 -0600 Subject: [PATCH] created API endpoint --- ai_ta_backend/export_data.py | 11 +++++++++++ ai_ta_backend/main.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ai_ta_backend/export_data.py b/ai_ta_backend/export_data.py index e69de29b..8fd66a24 100644 --- a/ai_ta_backend/export_data.py +++ b/ai_ta_backend/export_data.py @@ -0,0 +1,11 @@ +import os +import datetime +import pandas as pd +import supabase + +def export_convo_history_csv(course_name: str, from_date= None, to_date= None): + """ + Export conversation history to csv file. + Optional args: from_date, to_date + """ + return "success" diff --git a/ai_ta_backend/main.py b/ai_ta_backend/main.py index a7c4549f..b27f2a81 100644 --- a/ai_ta_backend/main.py +++ b/ai_ta_backend/main.py @@ -471,7 +471,7 @@ def logToNomic(): return @app.route('/export-convo-history-csv', methods=['GET']) -def nomic_map(): +def export_convo_history(): course_name: str = request.args.get('course_name', default='', type=str) from_date: str = request.args.get('from_date', default='', type=str) to_date: str = request.args.get('to_date', default='', type=str)