mirror of
https://gitee.com/qqtt-ah/ai-crm.git
synced 2026-11-23 23:09:20 +08:00
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
"""工具名 → 用户可见中文状态文案(不暴露内部 name)。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
_LABELS: dict[str, str] = {
|
|
"memory_search": "检索记忆",
|
|
"memory_load": "载入记忆",
|
|
"memory_save": "保存记忆",
|
|
"get_current_time": "确认业务日期",
|
|
"catalog_search": "查找店铺/商品",
|
|
"catalog_sku_detail": "查找内部规格",
|
|
"pdd_goods_search": "查找拼多多商品",
|
|
"pdd_goods_detail": "读取拼多多商品",
|
|
"ui_get_publish_snapshot": "读取发布表单",
|
|
"ui_patch_basic": "更新基础信息",
|
|
"ui_patch_skus": "更新价格库存",
|
|
"ui_patch_props": "更新类目属性",
|
|
"ui_set_spec_axes": "设置规格轴",
|
|
}
|
|
|
|
|
|
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("ui_"):
|
|
return "编辑发布表单"
|
|
if lower.startswith("catalog_") or lower.startswith("pdd_"):
|
|
return "查找商品信息"
|
|
if "order" in lower or "sales" in lower or "bi_" in lower or "stat" in lower:
|
|
return "查询经营数据"
|
|
return "处理中"
|