From 9ec0b6977bf170bb47f10016e4deda5e3481a0b0 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Sat, 6 Sep 2025 16:40:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E5=A4=84=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=B1=BB=E5=9E=8B=E7=9A=84=20content=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 `process_human_text` 函数中,增加了对 `content` 参数的类型检查。如果 `content` 是一个列表,它会被自动转换成字符串,以防止后续处理中出现 `ValueError`。这增强了函数的健壮性,使其能够处理更多样化的输入格式。 --- src/plugin_system/apis/generator_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugin_system/apis/generator_api.py b/src/plugin_system/apis/generator_api.py index 7f3074a81..8d8d04eb3 100644 --- a/src/plugin_system/apis/generator_api.py +++ b/src/plugin_system/apis/generator_api.py @@ -239,6 +239,8 @@ def process_human_text( enable_splitter: 是否启用消息分割器 enable_chinese_typo: 是否启用错字生成器 """ + if isinstance(content, list): + content = "".join(map(str, content)) if not isinstance(content, str): raise ValueError("content 必须是字符串类型") try: