Tweaked max auto title length

This commit is contained in:
jeffser 2024-07-04 11:43:54 -06:00
parent 3795de4ae9
commit 637ab030b2

View File

@ -565,7 +565,7 @@ Generate a title following these rules:
if 'images' in message: data["images"] = message['images'] if 'images' in message: data["images"] = message['images']
response = connection_handler.simple_post(f"{connection_handler.url}/api/generate", data=json.dumps(data)) 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 = 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) 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): def show_message(self, msg:str, bot:bool, footer:str=None, images:list=None, files:dict=None, id:str=None):