aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask
diff options
context:
space:
mode:
authorAlexander_Kabui2024-05-29 14:05:44 +0300
committerAlexander_Kabui2024-05-29 14:05:44 +0300
commit30e5a84940bd9715bea02d07c5092bbfd717f7c5 (patch)
treebcfc45f376c164c2907601201f130dc727ce1d5d /gn2/wqflask
parent034b50502a6d15bccd52211a8bb282d46ac1558e (diff)
downloadgenenetwork2-30e5a84940bd9715bea02d07c5092bbfd717f7c5.tar.gz
integrate gnqa history delete functionality.
Diffstat (limited to 'gn2/wqflask')
-rw-r--r--gn2/wqflask/views.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 8f1c62ff..666e765a 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -288,7 +288,8 @@ def gnqna():
return render_template("gnqa.html")
-@app.route("/gnqna/hist", methods=["GET"])
+
+@app.route("/gnqna/hist", methods=["GET", "DELETE"])
@require_oauth2
def get_gnqa_history():
def _error_(resp):
@@ -297,6 +298,14 @@ def get_gnqa_history():
**resp.json()})
token = session_info()["user"]["token"].either(
lambda err: err, lambda tok: tok["access_token"])
+ if request.method == "DELETE":
+ monad_requests.post(urljoin(GN3_LOCAL_URL, "/api/llm/history"),
+ json=dict(request.form),
+ headers={
+ "Authorization": f"Bearer {token}"
+ }
+ ).either(
+ _error_, lambda x: x.json())
response = monad_requests.get(urljoin(GN3_LOCAL_URL,
(f"/api/llm/history?search_term={request.args.get('search_term')}"
if request.args.get("search_term") else "/api/llm/history")),