diff options
author | Alexander Kabui | 2023-12-22 23:50:25 +0300 |
---|---|---|
committer | GitHub | 2023-12-22 23:50:25 +0300 |
commit | fb49b824bf7a90ecadf021c01c65880e78e74298 (patch) | |
tree | dd1058fdda3b6257c7e33e418725648dde2c3381 /gn3/api | |
parent | 093163ebd511700078f998fa754e786435a81d1b (diff) | |
download | genenetwork3-fb49b824bf7a90ecadf021c01c65880e78e74298.tar.gz |
Feature/gn llms (#140)
* add entry route for gn_llms
* add gn_llms reference doc ids
* init authorization module for gn-llm
* Add class for parsing unprocessable response
* add init config file
* add clienmodule:gn-llm fahamu interface
* Add module descriptor for client file
* reponse data handler
* add response file handler
* add processing file
* remove unnecessary files
* init code refactoring
* Restructure code to module
* refactor code:disble pylint for testing on cd
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/llm.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py new file mode 100644 index 0000000..72d78b6 --- /dev/null +++ b/gn3/api/llm.py @@ -0,0 +1,22 @@ +"""API for data used to generate menus""" + +# pylint: skip-file + +from flask import jsonify, request, Blueprint + +from gn3.llms.process import getGNQA + +GnQNA = Blueprint("GnQNA", __name__) + + +@GnQNA.route("/gnqna", methods=["POST"]) +def gnqa(): + query = request.json.get("querygnqa", "") + if not query: + return jsonify({"error": "querygnqa is missing in the request"}), 400 + answer, refs = getGNQA(query) + return jsonify({ + "query": query, + "answer": answer, + "references": refs + }) |