mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 17:13:54 +08:00
增加系统提示词,支持dify使用function call
This commit is contained in:
@@ -193,7 +193,7 @@ def check_ffmpeg_installed():
|
||||
def extract_json_from_string(input_string):
|
||||
"""提取字符串中的 JSON 部分"""
|
||||
pattern = r"(\{.*\})"
|
||||
match = re.search(pattern, input_string)
|
||||
match = re.search(pattern, input_string, re.DOTALL) #添加 re.DOTALL
|
||||
if match:
|
||||
return match.group(1) # 返回提取的 JSON 字符串
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user