diff --git a/skills/export-user-data/SKILL.md b/skills/export-user-data/SKILL.md index fc811b2..95b0e28 100644 --- a/skills/export-user-data/SKILL.md +++ b/skills/export-user-data/SKILL.md @@ -161,6 +161,42 @@ cd /root/.openclaw/workspace-xiaoban --- +## 快速查组件类型 + +如果只知道 `c_id` 不知道 `c_type`,先查 MySQL: + +```bash +cd /root/.openclaw/workspace-xiaoban +source scripts/export_component_records.sh --help # 仅加载环境变量 +python3 -c " +import pymysql, os +conn = pymysql.connect( + host=os.getenv('MYSQL_HOST'), user=os.getenv('MYSQL_USERNAME'), + password=os.getenv('MYSQL_PASSWORD'), database='vala_test', + port=int(os.getenv('MYSQL_PORT',3306)), charset='utf8mb4') +for t in ['middle_interaction_component','core_interaction_component']: + cur = conn.cursor() + cur.execute(f'SELECT c_id,c_type,title FROM {t} WHERE c_id=%s', ('',)) + for r in cur.fetchall(): + print(f'{t}: c_id={r[0]} c_type={r[1]} title={r[2]}') + cur.close() +conn.close() +" +``` + +## 实际用例 + +### 导出"看图说话"组件 1000516 的所有学习记录 + +```bash +cd /root/.openclaw/workspace-xiaoban +./scripts/export_component_records.sh --c-type core_speaking_image --c-id 1000516 +``` + +输出:`output/组件_口语图片_1000516_导出时间_YYYYMMDD.xlsx` + +包含字段:user_id、session_id、play_result(判定结果)、音频URL、朗读内容(ASR文本识别)、发音评分、user_behavior_info(完整行为数据)等,按 updated_at 倒序排列。 + ## 完成后 如果是从飞书对话触发的导出,导出完成后通过 `lark-send-message-as-bot` 技能将文件发送给请求用户。