budget prompt simplified
Browse files- app/ads1/budget_optimizer.py +5 -37
app/ads1/budget_optimizer.py
CHANGED
|
@@ -40,43 +40,11 @@ def build_budget_optimizer_prompt(context: dict) -> str:
|
|
| 40 |
payload = json.dumps(context, indent=2, default=str)
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
-
return
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
Campaign scope: {name}
|
| 49 |
-
|
| 50 |
-
You must analyze the data and decide:
|
| 51 |
-
|
| 52 |
-
- Where money is being wasted
|
| 53 |
-
- Which campaigns deserve MORE budget
|
| 54 |
-
- Which campaigns should be reduced or paused
|
| 55 |
-
- Any inefficient spend patterns
|
| 56 |
-
- Any hidden high-efficiency opportunities
|
| 57 |
-
|
| 58 |
-
IMPORTANT:
|
| 59 |
-
- Do NOT rely on hard thresholds
|
| 60 |
-
- Do NOT assume rules like "CPA > X = bad"
|
| 61 |
-
- Think in relative performance vs distribution
|
| 62 |
-
- Focus on efficiency vs cost imbalance
|
| 63 |
-
|
| 64 |
-
OUTPUT FORMAT:
|
| 65 |
-
Return 3 to 5 bullet points.
|
| 66 |
-
|
| 67 |
-
Each bullet must:
|
| 68 |
-
- start with "- "
|
| 69 |
-
- include a clear recommendation
|
| 70 |
-
- include reasoning based on metrics
|
| 71 |
-
|
| 72 |
-
Example style:
|
| 73 |
-
- "Shift budget from X to Y because..."
|
| 74 |
-
- "Reduce spend on Z due to..."
|
| 75 |
-
- "Increase allocation to A since..."
|
| 76 |
-
|
| 77 |
-
DATA:
|
| 78 |
-
{payload}
|
| 79 |
-
"""
|
| 80 |
|
| 81 |
def run_budget_optimizer(dfs: dict, campaign_name: str | None = None) -> str:
|
| 82 |
print("\n🚀 [budget_optimizer] STARTED", flush=True)
|
|
|
|
| 40 |
payload = json.dumps(context, indent=2, default=str)
|
| 41 |
name = context.get("campaign_name", "this account")
|
| 42 |
|
| 43 |
+
return (
|
| 44 |
+
f"Write 3 to 5 bullet points of actionable Google Ads budget allocation insights for {name}.\n"
|
| 45 |
+
"Use simple language. One insight per bullet. Start each line with '- '. No intro sentence.\n\n"
|
| 46 |
+
f"Data (JSON):\n{payload}"
|
| 47 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
def run_budget_optimizer(dfs: dict, campaign_name: str | None = None) -> str:
|
| 50 |
print("\n🚀 [budget_optimizer] STARTED", flush=True)
|