MerCry
d4b0bc3101
docs: 更新 Phase 13 话术流程引擎进度文档 [AC-AISVC-71~AC-AISVC-77]
2026-02-27 17:59:23 +08:00
MerCry
fba9b9313c
docs: update ai-service-admin progress for Phase 8-12 [AC-ASA-23~AC-ASA-44]
2026-02-27 17:58:49 +08:00
MerCry
f80f8f72bf
docs: update tasks and progress for Phase 14 output guardrail [AC-AISVC-78~AC-AISVC-85]
2026-02-27 17:53:17 +08:00
MerCry
8c259cee30
feat: implement output guardrail with forbidden word detection and behavior rules [AC-AISVC-78~AC-AISVC-85]
2026-02-27 16:40:02 +08:00
MerCry
9d8ecf0bb2
feat: 实现话术流程引擎 (Phase 13 T13.1-T13.6) [AC-AISVC-71~AC-AISVC-76]
...
- 新增 ScriptFlow 和 FlowInstance SQLModel 实体
- 实现 ScriptFlowService:流程定义 CRUD、步骤校验
- 实现 FlowEngine 状态机引擎:check_active_flow、start、advance、handle_timeout
- 实现话术流程管理 API(POST/GET/PUT /admin/script-flows)
- T13.7(单元测试)留待集成阶段
2026-02-27 15:27:02 +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
MerCry
eb93636227
feat: 实现 Prompt 模板化功能 (Phase 10 T10.1-T10.8) [AC-AISVC-51~AC-AISVC-58]
...
- 新增 PromptTemplate 和 PromptTemplateVersion SQLModel 实体
- 实现 PromptTemplateService:模板 CRUD、版本管理、发布/回滚、缓存
- 实现 VariableResolver:内置变量注入和自定义变量替换
- 实现 Prompt 模板管理 API(CRUD + 发布/回滚)
- T10.9(修改 Orchestrator)和 T10.10(单元测试)留待集成阶段
2026-02-27 14:15:10 +08:00
MerCry
717d5328cf
docs: 更新 progress 文档,记录 Phase 9 完成状态 [AC-AISVC-10]
2026-02-25 23:44:28 +08:00
MerCry
4579159c0a
feat(ui): 前端浅色调风格优化与下拉框显示修复
...
- 建立全局浅色调样式系统,统一配色风格
- 优化导航栏设计,添加品牌标识
- 修复下拉框被遮挡问题,添加 teleported 和 popper 配置
- 优化 LLM 选择器中当前配置标签的显示
- 重构控制台页面,采用白色卡片风格
- 统一所有页面的视觉风格,提升用户体验
2026-02-25 14:06:37 +08:00
MerCry
935dcd1611
feat(ASA-P5,P6): 实现嵌入管理与LLM配置API服务层 [AC-ASA-08~AC-ASA-15]
2026-02-25 01:34:20 +08:00
MerCry
fc53fdc6ac
feat(AISVC-T8): LLM配置管理与RAG调试输出支持 [AC-AISVC-42, AC-AISVC-43, AC-AISVC-44, AC-AISVC-45, AC-AISVC-46, AC-AISVC-47, AC-AISVC-48, AC-AISVC-49, AC-AISVC-50]
...
- 新增 LLMProviderFactory 工厂类支持 OpenAI/Ollama/Azure [AC-AISVC-42]
- 新增 LLMConfigManager 支持配置热更新 [AC-AISVC-43, AC-AISVC-44]
- 新增 LLM 管理 API 端点 [AC-AISVC-42~AC-AISVC-46]
- 更新 RAG 实验接口支持 AI 回复生成 [AC-AISVC-47, AC-AISVC-49]
- 新增 RAG 实验流式输出 SSE [AC-AISVC-48]
- 支持指定 LLM 提供者 [AC-AISVC-50]
- 更新 OpenAPI 契约添加 LLM 管理接口
- 更新前后端规范文档 v0.4.0 迭代
2026-02-25 01:25:53 +08:00
MerCry
193178f28d
docs: update ai-service-admin progress with backend implementation [AC-ASA-01, AC-ASA-02, AC-ASA-05, AC-ASA-07, AC-ASA-08, AC-ASA-09]
2026-02-24 16:11:23 +08:00
MerCry
1230b4005a
feat(asa): implement ai-service-admin infrastructure and modules [AC-ASA-01]
2026-02-24 14:54:14 +08:00
MerCry
43ce9837a1
feat(ai-service): add contract validation tests for T3.5 [AC-AISVC-02]
...
- Verify ChatResponse fields match OpenAPI contract
- Test required fields: reply, confidence, shouldTransfer
- Test optional fields: transferReason, metadata
- Test JSON serialization uses camelCase (by_alias=True)
- Test confidence range validation [0.0, 1.0]
- Test ChatRequest contract compliance
- Test ErrorResponse contract compliance
- Test SSEFinalEvent matches ChatResponse structure
- Test SSEErrorEvent matches ErrorResponse structure
- Add end-to-end contract validation with OrchestratorService
- All 184 tests passing
2026-02-24 13:55:17 +08:00
MerCry
6d54030e0d
feat(ai-service): implement complete Orchestrator generation pipeline for T3.4 [AC-AISVC-01, AC-AISVC-02]
...
- Integrate Memory, ContextMerger, Retriever, LLMClient, ConfidenceCalculator
- Implement 8-step generation pipeline:
1. Load local history from Memory
2. Merge with external history (dedup + truncate)
3. RAG retrieval (optional)
4. Build prompt with context and evidence
5. LLM generation
6. Calculate confidence
7. Save messages to Memory
8. Return ChatResponse
- Add GenerationContext dataclass for tracking intermediate results
- Implement fallback response mechanism for error handling
- Add 21 unit tests for OrchestratorService
- All 138 tests passing
2026-02-24 13:47:12 +08:00
MerCry
00953196c9
feat(ai-service): implement SSE state machine and error handling [AC-AISVC-08, AC-AISVC-09]
...
- Integrate state machine in API layer for proper event sequencing
- Ensure message* -> final/error -> close sequence
- Prevent events after final/error
- Convert streaming exceptions to error events
- Add comprehensive state machine tests
- 117 tests passing
2026-02-24 13:32:59 +08:00
MerCry
c9f2c1eb3a
feat(ai-service): implement SSE event generator for message events [AC-AISVC-07]
...
- Optimize Orchestrator streaming output with LLM client integration
- Implement _stream_from_llm() to wrap LLM chunks as message events
- Implement _stream_mock_response() for demo/testing
- Add SSE event format tests (message/final/error)
- Fix by_alias=True for final event JSON output
- 79 tests passing
2026-02-24 13:28:10 +08:00
MerCry
2594652cc3
初始化初始文档
2026-02-24 12:08:24 +08:00