mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01: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
|
actual_text = text
|
||||||
else:
|
else:
|
||||||
actual_text = actual_content
|
actual_text = actual_content
|
||||||
|
elif "content" in data:
|
||||||
|
# FunASR 等返回 {"content","language","emotion"}:只把识别正文交给 LLM,
|
||||||
|
# 否则整段 JSON 会进入对话历史
|
||||||
|
actual_text = data["content"]
|
||||||
except (json.JSONDecodeError, KeyError):
|
except (json.JSONDecodeError, KeyError):
|
||||||
# 如果解析失败,继续使用原始文本
|
# 如果解析失败,继续使用原始文本
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue