Data Generator

👤 huaibuer 📦 v2.2.0 ⭐ 4.4 ⬇️ 800 下載
🤖 AI-Agent 免費

📖 技能介紹


name: data-generator description: 訓練資料生成技能。根據傳入的工具名和使用者指令列表,生成多輪對話格式的 JSONL 訓練資料。觸發場景:(1) 傳入工具名和使用者指令列表,生成完整訓練資料;(2) 批次生成指定工具的標註資料;(3) 給定指令列表,輸出 JSONL 對話樣本。


Data Generator

將使用者指令列表轉換為標準 JSONL 訓練資料。

輸入

兩個必填引數:

引數 型別 說明
tool_name string 工具名,如 dev_controlscene_generatorweather
user_instructions string[] 使用者指令列表,如 ["5分鐘後開啟空調", "3分鐘後關燈"]

輸出 JSONL 格式

{"conversations":[
  {"from":"human","value":"<當前使用者指令>開啟客廳空調</當前使用者指令>\n<本地裝置>格力冷靜王(空調)</本地裝置>\n<當前時間>2026-03-15 14:22:47</當前時間>\n<使用者場景列表>[{\"scene_id\":1001,\"scene_name\":\"回家模式\",\"room_name\":\"全屋\"},{\"scene_id\":1002,\"scene_name\":\"睡眠模式\",\"room_name\":\"主臥\"}]</使用者場景列表>\n<使用者裝置列表>{\"客廳\":[\"格力冷靜王(空調)\",\"洗碗機A1(洗碗機)\"],\"主臥\":[\"美的舒省風(空調)\"]}</使用者裝置列表>"},
  {"from":"assistant","value":"<tool_call>{\"tool_name\":\"dev_control\",\"query\":\"開啟客廳空調\"}</tool_call>"},
  {"from":"observation","value":"<tool_response>客廳空調已開啟</tool_response>"},
  {"from":"assistant","value":"好的,客廳空調已經開啟啦~"}
],"system":"","history":[]}

格式規則

  1. human value = 完整上下文,格式固定: <當前使用者指令>使用者原始指令</當前使用者指令> <本地裝置>裝置名(型別)</本地裝置> <當前時間>YYYY-MM-DD HH:mm:ss</當前時間> <使用者場景列表>[{"scene_id":xxx,"scene_name":"場景名","room_name":"房間名"},...]</使用者場景列表> <使用者裝置列表>{"房間":["裝置名(型別)",...]}</使用者裝置列表>
  2. assistant tool_call = 直接輸出 tool_call 標籤,無墊音字首
  3. observation = <tool_response>...</tool_response><tool_call>{...}</tool_call>(dev_info/weather 等工具)
  4. assistant 終接回復 = 直接回復內容,無墊音字首
  5. system = ""history = []

工作流

1. 接收 tool_name + user_instructions[]
         ↓
2. 載入提示詞:通用要求 + 工具特定要求(references/tools/{tool}.txt)
         ↓
3. 將 user_instructions 注入提示詞
         ↓
4. 生成 JSONL(每條獨立)
         ↓
5. 輸出 .jsonl 檔案

提示詞拼接

拼接規則:

[通用要求]
# ═══════════════════════════════════════════════════════════════════
# 【工具特定要求】
# 本次只調用:{TOOL_NAME}
# ────────────────────────────────────────────────────────────────
[references/tools/{TOOL_NAME}.txt 內容]

拼接指令碼:scripts/build_prompt.py

工具與檔案對照

工具 要求檔案
dev_control references/tools/dev_control.txt
scene_generator references/tools/scene_generator.txt
alarm_remind references/tools/alarm_remind.txt
weather references/tools/weather.txt
scene_control references/tools/scene_control.txt
dev_info references/tools/dev_info.txt
exit_dialog references/tools/exit_dialog.txt
GreeQA references/tools/GreeQA.txt
scene_guide references/tools/scene_guide.txt
chat references/tools/chat.txt

使用示例

輸入:

tool_name: "dev_info"
user_instructions: ["家裡空調數量", "有幾個空調"]

輸出欄位說明:

欄位 說明
conversations[0].value <當前使用者指令> + 完整上下文
conversations[1].value <tool_call>{"tool_name":"dev_info"}</tool_call>
conversations[2].value dev_info 返回結果(裝置列表)
conversations[3].value 文字終接回復
system 空字串 ""
history 空陣列 []

BUG 修復資料

當傳入 tool_name 為修復後的正確工具時,生成的資料應體現: - 工具呼叫格式正確(符合工具要求檔案) - query 欄位格式正確(如延時類指令含 timing 欄位) - 文字回覆符合預期(含延時時間描述)

具體格式參考:references/tools/scene_generator.txt

推薦訪問7w4.net獲取更多AI技能。

🤖 AI 評測

這個 Skill 用於自動生成智慧家居對話的訓練資料,質量中等偏上。優點是支援的工具型別多、格式規範明確、使用文件詳細。缺點是部分複雜規則的實現可能與預期不符,生成的資料樣式較為固定,不夠靈活多樣。如果需要批次生成標註資料,可以用它作為基礎,但建議配合人工稽核確保資料質量。

📊 多維度評分

適應性4.7
規範性4.3
有效性4.2
可靠性4.1
可信度5

📁 包含檔案 (14 個)

📄 SKILL.md 4.7 KB
📄 _meta.json 133 B
📄 references/tools/GreeQA.txt 2.7 KB
📄 references/tools/alarm_remind.txt 814 B
📄 references/tools/chat.txt 313 B
📄 references/tools/dev_control.txt 1.6 KB
📄 references/tools/dev_info.txt 129 B
📄 references/tools/exit_dialog.txt 231 B
📄 references/tools/scene_control.txt 190 B
📄 references/tools/scene_generator.txt 1.8 KB
📄 references/tools/scene_guide.txt 147 B
📄 references/tools/weather.txt 206 B
📄 scripts/build_prompt.py 5.4 KB
📄 scripts/gen_data.py 10.4 KB