mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-23 03:19:41 +00:00
Merge pull request #3431 from xinnan-tech/py-content-text
Py content text
This commit is contained in:
commit
60c2a7ee17
1 changed files with 4 additions and 0 deletions
|
|
@ -61,6 +61,10 @@ async def startToChat(conn: "ConnectionHandler", text):
|
|||
actual_text = text
|
||||
else:
|
||||
actual_text = actual_content
|
||||
elif "content" in data:
|
||||
# FunASR 等返回 {"content","language","emotion"}:只把识别正文交给 LLM,
|
||||
# 否则整段 JSON 会进入对话历史
|
||||
actual_text = data["content"]
|
||||
except (json.JSONDecodeError, KeyError):
|
||||
# 如果解析失败,继续使用原始文本
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue