Phase 4: Template system with auto-select and pre-fill

Backend:
- Add templates.json with 5 template definitions (news, policy, business, fiction, social)
- Add template API (/api/template/list, /api/template/auto-select, /api/template/:id/filter-rules)
- Register template blueprint in Flask app

Frontend:
- Add template API client (frontend/src/api/template.js)
- Add template selector UI in Home.vue (chip buttons + auto-select button)
- Add template state management and auto-select logic

Locale:
- Add template keys for th/en/zh

Entity filter rules in templates.json for context-aware filtering in Step 1.
This commit is contained in:
Kunthawat Greethong
2026-06-26 11:44:55 +07:00
parent 3c4c2183c7
commit 166ef73ad2
8 changed files with 434 additions and 1 deletions

View File

@@ -677,5 +677,16 @@
"llmSelectAgentFailed": "LLM agent selection failed, using default selection: {error}",
"generateInterviewQuestionsFailed": "Failed to generate interview questions: {error}",
"generateInterviewSummaryFailed": "Failed to generate interview summary: {error}"
},
"templates": {
"title": "Select simulation template",
"autoSelect": "Auto-select from data",
"custom": "Write your own",
"news_event": "News & Events",
"policy_regulation": "Policy & Regulations",
"business_ad": "Business & Advertising",
"fiction_story": "Fiction & Stories",
"social_culture": "Social & Culture",
"fillPrompt": "Edit prompt before running"
}
}

View File

@@ -677,5 +677,16 @@
"llmSelectAgentFailed": "LLM เลือก Agent ล้มเหลว ใช้การเลือกเริ่มต้น: {error}",
"generateInterviewQuestionsFailed": "สร้างคำถามสัมภาษณ์ล้มเหลว: {error}",
"generateInterviewSummaryFailed": "สร้างสรุปสัมภาษณ์ล้มเหลว: {error}"
},
"templates": {
"title": "เลือกรูปแบบการจำลอง",
"autoSelect": "แนะนำอัตโนมัติจากข้อมูล",
"custom": "เขียนเอง",
"news_event": "จำลองข่าวและเหตุการณ์",
"policy_regulation": "จำลองนโยบายและกฎระเบียบ",
"business_ad": "จำลองธุรกิจและโฆษณา",
"fiction_story": "จำลองนิยายและเรื่องเล่า",
"social_culture": "จำลองสังคมและวัฒนธรรม",
"fillPrompt": "แก้ไขคำสั่งก่อนรัน"
}
}

View File

@@ -677,5 +677,16 @@
"llmSelectAgentFailed": "LLM选择Agent失败使用默认选择: {error}",
"generateInterviewQuestionsFailed": "生成采访问题失败: {error}",
"generateInterviewSummaryFailed": "生成采访摘要失败: {error}"
},
"templates": {
"title": "选择模拟模板",
"autoSelect": "从数据自动推荐",
"custom": "自行编写",
"news_event": "新闻与事件",
"policy_regulation": "政策与法规",
"business_ad": "商业与广告",
"fiction_story": "小说与故事",
"social_culture": "社会与文化",
"fillPrompt": "运行前编辑指令"
}
}