PA网络健康仪表盘。使用场景:检查网络中所有PA是否在线,查看账单状态,验证日历连接,或生成...
PA 状态 : 最低模式 : 任意模式是一项面向实际任务的技能,主要用于状态检查都是由数据驱动和基于规则的;当运行时 : 每日9:00: 完整网络报告给管理者;
该技能适合需要稳定复用相关能力的场景,可作为自动化工作流的一部分,也便于后续检查、调整和扩展。从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
任意模型。状态检查为数据驱动、基于规则的判断。
对 data/pa-directory.json 中的每个 PA,检查以下字段:
| 检查项 | 对应字段 | 健康状态 |
|---|---|---|
| 最后活跃时间 | last_seen |
距今 24 小时以内 |
| 账单状态 | billing_error |
false |
| 日历连接状态 | calendar_connected |
true |
| 运行状态 | status |
"active" |
#!/usr/bin/env python3
import json
import datetime
# 加载 PA 目录
try:
with open('data/pa-directory.json') as f:
d = json.load(f)
except FileNotFoundError:
print("ERROR: data/pa-directory.json not found")
exit(1)
today = datetime.date.today().isoformat()
online = []
issues = []
offline = []
for pa in d.get('pas', []):
name = pa['name']
owner = pa['owner']
status = pa.get('status', 'unknown')
model = pa.get('model', 'unknown')
# 格式化日历与账单状态标识符
calendar = "✅" if pa.get('calendar_connected') else "❌"
billing_ok = not pa.get('billing_error', False)
billing = "✅" if billing_ok else "⚠️ billing error"
# 将每个 PA 归类至 online / issues / offline
if status == 'active' and billing_ok:
online.append(f"• {name} ({owner}) — {model}, cal {calendar}")
elif status == 'inactive':
offline.append(f"• {name} ({owner})")
else:
issues.append(f"• {name} ({owner}) — {billing}")
# 打印报告
total = len(d.get('pas', []))
print(f"📊 PA Network Status — {today}\n")
print(f"✅ ONLINE ({len(online)}/{total})")
for line in online:
print(line)
if issues:
print("\n⚠️ ISSUES")
for line in issues:
print(line)
if offline:
print("\n❌ OFFLINE")
for line in offline:
print(line)
if not issues and not offline:
print("\nAll PAs are healthy 🎉")
在 pa-directory.json 的每个 PA 条目中添加以下字段:
{
"name": "Aria",
"phone": "+1XXXXXXXXXX",
"owner": "Owner Name",
"owner_email": "owner@company.com",
"status": "active",
"model": "your-llm-model",
"last_seen": "2026-04-01T10:00:00Z",
"calendar_connected": true,
"billing_error": false,
"billing_error_since": null
}
请将 "your-llm-model" 替换为实际模型 ID(例如:"claude-haiku-20240307"、"gpt-4o-mini"、"gemini-1.5-flash")。
用于实时验证(在运行上述脚本之后):
对 issues 列表中的每个 PA: 发送消息:"ping 🏓" 最多等待 5 分钟 若收到响应:标记为 ONLINE 若无响应:标记为 NO_RESPONSE → 检查 whatsapp-diagnostics 和 billing-monitor 技能
规则:仅对已标记异常的 PA 执行 Ping;切勿对健康状态的 PA 执行 Ping —— 否则会产生干扰噪声。
| 频率 | 操作 |
|---|---|
| 每日 09:00 | 向管理员发送全网状态报告 |
| 发生账单错误时 | 立即发送部分报告 |
| 按需触发 | 当管理员询问 "what's the status?" |
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.3万人学习
共49课时 | 82.7万人学习
最新文章