mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-21 05:33:12 +00:00
bugfix
This commit is contained in:
parent
150e7f3251
commit
84f676be95
@ -225,80 +225,6 @@ class LollmsApplication(LoLLMsCom):
|
|||||||
generated_text = self.personality.model.generate(full_discussion, n_predict=n_predict, callback=callback)
|
generated_text = self.personality.model.generate(full_discussion, n_predict=n_predict, callback=callback)
|
||||||
return generated_text
|
return generated_text
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def InfoMessage(self, content, duration:int=4, client_id=None, verbose:bool=True):
|
|
||||||
self.notify(
|
|
||||||
content,
|
|
||||||
notification_type=NotificationType.NOTIF_SUCCESS,
|
|
||||||
duration=duration,
|
|
||||||
client_id=client_id,
|
|
||||||
display_type=NotificationDisplayType.MESSAGE_BOX,
|
|
||||||
verbose=verbose
|
|
||||||
)
|
|
||||||
|
|
||||||
def info(self, content, duration:int=4, client_id=None, verbose:bool=True):
|
|
||||||
self.notify(
|
|
||||||
content,
|
|
||||||
notification_type=NotificationType.NOTIF_SUCCESS,
|
|
||||||
duration=duration,
|
|
||||||
client_id=client_id,
|
|
||||||
display_type=NotificationDisplayType.TOAST,
|
|
||||||
verbose=verbose
|
|
||||||
)
|
|
||||||
|
|
||||||
def warning(self, content, duration:int=4, client_id=None, verbose:bool=True):
|
|
||||||
self.notify(
|
|
||||||
content,
|
|
||||||
notification_type=NotificationType.NOTIF_WARNING,
|
|
||||||
duration=duration,
|
|
||||||
client_id=client_id,
|
|
||||||
display_type=NotificationDisplayType.TOAST,
|
|
||||||
verbose=verbose
|
|
||||||
)
|
|
||||||
|
|
||||||
def success(self, content, duration:int=4, client_id=None, verbose:bool=True):
|
|
||||||
self.notify(
|
|
||||||
content,
|
|
||||||
notification_type=NotificationType.NOTIF_SUCCESS,
|
|
||||||
duration=duration,
|
|
||||||
client_id=client_id,
|
|
||||||
display_type=NotificationDisplayType.TOAST,
|
|
||||||
verbose=verbose
|
|
||||||
)
|
|
||||||
|
|
||||||
def error(self, content, duration:int=4, client_id=None):
|
|
||||||
self.notify(
|
|
||||||
content,
|
|
||||||
notification_type=NotificationType.NOTIF_ERROR,
|
|
||||||
duration=duration,
|
|
||||||
client_id=client_id,
|
|
||||||
display_type=NotificationDisplayType.TOAST
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def notify(
|
|
||||||
self,
|
|
||||||
content,
|
|
||||||
notification_type:NotificationType=NotificationType.NOTIF_SUCCESS,
|
|
||||||
duration:int=4,
|
|
||||||
client_id=None,
|
|
||||||
display_type:NotificationDisplayType=NotificationDisplayType.TOAST,
|
|
||||||
verbose=True
|
|
||||||
):
|
|
||||||
if verbose:
|
|
||||||
if notification_type==NotificationType.NOTIF_SUCCESS:
|
|
||||||
ASCIIColors.success(content)
|
|
||||||
elif notification_type==NotificationType.NOTIF_INFO:
|
|
||||||
ASCIIColors.info(content)
|
|
||||||
elif notification_type==NotificationType.NOTIF_WARNING:
|
|
||||||
ASCIIColors.warning(content)
|
|
||||||
else:
|
|
||||||
ASCIIColors.red(content)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def load_binding(self):
|
def load_binding(self):
|
||||||
try:
|
try:
|
||||||
binding = BindingBuilder().build_binding(self.config, self.lollms_paths, lollmsCom=self)
|
binding = BindingBuilder().build_binding(self.config, self.lollms_paths, lollmsCom=self)
|
||||||
|
@ -68,13 +68,14 @@ class LoLLMsCom:
|
|||||||
verbose=verbose
|
verbose=verbose
|
||||||
)
|
)
|
||||||
|
|
||||||
def error(self, content, duration:int=4, client_id=None):
|
def error(self, content, duration:int=4, client_id=None, verbose:bool=True):
|
||||||
self.notify(
|
self.notify(
|
||||||
content,
|
content,
|
||||||
notification_type=NotificationType.NOTIF_ERROR,
|
notification_type=NotificationType.NOTIF_ERROR,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
client_id=client_id,
|
client_id=client_id,
|
||||||
display_type=NotificationDisplayType.TOAST
|
display_type=NotificationDisplayType.TOAST,
|
||||||
|
verbose = verbose
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user