🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user