aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/llms/process.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/gn3/llms/process.py b/gn3/llms/process.py
index e4d33c7..9d32d4e 100644
--- a/gn3/llms/process.py
+++ b/gn3/llms/process.py
@@ -72,6 +72,9 @@ def get_gnqa(query, auth_token):
api_client = GeneNetworkQAClient(requests.Session(), api_key=auth_token)
res, task_id = api_client.ask('?ask=' + quote(query), auth_token)
+
+ if task_id == 0 :
+ raise RuntimeError(f"Error connecting to Fahamu Api: {str(res)}")
res, success = api_client.get_answer(task_id)
if success == 1:
resp_text = filter_response_text(res.text)