mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
enhanced core
This commit is contained in:
parent
7ebeeb347a
commit
4b59ab3f50
@ -2253,7 +2253,7 @@ class APScript(StateMachine):
|
||||
|
||||
"""
|
||||
try:
|
||||
self.process_state(command, "", self.callback, client)
|
||||
self.process_state(command, "", self.callback, context_state=None, client= client)
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
self.warning(f"Couldn't execute command {command}")
|
||||
@ -2883,7 +2883,7 @@ class APScript(StateMachine):
|
||||
f' </div>',
|
||||
f' </summary>',
|
||||
f' <div class="px-4 pb-4 pt-2 text-gray-700 dark:text-gray-300 transition-all duration-300 ease-in-out max-h-0 overflow-hidden group-open:max-h-40">',
|
||||
content,
|
||||
f' <p>{content}</p>',
|
||||
f' </div>',
|
||||
f'</details>\n'
|
||||
])
|
||||
@ -3789,7 +3789,7 @@ class APScript(StateMachine):
|
||||
callback = self.callback
|
||||
|
||||
if callback:
|
||||
callback(message_text, MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_NEW_MESSAGE, parameters={'type':message_type.value,'metadata':metadata},personality = self.personality)
|
||||
callback(message_text, MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_NEW_MESSAGE, metadata , personality = self.personality)
|
||||
|
||||
def finished_message(self, message_text:str="", callback: Callable[[str, MSG_OPERATION_TYPE, dict, list], bool]=None):
|
||||
"""This sends step rogress to front end
|
||||
|
@ -17,6 +17,7 @@ from lollms.binding import BindingBuilder, InstallOption
|
||||
from ascii_colors import ASCIIColors
|
||||
from lollms.personality import AIPersonality
|
||||
from lollms.utilities import load_config, trace_exception, gc, terminate_thread, run_async
|
||||
from lollms.types import MSG_TYPE
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
import socketio
|
||||
@ -145,14 +146,15 @@ def add_events(sio:socketio):
|
||||
ump = lollmsElfServer.config.discussion_prompt_separator + lollmsElfServer.config.user_name.strip() if lollmsElfServer.config.use_user_name_in_discussions else lollmsElfServer.personality.user_message_prefix
|
||||
created_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
message = client.discussion.add_message(
|
||||
message_type = MSG_OPERATION_TYPE.MSG_OPERATION_TYPE_SET_CONTENT.value,
|
||||
message_type = MSG_TYPE.MSG_TYPE_CONTENT.value,
|
||||
sender_type = SENDER_TYPES.SENDER_TYPES_USER.value,
|
||||
sender = ump.replace(lollmsElfServer.config.discussion_prompt_separator,"").replace(":",""),
|
||||
content="",
|
||||
metadata=None,
|
||||
content = "",
|
||||
metadata = None,
|
||||
steps = [],
|
||||
parent_message_id=lollmsElfServer.message_id,
|
||||
created_at=created_at,
|
||||
nb_tokens=None
|
||||
created_at = created_at,
|
||||
nb_tokens = None
|
||||
)
|
||||
lollmsElfServer.busy=True
|
||||
command = data["command"]
|
||||
|
Loading…
Reference in New Issue
Block a user