feat(temi_mcp): 添加跳舞工具并修复卡片消息发送

为轮足机器人添加跳舞功能,包含新的 MCP 工具和服务器方法。同时修复 Lark MCP 中发送卡片消息时 person_id 处理的问题,避免在 person_id 为 None 时产生异常。更新两个包的版本号以反映变更。
This commit is contained in:
2026-04-03 15:55:23 +08:00
parent 894ee1dfbf
commit 3b881bf8c8
5 changed files with 30 additions and 7 deletions

View File

@@ -145,7 +145,16 @@ async def serve() -> None:
},
"required": []
}
)
),
Tool(
name="dance",
description="轮足机器人跳舞",
inputSchema={
"type": "object",
"properties": {},
"required": []
}
),
]
@server.call_tool()
@@ -186,6 +195,8 @@ async def serve() -> None:
)
elif name == "repose":
result = await nav_server.repose()
elif name == "dance":
result = await nav_server.dance()
elif name == "patrol":
locations = arguments.get("locations", [])
flag = arguments.get("flag", True if not locations else False)

View File

@@ -117,9 +117,19 @@ class NavServer:
except Exception as e:
logger.error(f"Failed to call repose mcp-tool: {str(e)} ", exc_info=True)
return f"Failed to call repose mcp-tool: {str(e)}"
async def dance(self):
"""轮足机器人跳舞"""
try:
params = {}
return await self.pub_cmd("temi-test", "dance", params)
except Exception as e:
logger.error(f"Failed to call dance mcp-tool: {str(e)} ", exc_info=True)
return f"Failed to call dance mcp-tool: {str(e)}"
async def patrol(self, locations: list = None, flag: bool = False):
"""轮足机器人巡逻 why !!! """
"""轮足机器人巡逻 """
try:
params = {
"flag": True,

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "lzwcai_temi_mcp"
version = "0.1.9"
version = "0.1.12"
description = "MQTT-based navigation server for robot"
requires-python = ">=3.10"
dependencies = [