diff --git a/lib/towerops/llm/network_insight_prompt.ex b/lib/towerops/llm/network_insight_prompt.ex index 68d8dce0..4f3d3736 100644 --- a/lib/towerops/llm/network_insight_prompt.ex +++ b/lib/towerops/llm/network_insight_prompt.ex @@ -53,7 +53,8 @@ defmodule Towerops.LLM.NetworkInsightPrompt do Respond ONLY with JSON of this shape: {"observations": [ {"title": "...", "description": "...", "urgency": "critical"|"warning"|"info", - "recommended_action": "..."} + "recommended_action": "...", + "device_id": "..." (optional — copy the exact device_id from the snapshot for any device you reference)} ]} Aim for 0–5 observations. Quality over quantity. diff --git a/lib/towerops/workers/ai_network_insight_worker.ex b/lib/towerops/workers/ai_network_insight_worker.ex index 16d213aa..66c35f3c 100644 --- a/lib/towerops/workers/ai_network_insight_worker.ex +++ b/lib/towerops/workers/ai_network_insight_worker.ex @@ -91,7 +91,8 @@ defmodule Towerops.Workers.AiNetworkInsightWorker do llm_summary: obs.description, llm_model: model, llm_enriched_at: now, - metadata: metadata + metadata: metadata, + device_id: Map.get(obs.metadata, "device_id") } case Insights.insert_insight_if_new(attrs) do