enhanced lollms

This commit is contained in:
Saifeddine ALOUI 2023-07-29 02:41:15 +02:00
parent 695e1d6e18
commit 2c8dda35e3
3 changed files with 18 additions and 2 deletions

View File

@ -1281,6 +1281,19 @@ class APScript(StateMachine):
if callback: if callback:
callback(step_text, MSG_TYPE.MSG_TYPE_STEP_PROGRESS, {'progress':progress}) callback(step_text, MSG_TYPE.MSG_TYPE_STEP_PROGRESS, {'progress':progress})
def new_message(self, step_text:str, message_type:MSG_TYPE, callback: Callable[[str, int, dict], bool]=None):
"""This sends step rogress to front end
Args:
step_text (dict): The step progress in %
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the progress to. Defaults to None.
"""
if not callback and self.callback:
callback = self.callback
if callback:
callback(step_text, MSG_TYPE.MSG_TYPE_NEW_MESSAGE, {'type':message_type})
#Helper method to convert outputs path to url #Helper method to convert outputs path to url
def path2url(file): def path2url(file):
file = str(file).replace("\\","/") file = str(file).replace("\\","/")

View File

@ -25,6 +25,9 @@ class MSG_TYPE(Enum):
MSG_TYPE_CODE = 13# A javascript code to execute MSG_TYPE_CODE = 13# A javascript code to execute
MSG_TYPE_UI = 14# A vue.js component to show (we need to build some and parse the text to show it) MSG_TYPE_UI = 14# A vue.js component to show (we need to build some and parse the text to show it)
#Commands
MSG_TYPE_NEW_MESSAGE = 15# A new message
class GenerationPresets: class GenerationPresets:
""" """
Class containing various generation presets. Class containing various generation presets.

View File

@ -26,7 +26,7 @@ def get_all_files(path):
setuptools.setup( setuptools.setup(
name="lollms", name="lollms",
version="2.1.60", version="2.2.0",
author="Saifeddine ALOUI", author="Saifeddine ALOUI",
author_email="aloui.saifeddine@gmail.com", author_email="aloui.saifeddine@gmail.com",
description="A python library for AI personality definition", description="A python library for AI personality definition",