update:优化豆包流式ASR接口

This commit is contained in:
hrz
2025-06-04 16:43:15 +08:00
parent d06e297c2d
commit 03bcf5d2c7
7 changed files with 249 additions and 420 deletions
@@ -61,6 +61,7 @@ async def handleTextMessage(conn, message):
await send_tts_message(conn, "stop", None)
conn.client_is_speaking = False
elif is_wakeup_words:
conn.just_woken_up = True
# 上报纯文字数据(复用ASR上报功能,但不提供音频数据)
enqueue_asr_report(conn, "嘿,你好呀", [])
await startToChat(conn, "嘿,你好呀")
@@ -78,7 +79,9 @@ async def handleTextMessage(conn, message):
elif msg_json["type"] == "mcp":
conn.logger.bind(tag=TAG).info(f"收到mcp消息:{message}")
if "payload" in msg_json:
asyncio.create_task(handle_mcp_message(conn, conn.mcp_client, msg_json["payload"]))
asyncio.create_task(
handle_mcp_message(conn, conn.mcp_client, msg_json["payload"])
)
elif msg_json["type"] == "server":
# 记录日志时过滤敏感信息
conn.logger.bind(tag=TAG).info(