arittrabag commited on
Commit
a351d14
·
verified ·
1 Parent(s): 2fb7bf6

Update enhanced_prompt_builder.py

Browse files
Files changed (1) hide show
  1. enhanced_prompt_builder.py +34 -31
enhanced_prompt_builder.py CHANGED
@@ -73,38 +73,41 @@ class EnhancedPromptBuilder:
73
 
74
  weight_str = "\n".join(weight_notes) if weight_notes else ""
75
 
76
- prompt = f"""
77
- You are an expert ad copywriter with access to advanced AI assistance.
78
-
79
- TASK: Rewrite the following ad text in a {tone} tone and optimize it individually for: {platform_str}
80
-
81
- ORIGINAL AD TEXT: "{ad_text}"
82
-
83
- === ENHANCED GUIDANCE (with Relevance Scores) ===
84
- {formatted_guidance}
85
-
86
- === KNOWLEDGE GRAPH INSIGHTS ===
87
- {kg_insights_str}
88
 
89
- === ADAPTIVE LEARNING INSIGHTS ===
90
- {weight_str}
91
- {performance_str}
92
-
93
- === INSTRUCTIONS ===
94
- 1. Maintain the core message and key information from the original ad
95
- 2. Adapt the tone and style according to the guidelines above
96
- 3. Consider the compatibility scores and warnings for each platform
97
- 4. Use suggested elements where appropriate
98
- 5. Avoid any warned elements or approaches
99
- 6. Apply lessons from historical performance data
100
-
101
- OUTPUT FORMAT:
102
- Provide a separate, optimized version for each platform:
103
-
104
- {''.join([f'{p}:\n<Your rewritten ad text here>\n\n' for p in platforms])}
105
-
106
- Remember: Each platform version should be uniquely tailored while maintaining brand consistency.
107
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
  return prompt
110
 
 
73
 
74
  weight_str = "\n".join(weight_notes) if weight_notes else ""
75
 
76
+ # Construct dynamic section before final prompt
77
+ platform_outputs = "\n".join([f"{p}:\n<Your rewritten ad text here>\n" for p in platforms])
 
 
 
 
 
 
 
 
 
 
78
 
79
+ prompt = f"""
80
+ You are an expert ad copywriter with access to advanced AI assistance.
81
+
82
+ TASK: Rewrite the following ad text in a {tone} tone and optimize it individually for: {platform_str}
83
+
84
+ ORIGINAL AD TEXT: "{ad_text}"
85
+
86
+ === ENHANCED GUIDANCE (with Relevance Scores) ===
87
+ {formatted_guidance}
88
+
89
+ === KNOWLEDGE GRAPH INSIGHTS ===
90
+ {kg_insights_str}
91
+
92
+ === ADAPTIVE LEARNING INSIGHTS ===
93
+ {weight_str}
94
+ {performance_str}
95
+
96
+ === INSTRUCTIONS ===
97
+ 1. Maintain the core message and key information from the original ad
98
+ 2. Adapt the tone and style according to the guidelines above
99
+ 3. Consider the compatibility scores and warnings for each platform
100
+ 4. Use suggested elements where appropriate
101
+ 5. Avoid any warned elements or approaches
102
+ 6. Apply lessons from historical performance data
103
+
104
+ OUTPUT FORMAT:
105
+ Provide a separate, optimized version for each platform:
106
+
107
+ {platform_outputs}
108
+
109
+ Remember: Each platform version should be uniquely tailored while maintaining brand consistency.
110
+ """
111
 
112
  return prompt
113