This commit is contained in:
Saifeddine ALOUI 2024-12-15 02:17:42 +01:00
parent 3204962b6a
commit eb936796ee
4 changed files with 19 additions and 10 deletions

@ -1 +1 @@
Subproject commit d259103fdf498c4d05b6b438f137bb15960c706d Subproject commit 759810a34972992a6e5b9f89b7734db1e7152d4a

View File

@ -1401,14 +1401,14 @@ class LOLLMSWebUI(LOLLMSElfServer):
self.personality.ui(sources_text) self.personality.ui(sources_text)
if len(context_details["skills"]) > 0: if len(context_details["skills"]) > 0:
sources_text += '<div class="text-gray-400 mr-10px">Memories:</div>' sources_text += '<div class="text-gray-400 mr-10px">Memories:</div>'
sources_text += '<div class="mt-4 flex flex-col items-start gap-x-2 gap-y-1.5 text-sm" style="max-height: 500px; overflow-y: auto;">' sources_text += '<div class="mt-4 w-full flex flex-col items-start gap-x-2 gap-y-1.5 text-sm" style="max-height: 500px; overflow-y: auto;">'
ind = 0 ind = 0
for skill in context_details["skills"]: for skill in context_details["skills"]:
sources_text += f''' sources_text += f'''
<div class="source-item"> <div class="source-item">
<button onclick="var details = document.getElementById('source-details-{ind}'); details.style.display = details.style.display === 'none' ? 'block' : 'none';" style="text-align: left; font-weight: bold;"><strong>Memory {ind}: {skill['title']}</strong> - ({skill['similarity']*100:.2f}%)</button> <button onclick="var details = document.getElementById('source-details-{ind}'); details.style.display = details.style.display === 'none' ? 'block' : 'none';" style="text-align: left; font-weight: bold;"><strong>Memory {ind}: {skill['title']}</strong> - ({skill['similarity']*100:.2f}%)</button>
<div id="source-details-{ind}" style="display:none;"> <div id="source-details-{ind}" style="display:none;">
<div style="max-height: 200px; overflow-y: auto;"> <div class="w-full" style="max-height: 200px; overflow-y: auto;">
<pre>{skill['content']}</pre> <pre>{skill['content']}</pre>
</div> </div>
</div> </div>

View File

@ -6,16 +6,24 @@ import argparse
from pathlib import Path from pathlib import Path
from ascii_colors import ASCIIColors, trace_exception from ascii_colors import ASCIIColors, trace_exception
import pipmaster as pm
if not pm.is_installed("PyQt5"):
pm.install("PyQt5")
import sys
from PyQt5.QtWidgets import QApplication, QMessageBox
def show_error_dialog(message): def show_error_dialog(message):
try: try:
import tkinter as tk app = QApplication(sys.argv)
from tkinter import messagebox msg = QMessageBox()
root = tk.Tk() msg.setIcon(QMessageBox.Critical)
root.withdraw() # Hide the main window msg.setText(message)
messagebox.showerror("Error", message) msg.setWindowTitle("Error")
root.destroy() msg.exec_()
except: except:
ASCIIColors.error(message) ASCIIColors.error(message)
def run_git_pull(): def run_git_pull():
try: try:
ASCIIColors.info("----------------> Updating the code <-----------------------") ASCIIColors.info("----------------> Updating the code <-----------------------")
@ -88,6 +96,7 @@ def run_git_pull():
ASCIIColors.error(error_message) ASCIIColors.error(error_message)
# show_error_dialog(error_message) # show_error_dialog(error_message)
return False return False
def get_valid_input(): def get_valid_input():
while True: while True:
update_prompt = "New code is updated. Do you want to update the requirements? (y/n): " update_prompt = "New code is updated. Do you want to update the requirements? (y/n): "

@ -1 +1 @@
Subproject commit 1035dad7c07f08ad71b56326f556bc8afcff58fa Subproject commit 7d4ca0e643b44869882cbbe952192a3e397a74a0