Commit Graph

2 Commits

Author SHA1 Message Date
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