Remove basic creative analysis from run.py: use analyze_creatives.py exclusively
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b315c51c16
commit
f319c609fd
19
run.py
19
run.py
@ -8,7 +8,7 @@ from datetime import datetime
|
||||
|
||||
import config
|
||||
from meta_ads_client import MetaAdsClient
|
||||
from agent import decide, analyze_creative, analyze_unit
|
||||
from agent import decide, analyze_unit
|
||||
from baserow_client import BaserowClient
|
||||
import slack_notifier
|
||||
|
||||
@ -354,23 +354,6 @@ def run():
|
||||
verticals[vertical]["leads"] += metrics["leads"]
|
||||
verticals[vertical]["margin"] += margin
|
||||
|
||||
# ── Creative visual analysis (Baserow storage) ─────────────────────
|
||||
try:
|
||||
for ad in meta.get_ads_with_creatives(cid):
|
||||
if not ad["thumbnail_url"]:
|
||||
continue
|
||||
result = analyze_creative(ad["thumbnail_url"], ad["ad_name"])
|
||||
baserow.save_creative_analysis({
|
||||
"ad_id": ad["ad_id"],
|
||||
"ad_name": ad["ad_name"],
|
||||
"campaign_id": cid,
|
||||
"image_url": ad["thumbnail_url"],
|
||||
"analysis": result.get("analysis", ""),
|
||||
"score": result.get("score", 0),
|
||||
"recommendations": result.get("recommendations", ""),
|
||||
})
|
||||
except Exception as e:
|
||||
errors.append(f"Creatives {metrics['name']}: {e}")
|
||||
|
||||
# ── Top 10 best and worst ─────────────────────────────────────────────────
|
||||
with_leads = [m for m in metrics_all.values() if m["leads"] > 0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user