mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 17:09:19 +08:00
feat: 工具调用改为独立 SSE 事件并以中文状态条展示
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""工具名 → 用户可见中文状态文案(不暴露内部 name)。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
_LABELS: dict[str, str] = {
|
||||
"memory_search": "检索记忆",
|
||||
"memory_load": "载入记忆",
|
||||
"memory_save": "保存记忆",
|
||||
"get_current_time": "确认业务日期",
|
||||
"catalog_search": "查找店铺/商品",
|
||||
}
|
||||
|
||||
|
||||
def tool_status_label(name: str) -> str:
|
||||
"""将工具名映射为前端状态条文案。"""
|
||||
key = (name or "").strip()
|
||||
if not key:
|
||||
return "处理中"
|
||||
if key in _LABELS:
|
||||
return _LABELS[key]
|
||||
lower = key.lower()
|
||||
if lower.startswith("catalog_"):
|
||||
return "查找店铺/商品"
|
||||
if "order" in lower or "sales" in lower or "bi_" in lower or "stat" in lower:
|
||||
return "查询经营数据"
|
||||
return "查询经营数据"
|
||||
Reference in New Issue
Block a user