From 637ab030b24a495c8881ea0c73dc37df158b04e8 Mon Sep 17 00:00:00 2001 From: jeffser Date: Thu, 4 Jul 2024 11:43:54 -0600 Subject: [PATCH] Tweaked max auto title length --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 35217af..602d1b4 100644 --- a/src/window.py +++ b/src/window.py @@ -565,7 +565,7 @@ Generate a title following these rules: if 'images' in message: data["images"] = message['images'] response = connection_handler.simple_post(f"{connection_handler.url}/api/generate", data=json.dumps(data)) new_chat_name = json.loads(response['text'])["response"].strip().removeprefix("Title: ").removeprefix("title: ").strip('\'"').title() - new_chat_name = new_chat_name[:30] + (new_chat_name[30:] and '...') + new_chat_name = new_chat_name[:50] + (new_chat_name[50:] and '...') self.rename_chat(label_element.get_name(), new_chat_name, label_element) def show_message(self, msg:str, bot:bool, footer:str=None, images:list=None, files:dict=None, id:str=None):