mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
Added callbacks to personalities
This commit is contained in:
parent
6b650343b5
commit
9aef34cd81
@ -1140,6 +1140,9 @@ class APScript(StateMachine):
|
|||||||
step_text (str): The step text
|
step_text (str): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step start to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step start to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(step_text, MSG_TYPE.MSG_TYPE_STEP_START)
|
callback(step_text, MSG_TYPE.MSG_TYPE_STEP_START)
|
||||||
|
|
||||||
@ -1150,6 +1153,9 @@ class APScript(StateMachine):
|
|||||||
step_text (str): The step text
|
step_text (str): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step end to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step end to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(step_text, MSG_TYPE.MSG_TYPE_STEP_END, {'status':status})
|
callback(step_text, MSG_TYPE.MSG_TYPE_STEP_END, {'status':status})
|
||||||
|
|
||||||
@ -1160,6 +1166,9 @@ class APScript(StateMachine):
|
|||||||
step_text (str): The step text
|
step_text (str): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(step_text, MSG_TYPE.MSG_TYPE_STEP)
|
callback(step_text, MSG_TYPE.MSG_TYPE_STEP)
|
||||||
|
|
||||||
@ -1170,6 +1179,9 @@ class APScript(StateMachine):
|
|||||||
step_text (str): The step text
|
step_text (str): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(str(ex), MSG_TYPE.MSG_TYPE_EXCEPTION)
|
callback(str(ex), MSG_TYPE.MSG_TYPE_EXCEPTION)
|
||||||
|
|
||||||
@ -1180,6 +1192,9 @@ class APScript(StateMachine):
|
|||||||
step_text (str): The step text
|
step_text (str): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(warning, MSG_TYPE.MSG_TYPE_EXCEPTION)
|
callback(warning, MSG_TYPE.MSG_TYPE_EXCEPTION)
|
||||||
|
|
||||||
@ -1190,6 +1205,9 @@ class APScript(StateMachine):
|
|||||||
inf (str): The information to be sent
|
inf (str): The information to be sent
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(info, MSG_TYPE.MSG_TYPE_INFO)
|
callback(info, MSG_TYPE.MSG_TYPE_INFO)
|
||||||
|
|
||||||
@ -1200,6 +1218,9 @@ class APScript(StateMachine):
|
|||||||
step_text (dict): The step text
|
step_text (dict): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(json.dumps(json_infos, indent=indent), MSG_TYPE.MSG_TYPE_JSON_INFOS)
|
callback(json.dumps(json_infos, indent=indent), MSG_TYPE.MSG_TYPE_JSON_INFOS)
|
||||||
|
|
||||||
@ -1210,6 +1231,9 @@ class APScript(StateMachine):
|
|||||||
step_text (dict): The step text
|
step_text (dict): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(html_ui, MSG_TYPE.MSG_TYPE_UI)
|
callback(html_ui, MSG_TYPE.MSG_TYPE_UI)
|
||||||
|
|
||||||
@ -1220,6 +1244,9 @@ class APScript(StateMachine):
|
|||||||
step_text (dict): The step text
|
step_text (dict): The step text
|
||||||
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the step to. Defaults to None.
|
||||||
"""
|
"""
|
||||||
|
if not callback and self.callback:
|
||||||
|
callback = self.callback
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
callback(code, MSG_TYPE.MSG_TYPE_CODE)
|
callback(code, MSG_TYPE.MSG_TYPE_CODE)
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -26,7 +26,7 @@ def get_all_files(path):
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="lollms",
|
name="lollms",
|
||||||
version="2.3.1",
|
version="2.3.2",
|
||||||
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",
|
||||||
|
Loading…
Reference in New Issue
Block a user