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
66fa2d2677
feat(ai-service): implement confidence calculation for T3.3 [AC-AISVC-17, AC-AISVC-18, AC-AISVC-19]
...
- Add ConfidenceCalculator class for confidence scoring
- Implement retrieval insufficiency detection (hit count, score threshold, evidence tokens)
- Implement confidence calculation based on retrieval scores
- Implement shouldTransfer logic with configurable threshold
- Add transferReason for low confidence scenarios
- Add comprehensive unit tests (19 test cases)
- Update config with confidence-related settings
2026-02-24 13:31:42 +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
550d0d8498
feat(ai-service): implement context merging for T3.2 [AC-AISVC-14, AC-AISVC-15]
...
- Add ContextMerger class for combining local and external history
- Implement message fingerprint computation (SHA256 hash)
- Implement deduplication: local history takes priority
- Implement token-based truncation using tiktoken
- Add comprehensive unit tests (20 test cases)
2026-02-24 13:26:37 +08:00
MerCry
4cee28e9f4
docs: mark Phase 1 and Phase 2 tasks as completed [AC-AISVC-01~AC-AISVC-20]
2026-02-24 13:22:56 +08:00
MerCry
92cef20a86
test(ai-service): add Retrieval layer unit tests [AC-AISVC-10, AC-AISVC-16, AC-AISVC-17]
2026-02-24 13:22:04 +08:00
MerCry
e99d324398
docs: add ai-service progress tracking [AC-AISVC-06]
2026-02-24 13:20:11 +08:00
MerCry
0a167d69f0
feat(ai-service): implement LLM Adapter for T3.1 [AC-AISVC-02, AC-AISVC-06]
...
- Add LLMClient abstract base class with generate/stream_generate interfaces
- Implement OpenAIClient with httpx for OpenAI-compatible API calls
- Add retry logic with tenacity for timeout handling
- Support both non-streaming and streaming generation
- Add comprehensive unit tests for LLM Adapter
- Fix entities.py JSON column type for SQLModel compatibility
2026-02-24 13:19:38 +08:00
MerCry
cc70ffeca6
docs: confirm open questions and update design [AC-AISVC-01]
2026-02-24 13:00:08 +08:00
MerCry
1b73706574
docs: add ai-service design [AC-AISVC-01]
2026-02-24 12:54:59 +08:00
MerCry
2fdc91a54c
docs: add ai-service provider openapi [AC-AISVC-01]
2026-02-24 12:43:57 +08:00
MerCry
78fec1fc8e
docs: add ai-service requirements [AC-AISVC-01]
2026-02-24 12:35:28 +08:00
MerCry
2594652cc3
初始化初始文档
2026-02-24 12:08:24 +08:00
MerCry
988cc229a6
Initial commit
2026-02-24 04:05:29 +00:00