From 570f10c245aa8c96a6e6de0c036b5a597f83cd24 Mon Sep 17 00:00:00 2001 From: tcmofashi Date: Fri, 11 Apr 2025 20:08:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=AD=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/utils/prompt_builder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/utils/prompt_builder.py b/src/plugins/utils/prompt_builder.py index ff5a3b352..f1c8bd8d9 100644 --- a/src/plugins/utils/prompt_builder.py +++ b/src/plugins/utils/prompt_builder.py @@ -116,16 +116,14 @@ class Prompt(str): template = template.format(**formatted_kwargs) return template except (IndexError, KeyError) as e: - raise ValueError( - f"格式化模板失败: {template}, args={formatted_args}, kwargs={formatted_kwargs} {str(e)} keys:{template_args}" - ) from e + raise ValueError(f"格式化模板失败: {template}, args={formatted_args}, kwargs={formatted_kwargs}") from e def format(self, *args, **kwargs) -> "Prompt": """支持位置参数和关键字参数的格式化,使用""" ret = type(self)( self.template, self.name, args=list(args) if args else self._args, **kwargs if kwargs else self._kwargs ) - print(f"prompt build result: {ret} name: {ret.name} ") + # print(f"prompt build result: {ret} name: {ret.name} ") return ret def __str__(self) -> str: