This commit is contained in:
Saifeddine ALOUI 2025-04-09 15:39:49 +02:00
parent 2127a613d1
commit 2e0d83e5d3
5 changed files with 12 additions and 41 deletions

View File

@ -653,15 +653,13 @@ class LollmsApplication(LoLLMsCom):
if self.config.active_ttm_service:
def start_ttm(*args, **kwargs):
self.ttv = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttm", self.config.active_ttm_service)
self.ttm = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttm", self.config.active_ttm_service)
ASCIIColors.execute_with_animation("Loading loacal TTM services", start_ttm, ASCIIColors.color_blue)
print("OK")
if self.config.active_ttv_service:
def start_ttv(*args, **kwargs):
self.ttv = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttv", self.config.active_ttv_service)
ASCIIColors.execute_with_animation("Loading loacal TTV services", start_ttv, ASCIIColors.color_blue)
print("OK")
@ -687,16 +685,16 @@ class LollmsApplication(LoLLMsCom):
self.tts = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"tts", self.config.active_tts_service)
ASCIIColors.execute_with_animation("Loading loacal TTS services", start_tts, ASCIIColors.color_blue)
if self.config.active_ttm_service:
def start_ttm(*args, **kwargs):
self.ttv = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttm", self.config.active_ttm_service)
self.ttm = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttm", self.config.active_ttm_service)
ASCIIColors.execute_with_animation("Loading loacal TTM services", start_ttm, ASCIIColors.color_blue)
if self.config.active_ttv_service:
def start_ttv(*args, **kwargs):
self.ttv = self.load_service_from_folder(self.lollms_paths.services_zoo_path/"ttv", self.config.active_ttv_service)
ASCIIColors.execute_with_animation("Loading loacal TTV services", start_ttv, ASCIIColors.color_blue)
print("OK")
@ -1915,35 +1913,7 @@ Don't forget encapsulate the code inside a markdown code tag. This is mandatory.
mounted_personalities.append(personality)
if self.config.auto_read and len(personality.audio_samples) > 0:
try:
from lollms.services.tts.xtts.lollms_xtts import \
LollmsXTTS
if self.tts is None:
voice = self.config.xtts_current_voice
if voice != "main_voice":
voices_folder = self.lollms_paths.custom_voices_path
else:
voices_folder = (
Path(__file__).parent.parent.parent
/ "services/xtts/voices"
)
self.tts = LollmsXTTS(
self,
voices_folders=[
voices_folder,
Path(__file__).parent.parent.parent
/ "services/xtts/voices",
],
freq=self.config.xtts_freq,
)
except Exception as ex:
trace_exception(ex)
self.warning(
f"Personality {personality.name} request using custom voice but couldn't load XTTS"
)
pass # self.tts
except Exception as ex:
trace_exception(ex)
ASCIIColors.error(

View File

@ -77,7 +77,7 @@ class LoLLMsCom:
verbose=verbose
)
)
async def ShowBlockingMessage(self, content, client_id=None, verbose:bool=None):
def ShowBlockingMessage(self, content, client_id=None, verbose:bool=None):
self.schedule_task( self.notify(
content,
notification_type=NotificationType.NOTIF_SUCCESS,

View File

@ -663,7 +663,7 @@ class Message:
text, tuple(params)
)
def update_steps(self, steps:list, step_type:str, status:bool):
def update_steps(self, steps:list):
self.finished_generating_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
text = f"UPDATE message SET steps = ?"
self.steps = steps
@ -1205,7 +1205,7 @@ class Discussion:
message_id (int): The id of the message to be changed
new_content (str): The nex message content
"""
self.current_message.update_steps(new_content, started_generating_at, nb_tokens)
self.current_message.update_steps(steps)

View File

@ -13,12 +13,13 @@ class FunctionType(Enum):
# Step 2: Update the FunctionCall base class
class FunctionCall:
def __init__(self, name:str, app:LoLLMsCom, function_type: FunctionType, client: Client, static_parameters:TypedConfig=None):
def __init__(self, name:str, app:LoLLMsCom, function_type: FunctionType, client: Client, static_parameters:TypedConfig=None, description=""):
self.name = name
self.app = app
self.personality = app.personality
self.function_type = function_type
self.client = client
self.description = description
if static_parameters is not None:
self.static_parameters = static_parameters
self.sync_configuration()

View File

@ -91,7 +91,7 @@ async def list_ttm_services(request: ServiceListingRequest):
return ttm_services
@router.post("/get_active_ttm_settmngs")
@router.post("/get_active_ttm_settings")
async def get_active_ttm_settmngs(request: Request):
data = await request.json()
check_access(lollmsElfServer,data["client_id"])
@ -104,7 +104,7 @@ async def get_active_ttm_settmngs(request: Request):
else:
return {}
@router.post("/set_active_ttm_settmngs")
@router.post("/set_active_ttm_settings")
async def set_active_ttm_settmngs(request: Request):
data = await request.json()
check_access(lollmsElfServer,data["client_id"])