From e24908b8a1d5835ea90caba69edb6f57eb7ad3df Mon Sep 17 00:00:00 2001 From: "justin.hsu" Date: Sun, 10 Nov 2024 18:34:28 +0800 Subject: [PATCH] add todo and rename files --- src/data/{conbine_result.py => conbine_readpdf_result.py} | 0 src/data/{read_data_noocr.py => read_pdf_noocr.py} | 0 src/data/{ocr_process.py => read_pdf_ocr.py} | 0 src/flask_app.py | 7 +++++-- src/utils/{weaviatexreranker.py => retrieval_agent.py} | 0 5 files changed, 5 insertions(+), 2 deletions(-) rename src/data/{conbine_result.py => conbine_readpdf_result.py} (100%) rename src/data/{read_data_noocr.py => read_pdf_noocr.py} (100%) rename src/data/{ocr_process.py => read_pdf_ocr.py} (100%) rename src/utils/{weaviatexreranker.py => retrieval_agent.py} (100%) diff --git a/src/data/conbine_result.py b/src/data/conbine_readpdf_result.py similarity index 100% rename from src/data/conbine_result.py rename to src/data/conbine_readpdf_result.py diff --git a/src/data/read_data_noocr.py b/src/data/read_pdf_noocr.py similarity index 100% rename from src/data/read_data_noocr.py rename to src/data/read_pdf_noocr.py diff --git a/src/data/ocr_process.py b/src/data/read_pdf_ocr.py similarity index 100% rename from src/data/ocr_process.py rename to src/data/read_pdf_ocr.py diff --git a/src/flask_app.py b/src/flask_app.py index 84058ea..21fdb1b 100644 --- a/src/flask_app.py +++ b/src/flask_app.py @@ -6,8 +6,7 @@ from flask_limiter.util import get_remote_address from flask_restx import Api, Resource, fields -# from utils.weaviate_op import search_do -from utils.weaviatexreranker import search_do +from utils.retrieval_agent import search_do from werkzeug.security import check_password_hash, generate_password_hash config, logger, CONFIG_PATH = config_log.setup_config_and_logging() @@ -61,6 +60,7 @@ def get(self): return response +# TODO: Modify the output format for general RAG purposes @ns.route('/chat') class ChatBot(Resource): @api.doc('chat_bot') @@ -70,8 +70,11 @@ def post(self): source = request.json.get('source') question = request.json.get('query') category = request.json.get('category') + + # for alpha testing # alpha = request.json.get('alpha') + # input template # { # "qid": 1, # "source": [442, 115, 440, 196, 431, 392, 14, 51], diff --git a/src/utils/weaviatexreranker.py b/src/utils/retrieval_agent.py similarity index 100% rename from src/utils/weaviatexreranker.py rename to src/utils/retrieval_agent.py