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

This commit is contained in:
github-actions[bot]
2025-04-14 15:05:01 +00:00
parent 7c2b17816a
commit 9d2a774cb8
3 changed files with 7 additions and 10 deletions

View File

@@ -13,9 +13,7 @@ class SendEmojiTool(BaseTool):
description = "当你觉得需要表达情感,或者帮助表达,可以使用这个工具发送表情包"
parameters = {
"type": "object",
"properties": {
"text": {"type": "string", "description": "要发送的表情包描述"}
},
"properties": {"text": {"type": "string", "description": "要发送的表情包描述"}},
"required": ["text"],
}
@@ -25,4 +23,3 @@ class SendEmojiTool(BaseTool):
"name": "send_emoji",
"content": text,
}

View File

@@ -325,10 +325,10 @@ def random_remove_punctuation(text: str) -> str:
def process_llm_response(text: str) -> List[str]:
# 提取被 () 或 [] 包裹的内容
pattern = re.compile(r'[\(\[].*?[\)\]]')
pattern = re.compile(r"[\(\[].*?[\)\]]")
_extracted_contents = pattern.findall(text)
# 去除 () 和 [] 及其包裹的内容
cleaned_text = pattern.sub('', text)
cleaned_text = pattern.sub("", text)
logger.debug(f"{text}去除括号处理后的文本: {cleaned_text}")
# 对清理后的文本进行进一步处理