mirror of https://github.com/Mai-with-u/MaiBot.git
将模块导入放到顶上
parent
cf999792be
commit
76a37452a0
|
|
@ -1,3 +1,4 @@
|
||||||
|
import re
|
||||||
import json
|
import json
|
||||||
from typing import Dict, Any, Optional
|
from typing import Dict, Any, Optional
|
||||||
from src.common.logger_manager import get_logger
|
from src.common.logger_manager import get_logger
|
||||||
|
|
@ -103,8 +104,6 @@ async def analyze_chat_for_nicknames(
|
||||||
# 清理可能的 Markdown 代码块标记
|
# 清理可能的 Markdown 代码块标记
|
||||||
response_content = response_content.strip()
|
response_content = response_content.strip()
|
||||||
# 使用正则表达式处理各种 Markdown 代码块情况
|
# 使用正则表达式处理各种 Markdown 代码块情况
|
||||||
import re
|
|
||||||
|
|
||||||
markdown_code_regex = re.compile(r"^```(?:\w+)?\s*\n(.*?)\n\s*```$", re.DOTALL)
|
markdown_code_regex = re.compile(r"^```(?:\w+)?\s*\n(.*?)\n\s*```$", re.DOTALL)
|
||||||
match = markdown_code_regex.match(response_content)
|
match = markdown_code_regex.match(response_content)
|
||||||
if match:
|
if match:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue