From 0711172fa7fb1ceabcc0bc8034d4740c385a76de Mon Sep 17 00:00:00 2001 From: lingyun14 Date: Thu, 21 May 2026 21:45:57 +0800 Subject: [PATCH] Fix/stale command hints (#8245) * Update stage.py * fix: remove stale slash command hints * fix: remove stale slash command hints * fix: remove stale slash command hints * Update openai_source.py --- astrbot/builtin_stars/astrbot/main.py | 2 +- astrbot/core/config/default.py | 2 +- astrbot/core/pipeline/result_decorate/stage.py | 2 +- astrbot/core/provider/sources/openai_source.py | 7 ++----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/astrbot/builtin_stars/astrbot/main.py b/astrbot/builtin_stars/astrbot/main.py index c1500a5d1..3d800edd2 100644 --- a/astrbot/builtin_stars/astrbot/main.py +++ b/astrbot/builtin_stars/astrbot/main.py @@ -176,7 +176,7 @@ class Main(star.Star): if not session_curr_cid: logger.error( - "当前未处于对话状态,无法主动回复,请确保 平台设置->会话隔离(unique_session) 未开启,并使用 /switch 序号 切换或者 /new 创建一个会话。", + "当前未处于对话状态,无法主动回复,请确保 平台设置->会话隔离(unique_session) 未开启,并使用 /new 创建一个会话。", ) return diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index ce79559bd..dec98692b 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -1068,7 +1068,7 @@ CONFIG_METADATA_2 = { "id_whitelist": { "type": "list", "items": {"type": "string"}, - "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可使用 /wl 添加白名单", + "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可在 WebUI 的平台设置中管理白名单", }, "id_whitelist_log": { "type": "bool", diff --git a/astrbot/core/pipeline/result_decorate/stage.py b/astrbot/core/pipeline/result_decorate/stage.py index 7e5d2287f..c2d799162 100644 --- a/astrbot/core/pipeline/result_decorate/stage.py +++ b/astrbot/core/pipeline/result_decorate/stage.py @@ -368,7 +368,7 @@ class ResultDecorateStage(Stage): return if time.time() - render_start > 3: logger.warning( - "文本转图片耗时超过了 3 秒,如果觉得很慢可以使用 /t2i 关闭文本转图片模式。", + "文本转图片耗时超过了 3 秒,如果觉得很慢可以在 WebUI 中关闭文本转图片模式。", ) if url: if url.startswith("http"): diff --git a/astrbot/core/provider/sources/openai_source.py b/astrbot/core/provider/sources/openai_source.py index fbcef1a80..cd0aabeef 100644 --- a/astrbot/core/provider/sources/openai_source.py +++ b/astrbot/core/provider/sources/openai_source.py @@ -1138,8 +1138,8 @@ class ProviderOpenAIOfficial(Provider): or ("function" in str(e).lower() and "support" in str(e).lower()) ): # openai, ollama, gemini openai, siliconcloud 的错误提示与 code 不统一,只能通过字符串匹配 - logger.info( - f"{self.get_model()} 不支持函数工具调用,已自动去除,不影响使用。", + logger.warning( + f"{self.get_model()} 不支持函数工具调用,已自动去除,不影响使用。如需永久关闭,可前往 WebUI 中关闭工具调用。", ) payloads.pop("tools", None) return ( @@ -1153,9 +1153,6 @@ class ProviderOpenAIOfficial(Provider): ) # logger.error(f"发生了错误。Provider 配置如下: {self.provider_config}") - if "tool" in str(e).lower() and "support" in str(e).lower(): - logger.error("疑似该模型不支持函数调用工具调用。请输入 /tool off_all") - if is_connection_error(e): proxy = self.provider_config.get("proxy", "") log_connection_failure("OpenAI", e, proxy)