worktree-citti-arkiver-tur #14
12
app.py
12
app.py
@@ -423,9 +423,12 @@ def match_offers_ai():
|
||||
|
||||
# Skip the (daily) match call when the offer set hasn't changed since the
|
||||
# last successful match — the avis only turns over weekly, so this avoids a
|
||||
# pointless Claude call most days.
|
||||
# pointless Claude call most days. The leading version forces a re-match
|
||||
# whenever the matching logic/prompt changes (bump it when editing them).
|
||||
MATCH_VERSION = "v2-standard-not-premium"
|
||||
sig = hashlib.md5(
|
||||
"\n".join(sorted(o['id'] + '|' + (o.get('heading') or '') for o in offers))
|
||||
(MATCH_VERSION + "\n" + "\n".join(
|
||||
sorted(o['id'] + '|' + (o.get('heading') or '') for o in offers)))
|
||||
.encode('utf-8')).hexdigest()
|
||||
with get_db() as c:
|
||||
if _meta_get(c, 'last_match_sig') == sig and \
|
||||
@@ -452,7 +455,10 @@ def match_offers_ai():
|
||||
"findes. Vær striks: match kun når det tydeligt er samme varetype "
|
||||
"(fx entrecôte↔entrecôte-tilbud). Match IKKE blot på mærke eller løst "
|
||||
"beslægtede varer (fx 'Nutella 1kg glas' må IKKE matche 'Nutella "
|
||||
"julekalender'). Vælg det billigste ved flere ens. Returnér KUN et "
|
||||
"julekalender'). Når varen er generisk (fx 'Entrecote ½ kg'), vælg den "
|
||||
"ALMINDELIGE/standard variant til den LAVESTE pris — undgå premium-/"
|
||||
"luksus-varianter (Wagyu, Dry-Aged, US-Beef, øko-premium) medmindre varen "
|
||||
"selv nævner det, da de giver et urealistisk højt estimat. Returnér KUN et "
|
||||
'JSON-array [{"item_key":"...","offer_id":"..."}] med de sikre match, '
|
||||
"intet andet.")
|
||||
client = anthropic.Anthropic(max_retries=CLAUDE_MAX_RETRIES)
|
||||
|
||||
Reference in New Issue
Block a user