Commit Graph

2 Commits

Author SHA1 Message Date
OG T
e26ea526b1 fix(api): lint errors in Rate Limiter + RAG services
- Remove unused imports (settings, uuid)
- Add 'from e' to exception raises (B904)
- Add strict=True to zip() (B905)
- Remove unused variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 16:03:16 +08:00
OG T
bf32c4b1f2 feat(api): Phase 13.2 AI Rate Limiter + RAG 基礎設施 (#84)
Rate Limiter (防止 Gemini 用量暴衝):
- ai_rate_limiter.py: RPM/Daily/Token 三層閥值
- openclaw.py: 整合 rate limit 檢查,超限自動降級
- health.py: /health/ai-usage 監控端點

RAG Tool 基礎 (#84 進行中):
- embedding_service.py: Ollama embedding 封裝
- rag_service.py: Redis vector search 服務

閥值設定:
- Gemini: 10 RPM, 500/day, 100K tokens/day
- Claude: 5 RPM, 200/day, 50K tokens/day

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 15:52:57 +08:00