diff options
author | Alexander_Kabui | 2024-05-24 16:30:59 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-24 16:30:59 +0300 |
commit | 188f84ef3895de613e998c63da7ec2338e25a55c (patch) | |
tree | c4fa6bc4f36cf03eff0e709d3f803f25c678c8de /gn3/api | |
parent | 8512d9a606fbfff864345d82c210e281a6d943bf (diff) | |
download | genenetwork3-188f84ef3895de613e998c63da7ec2338e25a55c.tar.gz |
Remove kwargs from LLMErrorr Exceptions and update relevant code.
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/llm.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py index 03ce815..c1f6304 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -1,7 +1,5 @@ """Api endpoints for gnqa""" import json -import sqlite3 -from authlib.integrations.flask_oauth2.errors import _HTTPException from flask import Blueprint from flask import current_app from flask import jsonify @@ -10,7 +8,6 @@ from flask import request from gn3.llms.process import get_gnqa from gn3.llms.errors import LLMError from gn3.auth.authorisation.oauth2.resource_server import require_oauth -from gn3.auth.authorisation.errors import AuthorisationError from gn3.auth import db @@ -26,8 +23,7 @@ def search(): fahamu_token = current_app.config.get("FAHAMU_AUTH_TOKEN") if not fahamu_token: raise LLMError( - "Request failed:an LLM authorisation token is required ", - query=query) + "Request failed:an LLM authorisation token is required ", query) task_id, answer, refs = get_gnqa( query, fahamu_token, current_app.config.get("DATA_DIR")) response = { @@ -61,7 +57,6 @@ def rate_queries(task_id): """Endpoint for rating qnqa query and answer""" with (require_oauth.acquire("profile") as token, db.connection(current_app.config["LLM_DB_PATH"]) as conn): - results = request.json user_id, query, answer, weight = (token.user.user_id, results.get("query"), |