fix: replace raise with warning in nemotron/hermes + fix hardcoded host in footprint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ogt
2026-04-27 19:46:04 +08:00
parent ac56139e74
commit b4d208d34a
2 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
Hermes 3 競價情報分析服務 (Module 2)
角色:分析師 (Analyst)
模型qwen2.5:7b-instruct @ 192.168.0.188:11434
模型qwen2.5:7b-instruct @ 192.168.0.111:11434
輸入SQL 漏斗篩選後的候選商品(~300筆
輸出Top N 威脅清單(結構化 JSON→ 交給 NemoTron dispatcher

View File

@@ -284,7 +284,7 @@ def _build_footprint_json(hermes_stats: Optional[dict], nim_stats: Optional[dict
if hermes_stats:
result["analyst"] = {
"model": "qwen2.5:7b-instruct",
"host": "192.168.0.188",
"host": os.getenv("HERMES_URL", "http://192.168.0.111:11434"),
"duration_sec": hermes_stats.get("duration_sec", 0),
"tokens": hermes_stats.get("tokens", 0),
"cost_usd": 0,
@@ -363,7 +363,8 @@ class NemotronDispatcher:
nim_stats: {"total_tokens": int, "quota_used": int}
"""
if not NIM_API_KEY:
raise RuntimeError("NVIDIA_API_KEY 未設定")
logger.warning("[NemotronDispatcher] NVIDIA_API_KEY 未設定,跳過 NIM 呼叫")
return [], {}
threat_summary = json.dumps(
[