diff options
author | Alexander_Kabui | 2024-02-14 12:40:00 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-02-14 12:42:41 +0300 |
commit | f5124e612e3059b64d32e65f4825e1eb3cada54b (patch) | |
tree | e9df458e68210143541d73b6bfa5eecd8b0b6ef0 /gn3/llms | |
parent | ee2de41747b20d7651dd0c3d002972dd18162e75 (diff) | |
download | genenetwork3-f5124e612e3059b64d32e65f4825e1eb3cada54b.tar.gz |
raise error for fahamu api 0 task_id
Diffstat (limited to 'gn3/llms')
-rw-r--r-- | gn3/llms/process.py | 3 |
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) |