diff --git a/.gitignore b/.gitignore index 505dbf9..29c3a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,4 @@ data/ .gitignore node_modules/ *.log -*.pyc -python_script/cleanpdf.py -python_script/docxtopdf.py \ No newline at end of file +*.pyc \ No newline at end of file diff --git a/arch_en_app.py b/arch_en_app.py index f87ee21..936f25d 100644 --- a/arch_en_app.py +++ b/arch_en_app.py @@ -1,34 +1,34 @@ import os import sys -from flask import Flask, Blueprint, render_template, request, jsonify, send_from_directory, url_for - -arch_en = Flask(__name__) -main = Blueprint('main', __name__, static_folder='static', static_url_path='/arch-en/static', template_folder='templates') +from flask import Flask, render_template, request, jsonify, send_from_directory +arch_en_app = Flask(__name__) sys.path.append(os.path.join(os.path.dirname(__file__), 'python_script')) from parameters import load_config global DATA_PATH -load_config('arch_en') +load_config('arch-en') from parameters import CHROMA_ROOT_PATH, EMBEDDING_MODEL, LLM_MODEL, PROMPT_TEMPLATE, DATA_PATH, REPHRASING_PROMPT, STANDALONE_PROMPT, ROUTER_DECISION_PROMPT from get_llm_function import get_llm_function from get_rag_chain import get_rag_chain from ConversationalRagChain import ConversationalRagChain -@arch_en.route("/") + +root = "arch-en" + + +@arch_en_app.route("/") def index(): - root = "arch-en" return render_template('arch_en_index.html', root=root) def init_app(): load_rag() - arch_en.config['UPLOAD_FOLDER'] = DATA_PATH - + arch_en_app.config['UPLOAD_FOLDER'] = DATA_PATH -def load_rag(settings = None): +def load_rag(settings = None): global rag_conv if settings is None : rag_conv = ConversationalRagChain.from_llm( @@ -45,18 +45,18 @@ def load_rag(settings = None): # Route to get the document list -@arch_en.route('/documents', methods=['GET']) +@arch_en_app.route('/documents', methods=['GET']) def list_documents(): - files = os.listdir(arch_en.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/arch-en/files/{f}", "extension":os.path.splitext(f)[1][1:]} for f in files] + files = os.listdir(arch_en_app.config['UPLOAD_FOLDER']) + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] return jsonify(documents) # Route to get a single document -@arch_en.route('/documents/', methods=['GET']) +@arch_en_app.route('/documents/', methods=['GET']) def get_document(document_name): - files = os.listdir(arch_en.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/arch-en/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] + files = os.listdir(arch_en_app.config['UPLOAD_FOLDER']) + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] document = next((doc for doc in documents if doc["name"] == document_name), None) @@ -65,14 +65,13 @@ def get_document(document_name): return jsonify(document) - # Route to show the pdf -@arch_en.route('/files/', methods=['GET']) +@arch_en_app.route('/files/', methods=['GET']) def serve_file(filename): - return send_from_directory(arch_en.config['UPLOAD_FOLDER'], filename) + return send_from_directory(arch_en_app.config['UPLOAD_FOLDER'], filename) -@arch_en.route("/get", methods=["POST"]) +@arch_en_app.route("/get", methods=["POST"]) def chat(): data = request.get_json() msg = data.get("msg", "") @@ -93,14 +92,14 @@ def get_Chat_response(query): return output -@arch_en.route('/update-settings', methods=['POST']) +@arch_en_app.route('/update-settings', methods=['POST']) def update_settings(): data = request.get_json() load_rag(settings=data) return jsonify({'status': 'success', 'message': 'Settings updated successfully'}), 200 -@arch_en.route('/clear_chat_history', methods=['POST']) +@arch_en_app.route('/clear_chat_history', methods=['POST']) def clear_chat_history(): rag_conv.clear_chat_history() return jsonify({"status": "success"}), 200 @@ -108,4 +107,4 @@ def clear_chat_history(): if __name__ == '__main__': init_app() - arch_en.run(port=6668,debug=False) \ No newline at end of file + arch_en_app.run(port=6668,debug=False) \ No newline at end of file diff --git a/arch_ru_app.py b/arch_ru_app.py index 68067cf..30eecf7 100644 --- a/arch_ru_app.py +++ b/arch_ru_app.py @@ -1,62 +1,110 @@ import os import sys + from flask import Flask, render_template, request, jsonify, send_from_directory +arch_ru_app = Flask(__name__) + sys.path.append(os.path.join(os.path.dirname(__file__), 'python_script')) from parameters import load_config - -################### -### LOAD CONFIG ### -################### -load_config('arch_ru') -from parameters import CHROMA_ROOT_PATH, EMBEDDING_MODEL, LLM_MODEL, PROMPT_TEMPLATE, DATA_PATH +global DATA_PATH +load_config('arch-ru') +from parameters import CHROMA_ROOT_PATH, EMBEDDING_MODEL, LLM_MODEL, PROMPT_TEMPLATE, DATA_PATH, REPHRASING_PROMPT, STANDALONE_PROMPT, ROUTER_DECISION_PROMPT from get_llm_function import get_llm_function from get_rag_chain import get_rag_chain from ConversationalRagChain import ConversationalRagChain -rag_conv = ConversationalRagChain.from_llm( - rag_chain=get_rag_chain(), - llm=get_llm_function(LLM_MODEL), - callbacks=None -) -arch_ru_app = Flask(__name__) -arch_ru_app.config['UPLOAD_FOLDER'] = DATA_PATH +root = "arch-ru" + + +@arch_ru_app.route("/") +def index(): + return render_template('arch_ru_index.html', root=root) + + +def init_app(): + load_rag() + arch_ru_app.config['UPLOAD_FOLDER'] = DATA_PATH + + +def load_rag(settings = None): + global rag_conv + if settings is None : + rag_conv = ConversationalRagChain.from_llm( + rag_chain=get_rag_chain(), + llm=get_llm_function(model_name = LLM_MODEL), + callbacks=None + ) + else: + rag_conv = ConversationalRagChain.from_llm( + rag_chain=get_rag_chain(settings), + llm=get_llm_function(model_name = settings["llm_model"]), + callbacks=None + ) + # Route to get the document list @arch_ru_app.route('/documents', methods=['GET']) def list_documents(): files = os.listdir(arch_ru_app.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/arch-ru/files/{f}", "extension":os.path.splitext(f)[1][1:]} for f in files] + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] return jsonify(documents) + +# Route to get a single document +@arch_ru_app.route('/documents/', methods=['GET']) +def get_document(document_name): + files = os.listdir(arch_ru_app.config['UPLOAD_FOLDER']) + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] + + document = next((doc for doc in documents if doc["name"] == document_name), None) + + if document is None: + return jsonify({'error': 'Document not found'}), 404 + + return jsonify(document) + # Route to show the pdf @arch_ru_app.route('/files/', methods=['GET']) def serve_file(filename): return send_from_directory(arch_ru_app.config['UPLOAD_FOLDER'], filename) -@arch_ru_app.route("/") -def index(): - return render_template('arch_ru_index.html') - @arch_ru_app.route("/get", methods=["POST"]) def chat(): - msg = request.form.get("msg","") - input_query = msg - return get_Chat_response(input_query) - + data = request.get_json() + msg = data.get("msg", "") + return get_Chat_response(msg) def get_Chat_response(query): - inputs = {"query": str(query)} + inputs = { + "query": str(query), + "chat_history": [] + } res = rag_conv._call(inputs) output = jsonify({ 'response': res['result'], 'context': res['context'], - 'source': res['source'] + 'metadatas': res['metadatas'] }) return output - + + +@arch_ru_app.route('/update-settings', methods=['POST']) +def update_settings(): + data = request.get_json() + load_rag(settings=data) + return jsonify({'status': 'success', 'message': 'Settings updated successfully'}), 200 + + +@arch_ru_app.route('/clear_chat_history', methods=['POST']) +def clear_chat_history(): + rag_conv.clear_chat_history() + return jsonify({"status": "success"}), 200 + + if __name__ == '__main__': - arch_ru_app.run(port=6667,debug=False) + init_app() + arch_ru_app.run(port=6667,debug=False) \ No newline at end of file diff --git a/local_app.py b/local_app.py index abea2c0..6bb5b0a 100644 --- a/local_app.py +++ b/local_app.py @@ -2,9 +2,9 @@ import sys from flask import Flask, render_template, request, jsonify, send_from_directory - local_app = Flask(__name__) + sys.path.append(os.path.join(os.path.dirname(__file__), 'python_script')) from parameters import load_config global DATA_PATH @@ -14,12 +14,21 @@ from get_rag_chain import get_rag_chain from ConversationalRagChain import ConversationalRagChain + +root = "" + + +@local_app.route("/") +def index(): + return render_template('local.html', root=root) + + def init_app(): load_rag() local_app.config['UPLOAD_FOLDER'] = DATA_PATH -def load_rag(settings = None): +def load_rag(settings = None): global rag_conv if settings is None : rag_conv = ConversationalRagChain.from_llm( @@ -34,18 +43,20 @@ def load_rag(settings = None): callbacks=None ) + # Route to get the document list @local_app.route('/documents', methods=['GET']) def list_documents(): files = os.listdir(local_app.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/files/{f}", "extension":os.path.splitext(f)[1][1:]} for f in files] + documents = [{"name": f, "url": f"{root}/files/{f}", "extension":os.path.splitext(f)[1][1:]} for f in files] return jsonify(documents) + # Route to get a single document @local_app.route('/documents/', methods=['GET']) def get_document(document_name): files = os.listdir(local_app.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] + documents = [{"name": f, "url": f"{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] document = next((doc for doc in documents if doc["name"] == document_name), None) @@ -59,12 +70,6 @@ def get_document(document_name): def serve_file(filename): return send_from_directory(local_app.config['UPLOAD_FOLDER'], filename) - -@local_app.route("/") -def index(): - return render_template('local.html') - - @local_app.route("/get", methods=["POST"]) def chat(): data = request.get_json() @@ -72,21 +77,20 @@ def chat(): return get_Chat_response(msg) def get_Chat_response(query): - print("query: ",str(query)) inputs = { "query": str(query), "chat_history": [] } res = rag_conv._call(inputs) - + print(res['metadatas']) output = jsonify({ 'response': res['result'], 'context': res['context'], - 'source': res['source'] + 'metadatas': res['metadatas'] }) - print(res['result']) return output + @local_app.route('/update-settings', methods=['POST']) def update_settings(): data = request.get_json() @@ -94,12 +98,12 @@ def update_settings(): return jsonify({'status': 'success', 'message': 'Settings updated successfully'}), 200 - @local_app.route('/clear_chat_history', methods=['POST']) def clear_chat_history(): rag_conv.clear_chat_history() return jsonify({"status": "success"}), 200 + if __name__ == '__main__': init_app() local_app.run(port=5000,debug=True) \ No newline at end of file diff --git a/python_script/config.json b/python_script/config.json index 8a024a7..abc6539 100644 --- a/python_script/config.json +++ b/python_script/config.json @@ -3,36 +3,31 @@ "data_path": "data/documents/default", "chroma_root_path": "data/chroma/default", "embedding_model": "voyage-law-2", - "llm_model": "gpt-3.5-turbo", - "prompt_template": "Answer the question based only on the following context:\n\n{context}\n\n---\n\nAnswer the question based on the above context: {question}" + "llm_model": "gpt-3.5-turbo" }, "seus": { "data_path": "data/documents/ship_data", "chroma_root_path": "data/chroma/ship_chroma", - "embedding_model": "voyage-multilingual-2", - "llm_model": "gpt-3.5-turbo", - "prompt_template": "Answer the question based only on the following context:\n\n{context}\n\n---\n\nAnswer the question based on the above context: {question}" + "embedding_model": "openai", + "llm_model": "gpt-3.5-turbo" }, - "arch_en": { + "arch-en": { "data_path": "data/documents/arch_data-en", "chroma_root_path": "data/chroma/arch_data-en_chroma", "embedding_model": "openai", - "llm_model": "gpt-3.5-turbo", - "prompt_template": "Answer the question based only on the following context:\n\n{context}\n\n---\n\nPlease provide your answer to the question: {question}" + "llm_model": "gpt-3.5-turbo" }, - "arch_ru": { + "arch-ru": { "data_path": "data/documents/arch_data-ru", "chroma_root_path": "data/chroma/arch_data-ru_chroma", - "embedding_model": "voyage-multilingual-2", - "llm_model": "gpt-3.5-turbo", - "prompt_template": "Answer the question based only on the following context:\n\n{context}\n\n---\n\nPlease provide your answer to the question: {question}" + "embedding_model": "openai", + "llm_model": "gpt-3.5-turbo" }, "test": { "data_path": "data/documents/test_data", "chroma_root_path": "data/chroma/test_chroma", - "embedding_model": "voyage-multilingual-2", - "llm_model": "gpt-3.5-turbo", - "prompt_template": "Answer the question based only on the following context:\n\n{context}\n\n---\n\nPlease provide your answer to the question: {question}" + "embedding_model": "openai", + "llm_model": "gpt-3.5-turbo" } } \ No newline at end of file diff --git a/python_script/get_rag_chain.py b/python_script/get_rag_chain.py index a6bfc2f..b14aaba 100644 --- a/python_script/get_rag_chain.py +++ b/python_script/get_rag_chain.py @@ -50,7 +50,7 @@ def get_rag_chain(params = None): "max_chunk_return": 5, "considered_chunk": 25, "mmr_doc_nb": 5, - "lambda_mult":0.25, + "lambda_mult":0.5, "isHistoryOn": True, } if params is None : diff --git a/python_script/parameters.py b/python_script/parameters.py index 588e076..a89b9cf 100644 --- a/python_script/parameters.py +++ b/python_script/parameters.py @@ -34,7 +34,6 @@ def load_config(config_name = 'default', show_config = False): "chroma_root_path": "", # Path to the folder where the Chroma database will be stored "embedding_model": "", # Model to use for embeddings (e.g., 'sentence-transformers/all-mpnet-base-v2', 'openai', 'voyage-law-2') "llm_model": "", # Model to use for the language model (e.g., 'gpt-3.5-turbo', 'mistralai/Mistral-7B-Instruct-v0.1', 'nvidia/Llama3-ChatQA-1.5-8B') - "prompt_template": "" # Template for the prompt } } diff --git a/python_script/populate_database.py b/python_script/populate_database.py index bd1c2e3..b3560e1 100644 --- a/python_script/populate_database.py +++ b/python_script/populate_database.py @@ -75,18 +75,18 @@ def load_documents(): llama_document_loader = SimpleDirectoryReader(input_dir=DATA_PATH, required_exts=[".txt", ".docx"]) for doc in tqdm(llama_document_loader.load_data(), desc="TXT/DOCX loaded"): doc.metadata.pop('file_path',None) - print(doc.metadata) llama_documents.append(doc) except ValueError as e: print(e) langchain_document_loader = ProgressPyPDFDirectoryLoader(DATA_PATH) for doc in tqdm(langchain_document_loader.load(), desc="PDFs loaded"): + doc.metadata.pop('file_path',None) print(doc.metadata) langchain_documents.append(doc) documents = langchain_documents + convert_llamaindexdoc_to_langchaindoc(llama_documents) - print(f"Loaded {len(langchain_documents)} chunks from PDF documents, {len(llama_documents)} chunks from TXT/DOCX documents.\nTotal chunks: {len(documents)}.\n") + print(f"Loaded {len(langchain_documents)} page{'s' if len(langchain_documents) > 1 else ''} from PDF document{'s' if len(langchain_documents) > 1 else ''}, {len(llama_documents)} item{'s' if len(llama_documents) > 1 else ''} from TXT/DOCX document{'s' if len(llama_documents) > 1 else ''}.\nTotal items: {len(documents)}.\n") return documents def convert_llamaindexdoc_to_langchaindoc(documents: list[Document]): @@ -130,14 +130,14 @@ def add_to_chroma(chunks: list[Document]): # Add or Update the documents. existing_items = db.get(include=[]) existing_ids = set(existing_items["ids"]) - print(f"Number of existing documents in DB: {len(existing_ids)}") + print(f"Number of existing chunks in DB: {len(existing_ids)}") # Only add documents that don't exist in the DB. new_chunks = [chunk for chunk in chunks_with_ids if chunk.metadata["id"] not in existing_ids] batch_size = 1000 if new_chunks: - with tqdm(total=len(new_chunks), desc="Adding documents") as pbar: + with tqdm(total=len(new_chunks), desc="Adding chunks") as pbar: for i in range(0,len(new_chunks), batch_size): batch = new_chunks[i:i + batch_size] new_chunk_ids = [chunk.metadata["id"] for chunk in batch] @@ -146,7 +146,7 @@ def add_to_chroma(chunks: list[Document]): pbar.update(len(batch)) else: - print("Done. No new documents to add") + print("Done. No new chunks to add") def calculate_chunk_ids(chunks): @@ -235,12 +235,14 @@ def load(self) -> List[Document]: try: loader = PDFPlumberLoader(str(i), extract_images=self.extract_images) sub_docs = loader.load() + page_counter = 1 for doc in sub_docs: if 'source' in doc.metadata: doc.metadata['source'] = i.name doc.metadata['file_name'] = doc.metadata.pop('source') - #doc.metadata.pop('file_path',None) doc.metadata = {key: value for key, value in doc.metadata.items() if value} + doc.metadata['page_counter'] = page_counter + page_counter += 1 docs.extend(sub_docs) except Exception as e: if self.silent_errors: diff --git a/seus_app.py b/seus_app.py index 9d2e505..9983ec8 100644 --- a/seus_app.py +++ b/seus_app.py @@ -2,65 +2,109 @@ import sys from flask import Flask, render_template, request, jsonify, send_from_directory +seus_app = Flask(__name__) + sys.path.append(os.path.join(os.path.dirname(__file__), 'python_script')) from parameters import load_config - -################### -### LOAD CONFIG ### -################### +global DATA_PATH load_config('seus') -from parameters import CHROMA_ROOT_PATH, EMBEDDING_MODEL, LLM_MODEL, PROMPT_TEMPLATE, DATA_PATH +from parameters import CHROMA_ROOT_PATH, EMBEDDING_MODEL, LLM_MODEL, PROMPT_TEMPLATE, DATA_PATH, REPHRASING_PROMPT, STANDALONE_PROMPT, ROUTER_DECISION_PROMPT from get_llm_function import get_llm_function from get_rag_chain import get_rag_chain from ConversationalRagChain import ConversationalRagChain -rag_conv = ConversationalRagChain.from_llm( - rag_chain=get_rag_chain(), - llm=get_llm_function(LLM_MODEL), - callbacks=None -) -seus_app = Flask(__name__) +root = "seus" + + +@seus_app.route("/") +def index(): + return render_template('seus_index.html', root=root) + + +def init_app(): + load_rag() + seus_app.config['UPLOAD_FOLDER'] = DATA_PATH + + +def load_rag(settings = None): + global rag_conv + if settings is None : + rag_conv = ConversationalRagChain.from_llm( + rag_chain=get_rag_chain(), + llm=get_llm_function(model_name = LLM_MODEL), + callbacks=None + ) + else: + rag_conv = ConversationalRagChain.from_llm( + rag_chain=get_rag_chain(settings), + llm=get_llm_function(model_name = settings["llm_model"]), + callbacks=None + ) -seus_app.config['UPLOAD_FOLDER'] = DATA_PATH # Route to get the document list @seus_app.route('/documents', methods=['GET']) def list_documents(): files = os.listdir(seus_app.config['UPLOAD_FOLDER']) - documents = [{"name": f, "url": f"/seus/files/{f}", "extension":os.path.splitext(f)[1][1:]} for f in files] + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] return jsonify(documents) + +# Route to get a single document +@seus_app.route('/documents/', methods=['GET']) +def get_document(document_name): + files = os.listdir(seus_app.config['UPLOAD_FOLDER']) + documents = [{"name": f, "url": f"/{root}/files/{f}", "extension": os.path.splitext(f)[1][1:]} for f in files] + + document = next((doc for doc in documents if doc["name"] == document_name), None) + + if document is None: + return jsonify({'error': 'Document not found'}), 404 + + return jsonify(document) + # Route to show the pdf @seus_app.route('/files/', methods=['GET']) def serve_file(filename): return send_from_directory(seus_app.config['UPLOAD_FOLDER'], filename) -@seus_app.route("/") -def index(): - return render_template('seus.html') - - @seus_app.route("/get", methods=["POST"]) def chat(): - msg = request.form.get("msg","") - input_query = msg - return get_Chat_response(input_query) - + data = request.get_json() + msg = data.get("msg", "") + return get_Chat_response(msg) def get_Chat_response(query): - inputs = {"query": str(query)} + inputs = { + "query": str(query), + "chat_history": [] + } res = rag_conv._call(inputs) output = jsonify({ 'response': res['result'], 'context': res['context'], - 'source': res['source'] + 'metadatas': res['metadatas'] }) return output +@seus_app.route('/update-settings', methods=['POST']) +def update_settings(): + data = request.get_json() + load_rag(settings=data) + return jsonify({'status': 'success', 'message': 'Settings updated successfully'}), 200 + + +@seus_app.route('/clear_chat_history', methods=['POST']) +def clear_chat_history(): + rag_conv.clear_chat_history() + return jsonify({"status": "success"}), 200 + + if __name__ == '__main__': - seus_app.run(port=6666,debug=False) + init_app() + seus_app.run(port=6666,debug=False) \ No newline at end of file diff --git a/static/arch_en_script.js b/static/arch_en_script.js deleted file mode 100644 index 0746ca9..0000000 --- a/static/arch_en_script.js +++ /dev/null @@ -1,169 +0,0 @@ -const body = document.querySelector("body"), -leftSidebar = body.querySelector(".left-sidebar"), -toggleLeft = body.querySelector(".toggle"), -rightSidebar = body.querySelector(".right-sidebar"), -toggleRight = body.querySelector(".toggle-right"), -modeText = body.querySelector(".mode-text"), -chatBox = body.querySelector(".chatbox"), -chatInput = body.querySelector(".chat-text"), -sendBtn = body.querySelector(".chat-input button"), -context = body.querySelector(".context-text"), -source = body.querySelector(".source-text"); - -let userMessage; - - -document.addEventListener('DOMContentLoaded', function() { - // Open the right-sidebar when page is loaded/reloaded and window size > 768 - if (window.innerWidth > 768) { - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); - } - fetchDocuments; -}); - -window.addEventListener("resize", function() { - // Gestion of sidebar when windows is getting resized - if (window.innerWidth < 768) { - if (!rightSidebar.classList.contains("right-close")) { - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("right-close"); - } - if (!rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } - else if (window.innerWidth < 1024) { - if (!rightSidebar.classList.contains("right-close") && !rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } -}); - - -toggleLeft.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - rightSidebar.classList.add("right-close"); - leftSidebar.classList.add("right-close"); - } - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); -}); - -toggleRight.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - leftSidebar.classList.add("left-close"); - rightSidebar.classList.add("left-close"); - } - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); -}); - -const createChatLi = (message, className) => { - const chatLi = document.createElement("li"); - chatLi.classList.add("chat", className); - let chatContent = className === "incoming" ? `

${message}

` : `

${message}

`; - chatLi.innerHTML = chatContent; - return chatLi; -}; - -const handleChat = () => { - userMessage = chatInput.value.trim(); - console.log(userMessage) - if(!userMessage) return; - - // Append the user's message to the chatbox - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - chatBox.scrollTo(0, chatBox.scrollHeight); - - setTimeout(() => { - // Display "Thinking..." message while waiting for the response - const incomingChatLi = createChatLi("Thinking...", "incoming"); - chatBox.appendChild(incomingChatLi); - chatBox.scrollTo(0, chatBox.scrollHeight); - }, 600); - -}; - -$(document).ready(function() { - function submitQuerry() { - userMessage = chatInput.value.trim(); - console.log(userMessage); - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - $.ajax({ - data: { - msg: userMessage, - }, - type: "POST", - url: "/arch-en/get", - }).done(function(data) { - chatBox.appendChild(createChatLi(data.response, "incoming")); - chatBox.scrollTo(0, chatBox.scrollHeight); - context.innerHTML = ""; - source.innerHTML = ""; - - let counter = 1; - data.context.forEach(function(ctx){ - context.innerHTML += "Chunk " + counter + " :

" + ctx.replace(/\n/g,"
") + "

"; - counter++; - }) - - data.source.forEach(function(src) { - source.innerHTML += src + "
"; - }); - }); - event.preventDefault(); - chatInput.value = ""; - } - - $("#message-area").on("submit", function(event) { - event.preventDefault(); - submitQuerry(); - }); - - $("#message-area").on("keypress", function(event) { - if (event.key === "Enter") { - event.preventDefault(); - submitQuerry(); - } - }); -}); - -// Function to get documents from server -async function fetchDocuments() { - const response = await fetch('/arch-en/documents'); - const documents = await response.json(); - const listElement = document.getElementById('document-list'); - - documents.forEach(doc => { - const listItem = document.createElement('li'); - const link = document.createElement('a'); - link.href = doc.url; - link.textContent = doc.name; - link.title = doc.name; - link.target = "_blank"; - - const icon = document.createElement('img'); - icon.classList.add('icon'); - switch (doc.extension) { - case 'pdf': - icon.src = 'arch-en/static/document-pdf.svg'; - break; - - case 'docs': - icon.src = 'static/microsoft-word.svg'; - break; - - default: - icon.src = 'arch-ru/static/microsoft-word.svg'; - } - listItem.appendChild(icon); - listItem.appendChild(link); - listElement.appendChild(listItem); - }); -} -window.onload = fetchDocuments; \ No newline at end of file diff --git a/static/arch_en_style.css b/static/arch_en_style.css deleted file mode 100644 index a205fbb..0000000 --- a/static/arch_en_style.css +++ /dev/null @@ -1,554 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap'); - -:root{ - /*===== Colors =====*/ - --body-color: #E4E9F7; - --sidebar-color: #FFF; - --primary-color: #9B7AE3; /*#e89441*/ - --primary-color-light: #F6F5FF; - --toggle-color: #DDD; - --scroll-color: #C8C8C8; - --text-color: #707070; - - /*===== Transitions =====*/ - --tran-02: all 0.2s ease; - --tran-03: all 0.3s ease; - --tran-04: all 0.4s ease; - --tran-05: all 0.5s ease; - --tran-06: all 0.6s ease; - --tran-07: all 0.7s ease; - --tran-20: all 2s ease; -} - -/*=====================*/ -/*===== ScrollBar =====*/ -/*=====================*/ - -/* width */ -::-webkit-scrollbar { - width: 5px; -} - -/* Handle */ -::-webkit-scrollbar-thumb { - background: var(--scroll-color); - border-radius: 10px; -} - -/* Handle on hover */ -::-webkit-scrollbar-thumb:hover { - background: var(--primary-color); -} - -/*================*/ -/*===== Body =====*/ -/*================*/ - -*{ - font-family: "Poppins", sans-serif; - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body{ - z-index: -2; - height: 100vh; - position: relative; - min-width: 100vw; - background: var(--body-color); -} - -/*========================*/ -/*===== Left-sidebar =====*/ -/*========================*/ - -.left-sidebar{ - position:fixed; - top: 0; - left: 0; - height: 100%; - width: 250px; - padding: 10px 14px; - background: var(--sidebar-color); - transition: var(--tran-03); -} - -/*===== Logo + left top text =====*/ - -.left-sidebar header{ - position: relative; -} - -.left-sidebar .image-text img{ - position: relative; - left: -11px; - width: 74px; - border-radius: 6px; -} -.left-sidebar header .image-text{ - display: flex; - align-items: center; -} - -header .image-text .header-text{ - display: flex; - flex-direction: column; -} -.header-text .name{ - font-weight: 900; - color: var(--primary-color); -} -.header-text .profession{ - margin-top: -2px; -} - -/*===== Toggle arrow to reduce the left-sidebar =====*/ -.left-sidebar .toggle{ - position: absolute; - top: 50%; - right: -10px; - transform: translateY(-50%) rotate(180deg); - height: 25px; - width: 25px; - background: var(--primary-color); - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - color: var(--sidebar-color); - font-size: 22px; - z-index: 1; -} - -/*===== Rotating arrow if left-sidebar closed =====*/ -.left-sidebar.left-close .toggle{ - transform: translateY(-50%); -} - -/*===== left-sidebar components =====*/ -.left-sidebar .nav-link{ - background: var(--toggle-color); - border-radius: 5px 5px 0px 0px; - height: 50px; - margin-top: 10px; - list-style: none; - display: flex; - align-items: center; -} -.left-sidebar .nav-link .icon{ - min-width: 50px; - font-size: 20px; - display: flex; - align-items: center; - justify-content: center; -} -.left-sidebar .nav-link .icon, -.left-sidebar .nav-link .text{ - color: var(--text-color) -} - -.left-sidebar .image{ - min-width: 60px; - display: flex; - align-items: center; -} - -.left-sidebar .text, -.right-sidebar .text{ - font-size: 16px; - font-weight: 500; - color: var(--text-color); - transition: var(--tran-03); - white-space: nowrap; - visibility: visible; - opacity: 1s; -} - -.left-sidebar .document-list{ - background-color: var(--toggle-color); - border-radius: 0px 0px 5px 5px; - list-style: none; - visibility: visible; - opacity: 1; - transition: var(--tran-03); - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - height: 80vh; - overflow-y: auto; -} -.left-sidebar .document-list li{ - margin-left: 5px; - margin-right: 5px; - display: flex; - align-items: center; -} -.left-sidebar .document-list .icon{ - color: var(--text-color); - width: 20px; - height: 20px; - margin-right: 10px -} -.left-sidebar .document-list a{ - color: var(--text-color); - text-decoration: none; -} -.left-sidebar .document-list a:hover{ - color: var(--primary-color); -} - -/*===== Left-sidebar Close =====*/ - -.left-sidebar.left-close .text, -.left-sidebar.left-close .document-list{ - visibility: hidden; - opacity: 0; -} -.left-sidebar.left-close .document-list a{ - pointer-events: none; -} -.left-sidebar.left-close ~ .main{ -left: 78px; -width: calc(100% - 678px); -transition: var(--tran-03); -} -.left-sidebar.left-close.right-close ~ .main{ -left: 78px; -width: calc(100% - 156px); -transition: var(--tran-03); -} -.left-sidebar.right-close ~ .main{ -width: calc(100% - 328px); -} -.left-sidebar.left-close{ -width: 78px; -} -.left-sidebar.left-close ~ .chatbot{ - width: calc(100% - 538px); -} - -.right-sidebar.right-close{ - width: 78px; - transition: var(--tran-03); -} - -/*===================*/ -/*===== Chatbot =====*/ -/*===================*/ - -.main{ - position: absolute; - left: 250px; - padding: 5px 25px; - width: calc(100% - 850px); - height: 100vh; - transition: var(--tran-03); - z-index: -1; -} - -.chatbot{ - position: relative; - height: 100%; - width: 100%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5); -} - -/*===== Chatbot Header =====*/ -.chatbot header{ - position: absolute; - width: 100%; - z-index: 1; - background: var(--primary-color); - padding: 16px 0; - text-align: center; -} - -.chatbot header h2{ - color: var(--sidebar-color); - font-size: 1.4rem; -} - -/*===== Chatbox =====*/ -.chatbot .chatbox{ - position: absolute; - width: 100%; - height: calc(100% - 85px); - overflow-y: auto; - padding: 85px 20px 70px; -} -.chatbox .chat{ - display: flex; -} -/*===== AI chat =====*/ -.chatbox .incoming span{ - color: var(--sidebar-color); - align-self: flex-end; - background: var(--primary-color); - border-radius: 4px; - margin: 0 10px 7px 0; - text-align: center; -} -.bxs-message-dots{ - margin: 8px; -} -/*===== User chat =====*/ -.chatbox .outgoing{ - justify-content: flex-end; -} - -.chatbox .chat p{ - color: var(--sidebar-color); - max-width: 75%; - font-size: 0.9rem; - padding: 7px 7px; - border-radius: 5px 5px 0 5px; - background: var(--primary-color); -} - -.chatbox .incoming p{ - color: var(--text-color); - background: var(--primary-color-light); - border-radius: 5px 5px 5px 0; -} - -.chatbox li{ - padding: 5px; -} - -.chatbot .chat-input{ - position: absolute; - bottom: 0; - width: 100%; - gap: 5px; - background: var(--sidebar-color); - padding: 5px 20px; - border-top: 1px solid #ccc; -} - -/*===== Chatbot textarea =====*/ -.chat-input textarea{ - height: 55px; - width: 100%; - border: none; - outline: none; - font-size: 0.9rem; - resize: none; - padding: 16px 15px 16px 0; -} - -.chat-input button{ - align-self: flex-end; - height: 55px; - line-height: 55px; - color: var(--primary-color); - font-size: 1.35rem; - cursor: pointer; - visibility: hidden; - border: none; -} - -/*===== Send icon visible only if there is text =====*/ -.chat-input textarea:valid ~ button{ - visibility: visible; -} - -/*=========================*/ -/*===== Right-sidebar =====*/ -/*=========================*/ - -.right-sidebar{ - position:absolute; - top: 0; - right: 0; - width: 600px; - height: 100%; - padding: 10px 14px; - background: var(--sidebar-color); - transition: var(--tran-03); -} -.context{ - position: relative; - width: 100%; - height: 68%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - /*box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5);*/ -} - -.blank{ - position: relative; - height: 2%; -} -.source{ - position: relative; - width: 100%; - height: 30%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - /*box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5);*/ -} -.border{ - position: absolute; - top: 0px; - bottom: 0px; - display: contents ; -} - -.right-sidebar .toggle-right{ - position: absolute; - top: 50%; - right: 586px; - transform: translateY(-50%) ; - height: 25px; - width: 25px; - background: var(--primary-color); - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - color: var(--sidebar-color); - font-size: 22px; - z-index: 1; - transition: var(--tran-03); -} - -.right-sidebar.right-close .toggle-right{ - transform: translateY(-50%) rotate(180deg); - right: 64px; -} - -.right-sidebar li{ - border-radius: 5px; - height: 40px; - list-style: none; - display: flex; - align-items: center; - justify-content: flex-end; -} -.right-sidebar li .icon{ - min-width: 50px; - font-size: 20px; - display: flex; - align-items: center; - justify-content: center; -} -.right-sidebar li .icon, -.right-sidebar li .text{ - color: var(--text-color); - white-space: nowrap; - opacity: 1; -} - -.right-sidebar-box{ -padding: 5px; -height: calc(100% - 40px); -transition: var(--tran-03); -} - -.right-sidebar-text-container{ -position: relative; -background: var(--sidebar-color); -height: 100%; -border-radius: 5px; -overflow: auto; -text-align: justify; -} - -.context-text, .source-text{ - color: var(--text-color); - font-size: 0.9rem; - padding: 12px 16px; - transform-origin: top; - justify-self: flex-start; - opacity: 1; -} -.source-text{ - text-align: left; -} - -/*===== Right-sidebar close =====*/ -.right-sidebar.right-close .text{ - opacity: 0; - transition: var(--tran-03); -} -.right-sidebar.right-close .right-sidebar-box{ - padding: 5px; - height: 91%; - opacity: 0; - transition: var(--tran-03); -} - - - -@media (max-width: 1400px) { - .right-sidebar{ - width: 400px; - } - .right-sidebar .toggle-right{ - right: 386px; - } - .left-sidebar.left-close ~ .main{ - width: calc(100% - 478px); - } - .left-sidebar.right-close ~ .main{ - width: calc(100% - 328px); - } - .main{ - width: calc(100% - 650px); - } -} -/* Pour les écrans inférieurs à 768px */ -@media (max-width: 768px) { - .main{ - visibility: hidden; - } - .left-sidebar, .right-sidebar { - visibility: visible; - width: 100%; - } - .right-sidebar{ - z-index: -1; - } - .right-sidebar.right-close{ - z-index: 1; - } - .left-sidebar.left-close, .right-sidebar.right-close { - visibility: hidden; - } - .right-sidebar .toggle-right{ - right: -6px; - z-index: 1; - } - .left-sidebar .toggle{ - left: -8px; - } - .left-sidebar.left-close .toggle{ - visibility: visible; - left: -8px; - } - .right-sidebar.right-close .toggle-right{ - visibility: visible; - right: -6px; - z-index: 1; - } - - .left-sidebar.left-close.right-close ~ .main { - visibility: visible; - left: 0px; - width: 100%; - padding: 0px; - } -} - -@media (max-width: 1024px) { -/* TODO */ -} diff --git a/static/arch_ru_script.js b/static/arch_ru_script.js deleted file mode 100644 index 9fff641..0000000 --- a/static/arch_ru_script.js +++ /dev/null @@ -1,176 +0,0 @@ -const body = document.querySelector("body"), -leftSidebar = body.querySelector(".left-sidebar"), -toggleLeft = body.querySelector(".toggle"), -rightSidebar = body.querySelector(".right-sidebar"), -toggleRight = body.querySelector(".toggle-right"), -modeText = body.querySelector(".mode-text"), -chatBox = body.querySelector(".chatbox"), -chatInput = body.querySelector(".chat-text"), -sendBtn = body.querySelector(".chat-input button"), -context = body.querySelector(".context-text"), -source = body.querySelector(".source-text"); - -let userMessage; - - -document.addEventListener('DOMContentLoaded', function() { - // Open the right-sidebar when page is loaded/reloaded and window size > 768 - if (window.innerWidth > 768) { - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); - } -}); - -window.addEventListener("resize", function() { - // Gestion of sidebar when windows is getting resized - if (window.innerWidth < 768) { - if (!rightSidebar.classList.contains("right-close")) { - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("right-close"); - } - if (!rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } - else if (window.innerWidth < 1024) { - if (!rightSidebar.classList.contains("right-close") && !rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } -}); - - -toggleLeft.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - rightSidebar.classList.add("right-close"); - leftSidebar.classList.add("right-close"); - } - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); -}); - -toggleRight.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - leftSidebar.classList.add("left-close"); - rightSidebar.classList.add("left-close"); - } - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); -}); - -const createChatLi = (message, className) => { - const chatLi = document.createElement("li"); - chatLi.classList.add("chat", className); - let chatContent = className === "incoming" ? `

${message}

` : `

${message}

`; - chatLi.innerHTML = chatContent; - return chatLi; -}; - -const printContext = (contextText) => { - context.textContent.length(); - console.log(length); -}; - - -const handleChat = () => { - userMessage = chatInput.value.trim(); - console.log(userMessage) - if(!userMessage) return; - - // Append the user's message to the chatbox - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - chatBox.scrollTo(0, chatBox.scrollHeight); - - setTimeout(() => { - // Display "Thinking..." message while waiting for the response - const incomingChatLi = createChatLi("Thinking...", "incoming"); - chatBox.appendChild(incomingChatLi); - chatBox.scrollTo(0, chatBox.scrollHeight); - }, 600); - -}; - -$(document).ready(function() { - function submitQuerry() { - userMessage = chatInput.value.trim(); - console.log(userMessage); - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - $.ajax({ - data: { - msg: userMessage, - }, - type: "POST", - url: "/arch-ru/get", - }).done(function(data) { - //var botHtml = '
' + data + '' + str_time + '
'; - //$("#messageFormeight").append($.parseHTML(botHtml)); - chatBox.appendChild(createChatLi(data.response, "incoming")); - chatBox.scrollTo(0, chatBox.scrollHeight); - context.innerHTML = ""; - source.innerHTML = ""; - - let counter = 1; - data.context.forEach(function(ctx){ - context.innerHTML += "Chunk " + counter + " :

" + ctx.replace(/\n/g,"
") + "

"; - counter++; - }) - - data.source.forEach(function(src) { - source.innerHTML += src + "
"; - }); - }); - event.preventDefault(); - chatInput.value = ""; - } - - $("#message-area").on("submit", function(event) { - event.preventDefault(); - submitQuerry(); - }); - - $("#message-area").on("keypress", function(event) { - if (event.key === "Enter") { - event.preventDefault(); - submitQuerry(); - } - }); -}); - -// Function to get documents from server -async function fetchDocuments() { - const response = await fetch('/arch-ru/documents'); - const documents = await response.json(); - const listElement = document.getElementById('document-list'); - - documents.forEach(doc => { - const listItem = document.createElement('li'); - const link = document.createElement('a'); - link.href = doc.url; - link.textContent = doc.name; - link.title = doc.name; - link.target = "_blank"; - - const icon = document.createElement('img'); - icon.classList.add('icon'); - switch (doc.extension) { - case 'pdf': - icon.src = 'arch-ru/static/document-pdf.svg'; - break; - - case 'docs': - icon.src = 'arch-ru/static/microsoft-word.svg'; - break; - - default: - icon.src = 'arch-ru/static/microsoft-word.svg'; - } - listItem.appendChild(icon); - listItem.appendChild(link); - listElement.appendChild(listItem); - }); -} -window.onload = fetchDocuments; diff --git a/static/css/sidebar-common.css b/static/css/sidebar-common.css index b806f9b..aefe8fb 100644 --- a/static/css/sidebar-common.css +++ b/static/css/sidebar-common.css @@ -5,7 +5,7 @@ .sidebar-right { width: 100%; min-height: 100vh; - background-color: #455dc7; + background-color: var(--primary-color); position: absolute; top: 0; bottom: 0; @@ -72,7 +72,7 @@ .sidebar-right .nav-link:hover, .sidebar-left .nav-link.active, .sidebar-right .nav-link.active { - background-color: #5b72d6; + background-color: var(--primary-color-light); border-radius: 1rem; } @@ -81,41 +81,6 @@ font-size: 1rem; } -.sidebar-left .dropdown-toggle:after, -.sidebar-right .dropdown-toggle:after { - display: none; -} - -.sidebar-left .dropdown-menu, -.sidebar-right .dropdown-menu { - position: relative !important; - padding: 0; - margin: 0; - width: 100%; - overflow: hidden; - transform: unset !important; - top: unset !important; - left: unset !important; - min-width: unset !important; - background-color: #3a51b5; - border-radius: 0 !important; -} - -.sidebar-left .dropdown-item, -.sidebar-right .dropdown-item { - padding: 0.8rem 0 0.8rem 1.5rem; - margin: 0; -} - -.sidebar-left .dropdown-item:hover, -.sidebar-right .dropdown-item:hover, -.sidebar-left .dropdown-item:active, -.sidebar-right .dropdown-item:active, -.sidebar-left .dropdown-item:focus, -.sidebar-right .dropdown-item:focus { - background-color: #6177d9; -} - .sidebar-left .nav-link, .sidebar-right .nav-link { position: relative; diff --git a/static/css/sidebar-left.css b/static/css/sidebar-left.css index bb1b00c..1559fea 100644 --- a/static/css/sidebar-left.css +++ b/static/css/sidebar-left.css @@ -103,8 +103,8 @@ } /* Clear btn */ .sidebar-left .nav-body .clear-btn { - color: white; - border: 0.1rem solid white; + color: var(--white); + border: 0.1rem solid var(--white); border-radius: 1rem; padding: 0.3rem; display: flex; @@ -158,7 +158,7 @@ text-decoration: none; } .sidebar-left .nav-body .card-body .database-item a:hover{ - color: #ffffff94; + color: var(--transparent-light-grey); } .sidebar-left .nav-body .card-body .settings-item { white-space: nowrap; @@ -166,7 +166,7 @@ display: flex; flex-direction: column; padding: 0.5rem 0.5rem; - border: 0.05rem solid #ffffff3a; + border: 0.05rem solid var(--transparent-dark-grey); border-radius: 1rem; margin-bottom: 0.5rem; opacity: 1; @@ -230,7 +230,7 @@ .slider-container input[type="range"]::-moz-range-thumb { width: 1rem; height: 1rem; - background: #343a40; + background: var(--dark-grey); border-radius: 50%; cursor: pointer; } @@ -243,7 +243,7 @@ left: 0px; height: 100%; width: 100%; - background: linear-gradient(to right, #5b71d600 0%, #5b71d600 70%, var(--primary-color-light) 93%); + background: linear-gradient(to right, var(--shadeoverlay) 0%, var(--shadeoverlay) 70%, var(--primary-color-light) 93%); border-radius: 1rem; pointer-events: none; } diff --git a/static/css/sidebar-right.css b/static/css/sidebar-right.css index 2d53cb2..b9dec8d 100644 --- a/static/css/sidebar-right.css +++ b/static/css/sidebar-right.css @@ -13,7 +13,7 @@ } .right-sidebar-closed .sidebar-right #sidebarToggleHolder { position: absolute !important; - color: #858791 !important; + color: var(--grey) !important; right: 0; top: 0; padding: 1.5rem; @@ -176,4 +176,5 @@ canvas { color: var(--black); width: 100%; text-wrap: nowrap; -} \ No newline at end of file +} + diff --git a/static/css/variables.css b/static/css/variables.css index 2b05b6b..334456f 100644 --- a/static/css/variables.css +++ b/static/css/variables.css @@ -11,4 +11,8 @@ --background-color: rgba(0, 0, 0, 0.5); --light-grey: rgb(221, 221, 221); --grey: rgb(176, 176, 176); + --dark-grey: #343a40; + --transparent-light-grey: #ffffff94; + --transparent-dark-grey: #ffffff3a; + --shadeoverlay: #5b71d600; } \ No newline at end of file diff --git a/static/document-pdf.svg b/static/document-pdf.svg deleted file mode 100644 index 62a921b..0000000 --- a/static/document-pdf.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/seuslogo.jpeg b/static/img/seuslogo.jpeg similarity index 100% rename from static/seuslogo.jpeg rename to static/img/seuslogo.jpeg diff --git a/static/img/utu_logo.png b/static/img/utu_logo.png new file mode 100644 index 0000000..a7c6d97 Binary files /dev/null and b/static/img/utu_logo.png differ diff --git a/static/img/view-off.svg b/static/img/view-off.svg new file mode 100644 index 0000000..f3e4fc4 --- /dev/null +++ b/static/img/view-off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/js/script.js b/static/js/script.js index e247884..469604a 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -43,7 +43,7 @@ document.addEventListener("DOMContentLoaded", function() { * Initializes the main settings and elements when the page is loaded. */ function init() { - initializeDefaultSettings('similarity', 5, 80, 5, 25, 5, 25, 'openai', 'gpt-3.5-turbo'); + initializeDefaultSettings('similarity', 5, 80, 5, 25, 5, 0.5, 'openai', 'gpt-3.5-turbo'); clearChatHistory(true); handleResponsiveClasses(); collapseSidebarsOnLoad(); @@ -61,6 +61,17 @@ document.addEventListener("DOMContentLoaded", function() { hideOverlay(); } + /** + * Delays execution of other functions + */ + function debounce(func, wait) { + let timeout; + return function(...args) { + clearTimeout(timeout); + timeout = setTimeout(() => func.apply(this, args), wait); + }; + } + /** * Initializes Bootstrap tooltips for the page. */ @@ -177,42 +188,47 @@ document.addEventListener("DOMContentLoaded", function() { function updateSettings() { similaritySlider.addEventListener('input', function() { similaritySliderValue.textContent = this.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); similarityScoreSlider.addEventListener('input', function() { similarityScoreSliderValue.textContent = this.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); maxChunkSlider.addEventListener('input', function() { maxChunkSliderValue.textContent = maxChunkSlider.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); consideredChunkSlider.addEventListener('input', function() { consideredChunkSliderValue.textContent = this.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); retrievedChunkSlider.addEventListener('input', function() { retrievedChunkSliderValue.textContent = this.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); lambdaSlider.addEventListener('input', function() { lambdaSliderValue.textContent = this.value; - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); searchTypeDropdown.addEventListener('change', function() { - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); embeddingModelDropdown.addEventListener('change', function() { - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); llmModelDropdown.addEventListener('change', function() { - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); historySwitchBtn.addEventListener('change', function() { - submitSettingsToServer(); + debounceSubmitSettingsToServer(); }); } + /** + * Delayed version of submitSettingsToServer() sending settings only when user stops the sliders + */ + const debounceSubmitSettingsToServer = debounce(submitSettingsToServer, 300); + /** * Submits the updated settings to the server. */ @@ -226,7 +242,7 @@ document.addEventListener("DOMContentLoaded", function() { max_chunk_return: parseInt(maxChunkSlider.value, 10), considered_chunk: parseInt(consideredChunkSlider.value, 10), mmr_doc_nb: parseInt(retrievedChunkSlider.value, 10), - lambda_mult: parseInt(lambdaSlider.value, 10) / 100, + lambda_mult: parseInt(100 * parseFloat(lambdaSlider.value).toFixed(2), 10) / 100, //parseFloat(lambdaSlider.value).toFixed(2) introduced an error with float type in python. That is the way I made it work.... isHistoryOn : historySwitchBtn.checked }; fetch(`${root}/update-settings`, { @@ -320,6 +336,13 @@ document.addEventListener("DOMContentLoaded", function() { const viewContainer = document.getElementById(`pdf-${docNum}`); viewButton.addEventListener('click', () => { viewContainer.classList.toggle('hide'); + viewIcon = document.getElementById(`view_icon_${docNum}`) + if (viewContainer.classList.contains('hide')) { + viewIcon.src = `${root}/static/img/view.svg`; + } + else { + viewIcon.src = `${root}/static/img/view-off.svg`; + } }); } } @@ -366,7 +389,6 @@ document.addEventListener("DOMContentLoaded", function() { }); }); } - pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) { // TODO fix the page system, the one Antonin converted are wrong and need pageNumber+1 pdfDoc = pdfDoc_; @@ -624,11 +646,11 @@ document.addEventListener("DOMContentLoaded", function() { viewIcon.classList.add('icon'); viewIcon.classList.add('download-icon'); viewIcon.src = `${root}/static/img/view.svg`; + viewIcon.id = `view_icon_${contextNumber}` viewButton.id = `view${contextNumber}`; viewButton.className = 'btn-ctx-nav'; viewButton.setAttribute('data-document-name', fileName); - viewButton.setAttribute('data-page-number', metadatas["page"]); - + viewButton.setAttribute('data-page-number', metadatas["page_counter"]); viewButton.appendChild(viewIcon); cardFooter.appendChild(viewButton); diff --git a/static/logo.png b/static/logo.png deleted file mode 100644 index cfb1f7c..0000000 Binary files a/static/logo.png and /dev/null differ diff --git a/static/microsoft-word.svg b/static/microsoft-word.svg deleted file mode 100644 index dcfc1c3..0000000 --- a/static/microsoft-word.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/script.js b/static/script.js deleted file mode 100644 index 7131413..0000000 --- a/static/script.js +++ /dev/null @@ -1,179 +0,0 @@ -const body = document.querySelector("body"), -leftSidebar = body.querySelector(".left-sidebar"), -toggleLeft = body.querySelector(".toggle"), -rightSidebar = body.querySelector(".right-sidebar"), -toggleRight = body.querySelector(".toggle-right"), -modeText = body.querySelector(".mode-text"), -chatBox = body.querySelector(".chatbox"), -chatInput = body.querySelector(".chat-text"), -sendBtn = body.querySelector(".chat-input button"), -context = body.querySelector(".context-text"), -source = body.querySelector(".source-text"); - -let userMessage; - - -document.addEventListener('DOMContentLoaded', function() { - // Open the right-sidebar when page is loaded/reloaded and window size > 768 - if (window.innerWidth > 768) { - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); - } -}); - -window.addEventListener("resize", function() { - // Gestion of sidebar when windows is getting resized - if (window.innerWidth < 768) { - if (!rightSidebar.classList.contains("right-close")) { - leftSidebar.classList.toggle("right-close"); - rightSidebar.classList.toggle("right-close"); - } - if (!rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } - else if (window.innerWidth < 1024) { - if (!rightSidebar.classList.contains("right-close") && !rightSidebar.classList.contains("left-close")) { - leftSidebar.classList.toggle("left-close"); - rightSidebar.classList.toggle("left-close"); - } - } -}); - - -toggleLeft.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - rightSidebar.classList.add("right-close"); - leftSidebar.classList.add("right-close"); - } - rightSidebar.classList.toggle("left-close"); - leftSidebar.classList.toggle("left-close"); -}); - -toggleRight.addEventListener("click", () => { - if (window.innerWidth <= 1024) { - leftSidebar.classList.add("left-close"); - rightSidebar.classList.add("left-close"); - } - rightSidebar.classList.toggle("right-close"); - leftSidebar.classList.toggle("right-close"); -}); - -const createChatLi = (message, className) => { - const chatLi = document.createElement("li"); - chatLi.classList.add("chat", className); - let chatContent = className === "incoming" ? `

${message}

` : `

${message}

`; - chatLi.innerHTML = chatContent; - return chatLi; -}; - -const printContext = (contextText) => { - context.textContent.length(); - console.log(length); -}; - -const handleChat = () => { - userMessage = chatInput.value.trim(); - console.log(userMessage) - if(!userMessage) return; - - // Append the user's message to the chatbox - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - chatBox.scrollTo(0, chatBox.scrollHeight); - - setTimeout(() => { - // Display "Thinking..." message while waiting for the response - const incomingChatLi = createChatLi("Thinking...", "incoming"); - chatBox.appendChild(incomingChatLi); - chatBox.scrollTo(0, chatBox.scrollHeight); - }, 600); - -}; - -$(document).ready(function() { - function submitQuerry() { - userMessage = chatInput.value.trim(); - console.log(userMessage); - chatBox.appendChild(createChatLi(userMessage, "outgoing")); - $.ajax({ - data: { - msg: userMessage, - }, - type: "POST", - url: "/seus/get", - }).done(function(data) { - //var botHtml = '
' + data + '' + str_time + '
'; - //$("#messageFormeight").append($.parseHTML(botHtml)); - chatBox.appendChild(createChatLi(data.response, "incoming")); - chatBox.scrollTo(0, chatBox.scrollHeight); - context.innerHTML = ""; - source.innerHTML = ""; - - let counter = 1; - data.context.forEach(function(ctx){ - context.innerHTML += "Chunk " + counter + " :

" + ctx.replace(/\n/g,"
") + "

"; - counter++; - }) - - data.source.forEach(function(src) { - source.innerHTML += src + "
"; - }); - }); - event.preventDefault(); - chatInput.value = ""; - } - - $("#message-area").on("submit", function(event) { - event.preventDefault(); - submitQuerry(); - }); - - $("#message-area").on("keypress", function(event) { - if (event.key === "Enter") { - event.preventDefault(); - submitQuerry(); - } - }); -}); - -// Function to get documents from server -async function fetchDocuments() { - const response = await fetch('/seus/documents'); - const documents = await response.json(); - const listElement = document.getElementById('document-list'); - - documents.forEach(doc => { - const listItem = document.createElement('li'); - const link = document.createElement('a'); - link.href = doc.url; - link.textContent = doc.name; - link.title = doc.name; - link.target = "_blank"; - - const icon = document.createElement('img'); - icon.classList.add('icon'); - switch (doc.extension) { - case 'pdf': - icon.src = 'seus/static/document-pdf.svg'; - break; - - case 'PDF': - icon.src = 'seus/static/document-pdf.svg'; - break; - - case 'docs': - icon.src = 'seus/static/microsoft-word.svg'; - break; - - default: - icon.src = 'seus/static/microsoft-word.svg'; - } - listItem.appendChild(icon); - listItem.appendChild(link); - listElement.appendChild(listItem); - }); -} -window.onload = fetchDocuments; \ No newline at end of file diff --git a/static/seuslogofull.jpeg b/static/seuslogofull.jpeg deleted file mode 100644 index 5ee0e80..0000000 Binary files a/static/seuslogofull.jpeg and /dev/null differ diff --git a/static/style.css b/static/style.css deleted file mode 100644 index e699e68..0000000 --- a/static/style.css +++ /dev/null @@ -1,552 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap'); - -:root{ - /*===== Colors =====*/ - --body-color: #E4E9F7; - --sidebar-color: #FFF; - --primary-color: #e89441; /*#9B7AE3*/ - --primary-color-light: #F6F5FF; - --toggle-color: #DDD; - --scroll-color: #C8C8C8; - --text-color: #707070; - - /*===== Transitions =====*/ - --tran-02: all 0.2s ease; - --tran-03: all 0.3s ease; - --tran-04: all 0.4s ease; - --tran-05: all 0.5s ease; - --tran-06: all 0.6s ease; - --tran-07: all 0.7s ease; - --tran-20: all 2s ease; -} - -/*=====================*/ -/*===== ScrollBar =====*/ -/*=====================*/ - -/* width */ -::-webkit-scrollbar { - width: 5px; -} - -/* Handle */ -::-webkit-scrollbar-thumb { - background: var(--scroll-color); - border-radius: 10px; -} - -/* Handle on hover */ -::-webkit-scrollbar-thumb:hover { - background: var(--primary-color); -} - -/*================*/ -/*===== Body =====*/ -/*================*/ - -*{ - font-family: "Poppins", sans-serif; - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body{ - z-index: -2; - height: 100vh; - position: relative; - min-width: 100vw; - background: var(--body-color); -} - -/*========================*/ -/*===== Left-sidebar =====*/ -/*========================*/ - -.left-sidebar{ - position:fixed; - top: 0; - left: 0; - height: 100%; - width: 250px; - padding: 10px 14px; - background: var(--sidebar-color); - transition: var(--tran-03); -} - -/*===== Logo + left top text =====*/ - -.left-sidebar header{ - position: relative; -} - -.left-sidebar .image-text img{ - position: relative; - left: -11px; - width: 74px; - border-radius: 6px; -} -.left-sidebar header .image-text{ - display: flex; - align-items: center; -} - -header .image-text .header-text{ - display: flex; - flex-direction: column; -} -.header-text .name{ - font-weight: 900; - color: var(--primary-color); -} -.header-text .profession{ - margin-top: -2px; -} - -/*===== Toggle arrow to reduce the left-sidebar =====*/ -.left-sidebar .toggle{ - position: absolute; - top: 50%; - right: -10px; - transform: translateY(-50%) rotate(180deg); - height: 25px; - width: 25px; - background: var(--primary-color); - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - color: var(--sidebar-color); - font-size: 22px; - z-index: 1; -} - -/*===== Rotating arrow if left-sidebar closed =====*/ -.left-sidebar.left-close .toggle{ - transform: translateY(-50%); -} - -/*===== left-sidebar components =====*/ -.left-sidebar .nav-link{ - background: var(--toggle-color); - border-radius: 5px 5px 0px 0px; - height: 50px; - margin-top: 10px; - list-style: none; - display: flex; - align-items: center; -} -.left-sidebar .nav-link .icon{ - min-width: 50px; - font-size: 20px; - display: flex; - align-items: center; - justify-content: center; -} -.left-sidebar .nav-link .icon, -.left-sidebar .nav-link .text{ - color: var(--text-color) -} - -.left-sidebar .image{ - min-width: 60px; - display: flex; - align-items: center; -} - -.left-sidebar .text, -.right-sidebar .text{ - font-size: 16px; - font-weight: 500; - color: var(--text-color); - transition: var(--tran-03); - white-space: nowrap; - visibility: visible; - opacity: 1s; -} - -.left-sidebar .document-list{ - background-color: var(--toggle-color); - border-radius: 0px 0px 5px 5px; - list-style: none; - visibility: visible; - opacity: 1; - transition: var(--tran-03); - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} -.left-sidebar .document-list li{ - margin-left: 5px; - margin-right: 5px; - display: flex; - align-items: center; -} -.left-sidebar .document-list .icon{ - color: var(--text-color); - width: 20px; - height: 20px; - margin-right: 10px -} -.left-sidebar .document-list a{ - color: var(--text-color); - text-decoration: none; -} -.left-sidebar .document-list a:hover{ - color: var(--primary-color); -} - -/*===== Left-sidebar Close =====*/ - -.left-sidebar.left-close .text, -.left-sidebar.left-close .document-list{ - visibility: hidden; - opacity: 0; -} -.left-sidebar.left-close .document-list a{ - pointer-events: none; -} -.left-sidebar.left-close ~ .main{ -left: 78px; -width: calc(100% - 678px); -transition: var(--tran-03); -} -.left-sidebar.left-close.right-close ~ .main{ -left: 78px; -width: calc(100% - 156px); -transition: var(--tran-03); -} -.left-sidebar.right-close ~ .main{ -width: calc(100% - 328px); -} -.left-sidebar.left-close{ -width: 78px; -} -.left-sidebar.left-close ~ .chatbot{ - width: calc(100% - 538px); -} - -.right-sidebar.right-close{ - width: 78px; - transition: var(--tran-03); -} - -/*===================*/ -/*===== Chatbot =====*/ -/*===================*/ - -.main{ - position: absolute; - left: 250px; - padding: 5px 25px; - width: calc(100% - 850px); - height: 100vh; - transition: var(--tran-03); - z-index: -1; -} - -.chatbot{ - position: relative; - height: 100%; - width: 100%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5); -} - -/*===== Chatbot Header =====*/ -.chatbot header{ - position: absolute; - width: 100%; - z-index: 1; - background: var(--primary-color); - padding: 16px 0; - text-align: center; -} - -.chatbot header h2{ - color: var(--sidebar-color); - font-size: 1.4rem; -} - -/*===== Chatbox =====*/ -.chatbot .chatbox{ - position: absolute; - width: 100%; - height: calc(100% - 85px); - overflow-y: auto; - padding: 85px 20px 70px; -} -.chatbox .chat{ - display: flex; -} -/*===== AI chat =====*/ -.chatbox .incoming span{ - color: var(--sidebar-color); - align-self: flex-end; - background: var(--primary-color); - border-radius: 4px; - margin: 0 10px 7px 0; - text-align: center; -} -.bxs-message-dots{ - margin: 8px; -} -/*===== User chat =====*/ -.chatbox .outgoing{ - justify-content: flex-end; -} - -.chatbox .chat p{ - color: var(--sidebar-color); - max-width: 75%; - font-size: 0.9rem; - padding: 7px 7px; - border-radius: 5px 5px 0 5px; - background: var(--primary-color); -} - -.chatbox .incoming p{ - color: var(--text-color); - background: var(--primary-color-light); - border-radius: 5px 5px 5px 0; -} - -.chatbox li{ - padding: 5px; -} - -.chatbot .chat-input{ - position: absolute; - bottom: 0; - width: 100%; - gap: 5px; - background: var(--sidebar-color); - padding: 5px 20px; - border-top: 1px solid #ccc; -} - -/*===== Chatbot textarea =====*/ -.chat-input textarea{ - height: 55px; - width: 100%; - border: none; - outline: none; - font-size: 0.9rem; - resize: none; - padding: 16px 15px 16px 0; -} - -.chat-input button{ - align-self: flex-end; - height: 55px; - line-height: 55px; - color: var(--primary-color); - font-size: 1.35rem; - cursor: pointer; - visibility: hidden; - border: none; -} - -/*===== Send icon visible only if there is text =====*/ -.chat-input textarea:valid ~ button{ - visibility: visible; -} - -/*=========================*/ -/*===== Right-sidebar =====*/ -/*=========================*/ - -.right-sidebar{ - position:absolute; - top: 0; - right: 0; - width: 600px; - height: 100%; - padding: 10px 14px; - background: var(--sidebar-color); - transition: var(--tran-03); -} -.context{ - position: relative; - width: 100%; - height: 68%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - /*box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5);*/ -} - -.blank{ - position: relative; - height: 2%; -} -.source{ - position: relative; - width: 100%; - height: 30%; - overflow: hidden; - background: var(--toggle-color); - border-radius: 5px; - /*box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), - 0 32px 64px -48px rgba(0,0,0,0.5);*/ -} -.border{ - position: absolute; - top: 0px; - bottom: 0px; - display: contents ; -} - -.right-sidebar .toggle-right{ - position: absolute; - top: 50%; - right: 586px; - transform: translateY(-50%) ; - height: 25px; - width: 25px; - background: var(--primary-color); - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - color: var(--sidebar-color); - font-size: 22px; - z-index: 1; - transition: var(--tran-03); -} - -.right-sidebar.right-close .toggle-right{ - transform: translateY(-50%) rotate(180deg); - right: 64px; -} - -.right-sidebar li{ - border-radius: 5px; - height: 40px; - list-style: none; - display: flex; - align-items: center; - justify-content: flex-end; -} -.right-sidebar li .icon{ - min-width: 50px; - font-size: 20px; - display: flex; - align-items: center; - justify-content: center; -} -.right-sidebar li .icon, -.right-sidebar li .text{ - color: var(--text-color); - white-space: nowrap; - opacity: 1; -} - -.right-sidebar-box{ -padding: 5px; -height: calc(100% - 40px); -transition: var(--tran-03); -} - -.right-sidebar-text-container{ -position: relative; -background: var(--sidebar-color); -height: 100%; -border-radius: 5px; -overflow: auto; -text-align: justify; -} - -.context-text, .source-text{ - color: var(--text-color); - font-size: 0.9rem; - padding: 12px 16px; - transform-origin: top; - justify-self: flex-start; - opacity: 1; -} -.source-text{ - text-align: left; -} - -/*===== Right-sidebar close =====*/ -.right-sidebar.right-close .text{ - opacity: 0; - transition: var(--tran-03); -} -.right-sidebar.right-close .right-sidebar-box{ - padding: 5px; - height: 91%; - opacity: 0; - transition: var(--tran-03); -} - - - -@media (max-width: 1400px) { - .right-sidebar{ - width: 400px; - } - .right-sidebar .toggle-right{ - right: 386px; - } - .left-sidebar.left-close ~ .main{ - width: calc(100% - 478px); - } - .left-sidebar.right-close ~ .main{ - width: calc(100% - 328px); - } - .main{ - width: calc(100% - 650px); - } -} -/* Pour les écrans inférieurs à 768px */ -@media (max-width: 768px) { - .main{ - visibility: hidden; - } - .left-sidebar, .right-sidebar { - visibility: visible; - width: 100%; - } - .right-sidebar{ - z-index: -1; - } - .right-sidebar.right-close{ - z-index: 1; - } - .left-sidebar.left-close, .right-sidebar.right-close { - visibility: hidden; - } - .right-sidebar .toggle-right{ - right: -6px; - z-index: 1; - } - .left-sidebar .toggle{ - left: -8px; - } - .left-sidebar.left-close .toggle{ - visibility: visible; - left: -8px; - } - .right-sidebar.right-close .toggle-right{ - visibility: visible; - right: -6px; - z-index: 1; - } - - .left-sidebar.left-close.right-close ~ .main { - visibility: visible; - left: 0px; - width: 100%; - padding: 0px; - } -} - -@media (max-width: 1024px) { -/* TODO */ -} diff --git a/templates/arch_en_index.html b/templates/arch_en_index.html index d39bb00..08bb8c2 100644 --- a/templates/arch_en_index.html +++ b/templates/arch_en_index.html @@ -5,15 +5,16 @@ TurkuNLP RAG - - - - - - - - - + + + + + + + + + + @@ -66,8 +67,8 @@
1 - - 30 + + 50
@@ -85,8 +86,8 @@
1 - - 30 + + 50
@@ -96,24 +97,24 @@
1 - - 30 + + 50
InfoRetrieved chunks: 1
1 - - 30 + + 50
- InfoLambda multiplicator: 1% + InfoLambda multiplicator: 1
- 0% - - 100% + 0 + + 1
@@ -153,7 +154,7 @@
  • - +
  • diff --git a/templates/arch_ru_index.html b/templates/arch_ru_index.html index 31a0404..891e679 100644 --- a/templates/arch_ru_index.html +++ b/templates/arch_ru_index.html @@ -1,95 +1,257 @@ - - - - - - - - - RAG + + + + TurkuNLP RAG + + + + + + + + + + + + - + - + + - - - - - - - + + + + + + - \ No newline at end of file + + diff --git a/templates/local.html b/templates/local.html index 7eae816..974157a 100644 --- a/templates/local.html +++ b/templates/local.html @@ -4,21 +4,20 @@ - Sidebar Chat - - - - - - - - - + TurkuNLP RAG + + + + + + + + + + - -
    @@ -28,10 +27,10 @@ @@ -41,7 +40,7 @@
    @@ -50,7 +49,7 @@
  • @@ -124,16 +123,14 @@
  • @@ -143,7 +140,7 @@
    @@ -153,11 +150,11 @@
  • - +
  • - +
  • @@ -166,7 +163,7 @@
    @@ -180,12 +177,12 @@
    @@ -205,7 +202,7 @@
    @@ -221,7 +218,7 @@ @@ -229,13 +226,18 @@ @@ -246,8 +248,9 @@ - - + + + diff --git a/templates/seus.html b/templates/seus.html deleted file mode 100644 index 92dc678..0000000 --- a/templates/seus.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - RAG - - - - -
    -
    -
    -

    Chat

    -
    -
      -
    • - -

      How can I help you ?

      -
    • -
    -
    - - -
    -
    -
    - - - - - - - - - - \ No newline at end of file diff --git a/templates/seus_index.html b/templates/seus_index.html new file mode 100644 index 0000000..0fa6eb9 --- /dev/null +++ b/templates/seus_index.html @@ -0,0 +1,257 @@ + + + + + + + TurkuNLP RAG + + + + + + + + + + + + + + +
    + + + + + + +
    +
    +
    +
    +
    + Turku NLP RAG +
    +
    +
      +
    +
    + +
    +
    +
    +
    + + + + + + + + + +