Files
ewoooc/requirements.txt
OoO 943de8466c
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
feat(p7): Anthropic SDK + Claude Opus 4.7 接 Code Review (feature flag OFF)
Operation Ollama-First v5.0 / Phase 7 Frontier 升級

services/anthropic_service.py (新檔, 226 行)
- AnthropicService 包裝 + ClaudeResponse dataclass
- Ephemeral prompt cache 5 分鐘 TTL(重複 system_prompt 省 90% 成本)
- usage 解析 input/output/cache_creation/cache_read 四欄位
- ANTHROPIC_API_KEY 未設或 SDK 缺失時 is_available()=False 靜默退化

code_review_pipeline_service.py — _openclaw_assess 加 L1 Claude 分支
- CODE_REVIEW_USE_CLAUDE flag (預設 OFF,等 ANTHROPIC_API_KEY 設定後翻 ON)
- 路由:Claude Opus 4.7 (Arena code Elo 1548) → Gemini → ElephantAlpha 三層
- request_id 串鏈不變

ai_call_logger.py COST_TABLE 補 3 個 Claude 模型:
- claude-opus-4-7:    $15/$75 per M tokens (程式碼 #1)
- claude-sonnet-4-6:  $3/$15  per M tokens (agentic 平衡)
- claude-haiku-4-5:   $0.8/$4 per M tokens (輕量快速)

requirements.txt: 加 anthropic>=0.40.0
.env.example: 加 ANTHROPIC_API_KEY / CODE_REVIEW_USE_CLAUDE / CLAUDE_MODEL

52 unit tests 全綠(22 logger + 18 anthropic + 5 routing + 7 security)

啟用步驟(待統帥手動):
  1. .env 加 ANTHROPIC_API_KEY=sk-ant-...
  2. CODE_REVIEW_USE_CLAUDE=true + restart momo-app
  3. 觀察 ai_calls.cache_read_tokens > 0 確認 cache 生效

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 23:31:30 +08:00

31 lines
858 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Flask>=2.3
Flask-WTF
gunicorn>=20.1
pandas>=1.5
pytz
openpyxl
SQLAlchemy>=1.4
psycopg2-binary>=2.9
schedule
pyngrok
selenium
requests
numpy
python-dotenv
google-auth
google-auth-oauthlib
google-auth-httplib2
google-api-python-client
google-generativeai
anthropic>=0.40.0 # Phase 7 Frontier 升級Claude Opus 4.7 Code Reviewfeature flag CODE_REVIEW_USE_CLAUDE 預設 OFF
feedparser
beautifulsoup4
lxml
prometheus-client
python-telegram-bot[job-queue]>=20.0
pgvector>=0.2
paramiko # ADR-013: AIOps SSH 跳板修復
python-pptx # ADR-014: PPT 簡報系統
matplotlib # 圖表生成(日報/週報/月報)
matplotlib-inline # Jupyter 相容層(可選)
psutil>=5.9 # ADR-019 Phase 2: ElephantAlpha system load 真實量測production 必裝;缺失時 fallback 為 queue-based 估算)