Spaces:
Sleeping
Sleeping
Update enhanced_prompt_builder.py
Browse files- 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 |
-
|
77 |
-
|
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 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
{
|
105 |
-
|
106 |
-
|
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 |
|