From 6392a88bfb7ca46154fce5da945ceb841fb1ef3d Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 4 Apr 2024 03:13:14 +0300 Subject: Rephrase user feedback for Fahamu API in case it takes too long to respond. --- gn3/llms/process.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gn3') 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): -- cgit v1.2.3