From 95586e20adee8099e16cf654b3fa3aeebc766f51 Mon Sep 17 00:00:00 2001 From: fatwang2 Date: Sun, 21 Jan 2024 23:40:10 +0800 Subject: [PATCH] 0.6.8 --- readme.md | 1 + sum4all.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 84dd45c..770d8d9 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,7 @@ [telegram频道 ](https://sum4all.site/telegram) ## 更新日志 +- V0.6.8,20230121,增加对不支持文件类型忽略的逻辑;更换底层搜索、内容获取服务,更快更稳定;更新配置文件里的搜索默认prompt - V0.6.7,20230109,增加讯飞代理,简化讯飞部分代码与依赖 - V0.6.6,20230106,增加Gemini代理,解决非美国IP无法访问Gemini的问题 - V0.6.5,20231217,结构化配置文件config.json,支持更灵活的调整文件、图片、URL、搜索的配置,升级后需按照新格式配置 diff --git a/sum4all.py b/sum4all.py index 39f4026..64823cc 100644 --- a/sum4all.py +++ b/sum4all.py @@ -36,7 +36,7 @@ name="sum4all", desire_priority=2, desc="A plugin for summarizing all things", - version="0.6.7", + version="0.6.8", author="fatwang2", ) @@ -175,9 +175,12 @@ def on_handle_context(self, e_context: EventContext): # 更新params_cache中的last_file_content self.params_cache[user_id] = {} file_content = self.extract_content(file_path) - self.params_cache[user_id]['last_file_content'] = file_content - logger.info('Updated last_file_content in params_cache for user.') - self.handle_file(file_content, e_context) + if file_content is None: + logger.info("文件内容无法提取,跳过处理") + else: + self.params_cache[user_id]['last_file_content'] = file_content + logger.info('Updated last_file_content in params_cache for user.') + self.handle_file(file_content, e_context) else: logger.info("文件总结功能已禁用,不对文件内容进行处理") # 删除文件