mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-23 06:22:27 +00:00
enhanced lollms
This commit is contained in:
parent
695e1d6e18
commit
2c8dda35e3
@ -1281,6 +1281,19 @@ class APScript(StateMachine):
|
||||
if callback:
|
||||
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
|
||||
def path2url(file):
|
||||
file = str(file).replace("\\","/")
|
||||
|
@ -25,6 +25,9 @@ class MSG_TYPE(Enum):
|
||||
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)
|
||||
|
||||
#Commands
|
||||
MSG_TYPE_NEW_MESSAGE = 15# A new message
|
||||
|
||||
class GenerationPresets:
|
||||
"""
|
||||
Class containing various generation presets.
|
||||
|
Loading…
Reference in New Issue
Block a user