From a227ee89544a4a12f63291a7ed6c203a715215ad Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 3 Jan 2024 19:29:04 +0300 Subject: fix fetch token error from curent app --- gn3/api/llm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gn3/api') diff --git a/gn3/api/llm.py b/gn3/api/llm.py index 83b5e85..68e6acc 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -2,7 +2,7 @@ # pylint: skip-file -from flask import jsonify, request, Blueprint +from flask import jsonify, request, Blueprint, current_app from gn3.llms.process import getGNQA @@ -16,7 +16,10 @@ def gnqa(): return jsonify({"error": "querygnqa is missing in the request"}), 400 try: - answer, refs = getGNQA(query) + auth_token = current_app.config.get("FAHAMU_AUTH_TOKEN") + answer, refs = getGNQA( + query, auth_token) + return jsonify({ "query": query, "answer": answer, -- cgit v1.2.3