mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:19:19 +08:00
27 lines
817 B
Python
27 lines
817 B
Python
"""工具名 → 用户可见中文状态文案(不暴露内部 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 "查询经营数据"
|