diff options
author | Alexander_Kabui | 2024-01-03 17:52:53 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-01-03 17:52:53 +0300 |
commit | fa80365933d445418e775fdd6baa01328c41a987 (patch) | |
tree | c9b961f922535c85b79e56b80b669c4ec0f8e7bc /gn3/llms | |
parent | f69cf8d0ac4b2bf910ca2767676b327592b8448a (diff) | |
download | genenetwork3-fa80365933d445418e775fdd6baa01328c41a987.tar.gz |
fetch auth token from current app
Diffstat (limited to 'gn3/llms')
-rw-r--r-- | gn3/llms/client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/llms/client.py b/gn3/llms/client.py index f205247..6bcbf31 100644 --- a/gn3/llms/client.py +++ b/gn3/llms/client.py @@ -5,13 +5,13 @@ import os import datetime import time import requests +from flask import current_app from requests import Session from urllib.parse import urljoin from requests.packages.urllib3.util.retry import Retry from requests import HTTPError from requests import Session from requests.adapters import HTTPAdapter -from gn3.settings import FAHAMU_AUTH_TOKEN basedir = os.path.join(os.path.dirname(__file__)) @@ -59,7 +59,7 @@ class GeneNetworkQAClient(Session): def __init__(self, account, api_key, version="v3", timeout=5, total_retries=5, backoff_factor=30): super().__init__() - self.headers.update({"Authorization": "Bearer " + FAHAMU_AUTH_TOKEN}) + self.headers.update({"Authorization": "Bearer " + current_app.config.get("FAHAMU_AUTH_TOKEN","")}) self.answer_url = f"{self.BASE_URL}/answers" self.feedback_url = f"{self.BASE_URL}/feedback" |