diff --git a/lollms/server.py b/lollms/server.py index 3d065e1..88e7b59 100644 --- a/lollms/server.py +++ b/lollms/server.py @@ -461,7 +461,7 @@ class LoLLMsServer: self.answer = {"full_text":""} def callback(text, message_type: MSG_TYPE): if message_type == MSG_TYPE.MSG_TYPE_CHUNK: - print(f"generated:{len(self.answer['full_text'])} words", end='\r') + ASCIIColors.success(f"generated:{len(self.answer['full_text'])} words", end='\r') self.answer["full_text"] = self.answer["full_text"] + text self.socketio.emit('text_chunk', {'chunk': text, 'type':MSG_TYPE.MSG_TYPE_CHUNK.value}, room=client_id) self.socketio.sleep(0) diff --git a/lollms/types.py b/lollms/types.py index e2e517b..f4601fa 100644 --- a/lollms/types.py +++ b/lollms/types.py @@ -1,14 +1,21 @@ from enum import Enum class MSG_TYPE(Enum): + # Messaging MSG_TYPE_CHUNK=0 # A chunk of a message (used for classical chat) MSG_TYPE_FULL=1 # A full message (for some personality the answer is sent in bulk) - MSG_TYPE_EXCEPTION=2 # An exception occured - - MSG_TYPE_STEP_START=3 # A step has started (the text contains an explanation of the step done by he personality) - MSG_TYPE_STEP_PROGRESS=4 # The progress value (the text contains a percentage and can be parsed by the reception) - MSG_TYPE_STEP_END=5 # A step has been done (the text contains an explanation of the step done by he personality) - MSG_TYPE_REF=6 # References (in form of [text](path)) - MSG_TYPE_CODE=7 # A javascript code to execute - MSG_TYPE_UI=8 # A vue.js component to show (we need to build some and parse the text to show it) + # Informations + MSG_TYPE_INFO=3 # An information to be shown to user + MSG_TYPE_EXCEPTION=2 # An exception occured + + # Steps + MSG_TYPE_STEP=4 # An instant step (a step that doesn't need time to be executed) + MSG_TYPE_STEP_START=4 # A step has started (the text contains an explanation of the step done by he personality) + MSG_TYPE_STEP_PROGRESS=5 # The progress value (the text contains a percentage and can be parsed by the reception) + MSG_TYPE_STEP_END=6 # A step has been done (the text contains an explanation of the step done by he personality) + + #Extra + MSG_TYPE_REF=7 # References (in form of [text](path)) + MSG_TYPE_CODE=8 # A javascript code to execute + MSG_TYPE_UI=9 # A vue.js component to show (we need to build some and parse the text to show it) diff --git a/setup.py b/setup.py index f793957..a66d3cc 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_all_files(path): setuptools.setup( name="lollms", - version="2.0.27", + version="2.0.28", author="Saifeddine ALOUI", author_email="aloui.saifeddine@gmail.com", description="A python library for AI personality definition",