🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-06-21 04:35:56 +00:00
parent 0b0d8689eb
commit fd09550af9
4 changed files with 29 additions and 36 deletions

View File

@@ -154,10 +154,10 @@ class Prompt(str):
"""处理模板中的转义花括号,将 \{\} 替换为临时标记"""
# 如果传入的是列表,将其转换为字符串
if isinstance(template, list):
template = '\n'.join(str(item) for item in template)
template = "\n".join(str(item) for item in template)
elif not isinstance(template, str):
template = str(template)
return template.replace("\\{", Prompt._TEMP_LEFT_BRACE).replace("\\}", Prompt._TEMP_RIGHT_BRACE)
@staticmethod