mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 09:03:54 +08:00
update:加入测试速度功能
This commit is contained in:
@@ -12,6 +12,9 @@ async def handleTextMessage(conn, message):
|
||||
logger.info(f"收到文本消息:{message}")
|
||||
try:
|
||||
msg_json = json.loads(message)
|
||||
if isinstance(msg_json, int):
|
||||
await conn.websocket.send(message)
|
||||
return
|
||||
if msg_json["type"] == "hello":
|
||||
await handleHelloMessage(conn)
|
||||
elif msg_json["type"] == "abort":
|
||||
@@ -33,4 +36,4 @@ async def handleTextMessage(conn, message):
|
||||
if "text" in msg_json:
|
||||
await startToChat(conn, msg_json["text"])
|
||||
except json.JSONDecodeError:
|
||||
await conn.websocket.send(message)
|
||||
await conn.websocket.send(message)
|
||||
|
||||
Reference in New Issue
Block a user