aboutsummaryrefslogtreecommitdiff
path: root/gn3/llms/process.py
diff options
context:
space:
mode:
authorAlexander_Kabui2024-04-04 03:13:14 +0300
committerAlexander_Kabui2024-04-04 03:13:14 +0300
commit6392a88bfb7ca46154fce5da945ceb841fb1ef3d (patch)
tree83d894e42c6ee333d9daa262d0a8542694e68b8f /gn3/llms/process.py
parente11b70129326c1e92743792647a4d92b6703e621 (diff)
downloadgenenetwork3-6392a88bfb7ca46154fce5da945ceb841fb1ef3d.tar.gz
Rephrase user feedback for Fahamu API in case it takes too long to respond.
Diffstat (limited to 'gn3/llms/process.py')
-rw-r--r--gn3/llms/process.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/gn3/llms/process.py b/gn3/llms/process.py
index 468f86a..e38b73e 100644
--- a/gn3/llms/process.py
+++ b/gn3/llms/process.py
@@ -1,6 +1,4 @@
-
"""this module contains code for processing response from fahamu client.py"""
-
import os
import string
import json
@@ -105,7 +103,7 @@ def get_gnqa(query, auth_token, tmp_dir=""):
if success == 1:
resp_text = filter_response_text(res.text)
if resp_text.get("data") is None:
- return task_id, "Unfortunately I have nothing on the query", []
+ return task_id, "Please try to rephrase your question to receive feedback", []
answer = resp_text['data']['answer']
context = resp_text['data']['context']
references = parse_context(
@@ -114,7 +112,7 @@ def get_gnqa(query, auth_token, tmp_dir=""):
return task_id, answer, references
else:
- return task_id, "Unfortunately, I have nothing on the query", []
+ return task_id, "Please try to rephrase your question to receive feedback", []
def fetch_query_results(query, user_id, redis_conn):