iomgaa
|
c1680447c0
|
feat(adapters): EmbeddingProvider Protocol + local/remote 双后端实现
- app/ports.py: 添加 EmbeddingProvider Protocol(runtime_checkable,dim 属性 + embed 方法)
- adapters/embedding.py: 从参考代码迁移,拆分为 LocalEmbeddingProvider 和 RemoteEmbeddingProvider
- Local: sentence-transformers 冻结推理,维度校验
- Remote: OpenAI 兼容 API,L2 归一化,按 index 排序
- 两者均提供 embed() 和 embed_tensor() 统一接口
- tests/unit/test_embedding_adapter.py: Protocol 满足性、形状校验、导入测试
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-07 01:45:09 -04:00 |
|
iomgaa
|
c2ba3ed591
|
chore: lint 修复(TC001/TC003 类型导入优化)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 23:15:06 -04:00 |
|
iomgaa
|
ee90fb8e88
|
fix(adapters): 修复 GovernedLLMClient 流式消费和规格偏差
- _stream_request + _consume_stream 合并为 _call_streaming,
在 async with self._http.stream() 内直接消费流,
确保看门狗作用于真实 HTTP 流而非内存列表(Critical 1)
- breaker 检查移到 call_id 生成之前(Critical 2)
- cache/ttft_timeout_s/inter_token_timeout_s 支持 None(Important 1)
- 重试失败路径遥测使用统一 call_id(Important 2)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 23:08:52 -04:00 |
|
iomgaa
|
cfd3277f80
|
style: format adapters/llm.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 23:01:06 -04:00 |
|
iomgaa
|
f1a0414be8
|
feat(adapters): 实现 GovernedLLMClient 四层治理栈
流式 SSE + 三层看门狗 + 重试退避 + 熔断 + Redis 缓存 + 遥测。
provider 差异处理(DeepSeek reasoning_content vs Qwen think 标签)。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 23:00:22 -04:00 |
|
iomgaa
|
c2ff2855b7
|
feat(adapters): 实现三层流式看门狗
TTFT / inter_token / total 超时保护。
参考 CHSAnalyzer2 streaming.py。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 22:43:01 -04:00 |
|
iomgaa
|
82f065e4ef
|
feat(adapters): 实现 SQLiteTelemetryRecorder
asyncio.to_thread 桥接 SQLite,字段与 TelemetryRecorder Protocol 一一对应。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 22:40:15 -04:00 |
|
iomgaa
|
14bb60e918
|
feat(adapters): 实现 CircuitBreaker 内存级熔断器
注入 now 纯确定性,force_open 支持 401/403 直接熔断。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 22:39:57 -04:00 |
|
iomgaa
|
9dae7dda98
|
feat(adapters): 实现 RedisResponseCache
content-addressed sha256 缓存键,Redis 不可用时静默降级。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 22:39:42 -04:00 |
|
iomgaa
|
e60823de1a
|
build: add README, pyproject.toml, package skeletons and smoke test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-07-06 11:37:59 -04:00 |
|