From a3a7490342ed90472ba0f75f8395f4878657d1d6 Mon Sep 17 00:00:00 2001 From: grafana-watcher Date: Tue, 21 Jul 2026 20:23:41 +0200 Subject: [PATCH] post: commit 3217f0b in bojemoi --- .../commits/2026-07-21-commit-3217f0b.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 content/posts/commits/2026-07-21-commit-3217f0b.md diff --git a/content/posts/commits/2026-07-21-commit-3217f0b.md b/content/posts/commits/2026-07-21-commit-3217f0b.md new file mode 100644 index 0000000..ffbb0ac --- /dev/null +++ b/content/posts/commits/2026-07-21-commit-3217f0b.md @@ -0,0 +1,56 @@ +--- +title: "[bojemoi] feat(alert-agent): intégration Claude API (Haiku) comme backend LLM principal" +date: 2026-07-21T20:23:41+02:00 +draft: false +tags: ["commit", "bojemoi", "main"] +categories: ["Git Activity"] +summary: "Commit 3217f0b par grafana-watcher dans bojemoi" +author: "grafana-watcher" +--- + +## Commit `3217f0b` + +| | | +|---|---| +| **Repository** | bojemoi | +| **Branch** | `main` | +| **Author** | grafana-watcher | +| **Hash** | `3217f0b22abb1c42444282a068e544257b0dc725` | + + +### Description + +Remplace Ollama (trop lent) par Claude API (Anthropic). Le backend est +sélectionnable via LLM_BACKEND: claude/kimi/ollama. Le LLM évalue +désormais la sévérité réelle de l'alerte (critical/high/medium/low/info) +indépendamment du label Prometheus. + +- llm.py: ajout _call_claude + _extract_json pour parser la réponse +- config.py: claude_api_key (secret), claude_model, llm_backend=claude +- requirements.txt: anthropic>=0.40 +- alerter.py: emoji selon sévérité LLM (🔴🟠🟡🔵⚪) +- webhook.py: sévérité Telegram = decision["severity"] (LLM) > label Prometheus +- stack: LLM_BACKEND=claude, secret claude_api_key monté + +Co-Authored-By: Claude Sonnet 4.6 + +### Files Changed + +``` +M alert-agent/alert_agent/__main__.py +M alert-agent/alert_agent/config.py +M alert-agent/alert_agent/llm.py +M alert-agent/requirements.txt +M stack/48-service-alert-agent.yml +``` + +### Diff Summary + +``` + alert-agent/alert_agent/__main__.py | 2 +- + alert-agent/alert_agent/config.py | 11 +++++++-- + alert-agent/alert_agent/llm.py | 48 +++++++++++++++++++++++++++++++++---- + alert-agent/requirements.txt | 1 + + stack/48-service-alert-agent.yml | 6 ++++- + 5 files changed, 59 insertions(+), 9 deletions(-) +```