Commit Graph

4 Commits

Author SHA1 Message Date
MerCry d3ae92dec5 feat: add metadata validation in KB upload and unify metadata storage [AC-IDSMETA-15, AC-IDSMETA-16] 2026-03-02 22:15:19 +08:00
MerCry 6b21ba8351 feat(v0.7.0): 验收通过 - Dashboard统计增强、流程测试、对话追踪
验收通过的标准:
- AC-ASA-59~64: 前端话术流程和护栏监控功能验收
- AC-AISVC-91~95: Dashboard统计增强和完整流程测试验收
- AC-AISVC-108~110: 对话追踪和导出功能验收

修复问题:
- flow_test.py: 修复OrchestratorService导入和调用
- 前后端字段不一致: orderstep_no, wait_for_inputwait_input
- 数据库迁移: 添加chat_messages缺失的监控字段

新增文件:
- ai-service/app/api/admin/flow_test.py
- ai-service/scripts/migrations/add_chat_message_fields.py
- ai-service-admin/src/views/admin/prompt-template/components/VariableManager.vue
2026-02-28 12:52:50 +08:00
MerCry 3cf7d02daf feat(v0.7.0): implement intent rule testing and prompt template monitoring
Backend APIs:
- [AC-AISVC-96] POST /admin/intent-rules/{ruleId}/test - Intent rule testing with conflict detection
- [AC-AISVC-97] GET /admin/monitoring/intent-rules - Intent rule statistics
- [AC-AISVC-98] GET /admin/monitoring/intent-rules/{ruleId}/hits - Intent rule hit records
- [AC-AISVC-99] POST /admin/prompt-templates/{tplId}/preview - Prompt template preview with token count
- [AC-AISVC-100] GET /admin/monitoring/prompt-templates - Prompt template usage statistics

Frontend Components:
- [AC-ASA-53] IntentRuleTestDialog - Test dialog for intent rules
- [AC-ASA-54/55] IntentRules monitoring page with hit records drawer
- [AC-ASA-56/57] PromptTemplatePreviewDialog with variable editing
- [AC-ASA-58] PromptTemplates monitoring page with scene breakdown

New files:
- ai-service/app/services/intent/tester.py
- ai-service/app/services/monitoring/intent_monitor.py
- ai-service/app/services/monitoring/prompt_monitor.py
- ai-service/app/api/admin/monitoring.py
- ai-service-admin/src/views/admin/intent-rule/components/TestDialog.vue
- ai-service-admin/src/views/admin/monitoring/IntentRules.vue
- ai-service-admin/src/views/admin/monitoring/PromptTemplates.vue
- ai-service-admin/src/views/admin/prompt-template/components/PreviewDialog.vue
2026-02-27 23:15:46 +08:00
MerCry ff35538a01 feat(ai-service): implement intent recognition and rule engine (Phase 12 T12.1-T12.5)
[AC-AISVC-65~AC-AISVC-70] Intent recognition with keyword and regex matching

- Add IntentRule SQLModel entity with tenant isolation
- Implement IntentRuleService for CRUD operations with hit statistics
- Implement IntentRouter matching engine (priority DESC, keyword then regex)
- Add rule caching by tenant_id with TTL=60s and CRUD invalidation
- Add intent rules management API (POST/GET/PUT/DELETE /admin/intent-rules)
- Support four response types: fixed/rag/flow/transfer

T12.6 (Orchestrator integration) and T12.7 (unit tests) pending for integration phase
2026-02-27 14:20:31 +08:00