worktree-citti-arkiver-tur #2

Merged
hjess merged 2 commits from worktree-citti-arkiver-tur into main 2026-10-30 11:09:31 +01:00

2 Commits

Author SHA1 Message Date
Henrik Jess Nielsen
c0580fefbc chore(deploy): inject ANTHROPIC_API_KEY from Consul KV into citti job
Reads citti/anthropic_api_key via keyOrDefault so a missing key never
blocks deploy — set it in Consul (copy from blaaai/anthropic_api_key)
to enable Danish translation and AI offer matching.
2026-10-30 11:03:54 +01:00
Henrik Jess Nielsen
8dd435a7d0 feat(offers): Danish translation and AI matching via Claude
Offers come from the German avis, so add Claude-backed language help,
reusing BlaaAi's ANTHROPIC_API_KEY + Haiku pattern. Both degrade
gracefully: without a key, offers stay German and the token heuristic
still matches.

- Translate offer headings DE→DA in the fetch job, cached per heading
  in a translations table (only new headings cost a call). UI shows
  Danish primary + German subtitle for in-store navigation.
- AI match the fixed list against offers (offer_matches table): Claude
  returns same-product matches, far more precise than the token
  heuristic (which false-matched e.g. Nutella jar → advent calendar).
  load_deals() prefers AI matches, falls back to the heuristic.
- Haiku 5.5 by default (MATCH_MODEL/TRANSLATE_MODEL env overridable to
  Sonnet); no temperature param (Haiku 5.5 rejects non-default).
- requirements: add anthropic
2026-10-30 11:02:47 +01:00