Files
countbot-ai__countbot/backend/modules/tools/xiaozhi_message.py
T
w 08e66ccc02 发布(0.7.0): 修复问题并增强技能与工具体验
1. 解决多个 issue 反馈问题,修复已知 Bug
2. 优化前端界面与交互体验
3. 优化 tool 调用链路,较此前版本节省约 70% token 用量
4. 增加模型思考控制开关,提升整体响应体感
5. 新增 find-skills,全面接入腾讯云 SkillsHub,支持通过对话进行 skills 管理
6. 新增 ima-knowledge-base、ima-notes,全面接入 IMA 知识库和笔记,支持知识库与笔记内容管理和写入
7. 优化 README,并补充 0.7.0 发布说明
8. 发布说明:https://654321.ai/docs/releases/v0.7.0
2026-03-29 22:37:11 +08:00

44 lines
1.2 KiB
Python

"""小智AI send_message 工具
仅在小智频道启用且 enable_conversation=True 时注册。
小智AI通过此工具将用户语音转发给 Agent 处理。
"""
from typing import Any, Dict
from backend.modules.tools.base import Tool
class XiaozhiMessageTool(Tool):
"""小智AI消息工具 - 接收用户语音消息并转发给 Agent 处理"""
@property
def name(self) -> str:
return "send_message"
@property
def description(self) -> str:
return "Forward the raw user message to the agent immediately."
@property
def parameters(self) -> Dict[str, Any]:
return {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Raw user message."
},
"message": {
"type": "string",
"description": "Alias of `text`."
}
},
"required": ["text"],
"additionalProperties": False
}
async def execute(self, message: str = "", **kwargs) -> Any:
# 实际响应由 XiaozhiChannel._handle_tool_call 通过 Future 机制处理
return {"status": "received", "user_message": message}