mirror of
https://github.com/countbot-ai/CountBot.git
synced 2026-09-14 20:46:47 +08:00
08e66ccc02
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
44 lines
1.2 KiB
Python
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}
|