aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
Diffstat (limited to 'gn2')
-rw-r--r--gn2/wqflask/requests.py5
-rw-r--r--gn2/wqflask/views.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/gn2/wqflask/requests.py b/gn2/wqflask/requests.py
index 16c56e13..182201a5 100644
--- a/gn2/wqflask/requests.py
+++ b/gn2/wqflask/requests.py
@@ -19,3 +19,8 @@ def post(url, data=None, json=None, **kwargs) -> Either:
def put(url, data=None, json=None, **kwargs) -> Either:
"""Wrap requests put method with Either monad"""
return __wrap_response__(requests.put(url, data=data, json=json, **kwargs))
+
+
+def delete(url, **kwargs) -> Either:
+ """Wrap requests delete method with Either monad"""
+ return __wrap_response__(requests.delete(url, **kwargs))
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 97247182..993c6f0c 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -299,7 +299,7 @@ def get_gnqa_history():
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"),
+ monad_requests.delete(urljoin(GN3_LOCAL_URL, "/api/llm/history"),
json=dict(request.form),
headers={
"Authorization": f"Bearer {token}"