mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 17:43:55 +08:00
fix:function call bug (#268)
* 优化function call消息处理 * fix:用户说话重复记录bug * 2025-3-10-优化llm intent (#254) Co-authored-by: 欣南科技 <huangrongzhuang@xin-nan.com> * update:回复上版提示词,无需再二次识别歌曲名 --------- Co-authored-by: 玄凤科技 <eric230308@gmail.com> Co-authored-by: hrz <1710360675@qq.com> Co-authored-by: Jiao Haoyang <108573524+XuSenfeng@users.noreply.github.com>
This commit is contained in:
co-authored by
玄凤科技
hrz
Jiao Haoyang
parent
4f3fae81c1
commit
2b662d3a14
@@ -4,6 +4,7 @@ import yaml
|
||||
import socket
|
||||
import subprocess
|
||||
import logging
|
||||
import re
|
||||
|
||||
|
||||
def get_project_dir():
|
||||
@@ -119,3 +120,11 @@ def check_ffmpeg_installed():
|
||||
error_msg += "1、按照项目的安装文档,正确进入conda环境\n"
|
||||
error_msg += "2、查阅安装文档,如何在conda环境中安装ffmpeg\n"
|
||||
raise ValueError(error_msg)
|
||||
|
||||
def extract_json_from_string(input_string):
|
||||
"""提取字符串中的 JSON 部分"""
|
||||
pattern = r'(\{.*\})'
|
||||
match = re.search(pattern, input_string)
|
||||
if match:
|
||||
return match.group(1) # 返回提取的 JSON 字符串
|
||||
return None
|
||||
Reference in New Issue
Block a user