Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2244,34 +2244,60 @@ def handle_prompt(prompt):
|
|
| 2244 |
|
| 2245 |
|
| 2246 |
# Check if user request includes blog, article, or newsletter
|
| 2247 |
-
if any(keyword in prompt.lower() for keyword in ["blog",
|
| 2248 |
appended_instructions = (
|
| 2249 |
-
|
| 2250 |
-
|
| 2251 |
-
|
| 2252 |
-
|
| 2253 |
-
|
| 2254 |
-
|
| 2255 |
-
|
| 2256 |
-
|
| 2257 |
-
|
| 2258 |
-
|
| 2259 |
-
|
| 2260 |
-
|
| 2261 |
-
|
| 2262 |
-
|
| 2263 |
-
" -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
|
| 2264 |
-
" -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
|
| 2265 |
-
"The final output must not include AI jargons. *With every paragraph give active language creative headline bold that summarises the content give bold *sub-headlines* with each paragraphs like example headline: Drive,empower use similar words but no driving, empowering etc *. Avoid mentioning trustbucket names."
|
| 2266 |
-
"MOST IMPORTANT RULE. IN EVERY PARAGRAPH Strengthen the connections between sections to ensure smoother flow and SHOULD BE DEEPLY INTERCONNECTED WITH EACH OTHER TO CREATE A SEAMLESS FLOW, MAKING THE CONTENT READ LIKE A SINGLE CONTENT RATHER THAN DISJOINTED PARAGRAPHS OR INDEPENDENT BLOG SECTIONS. EACH SECTION MUST LOGICALLY TRANSITION INTO THE NEXT, ENSURING THAT THE TOPIC REMAINS CONSISTENT AND RELEVANT THROUGHOUT. BY MAINTAINING A COHESIVE STRUCTURE, THE ARTICLE WILL ENGAGE READERS MORE EFFECTIVELY, HOLDING THEIR ATTENTION AND CONVEYING THE INTENDED MESSAGE WITH CLARITY AND IMPACT."
|
| 2267 |
-
)
|
| 2268 |
-
|
| 2269 |
-
|
| 2270 |
-
|
| 2271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2272 |
|
|
|
|
|
|
|
| 2273 |
|
| 2274 |
-
|
| 2275 |
final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
|
| 2276 |
|
| 2277 |
try:
|
|
|
|
| 2244 |
|
| 2245 |
|
| 2246 |
# Check if user request includes blog, article, or newsletter
|
| 2247 |
+
if any(keyword in prompt.lower() for keyword in ["blog","write", "article","report","annual report" "newsletter","news letter","website introduction"]):
|
| 2248 |
appended_instructions = (
|
| 2249 |
+
"Craft a flawless, engaging, and fluid compelling copy using *non-flowery language* that reads as though written by a professional copywriter with 25 years of experience. "
|
| 2250 |
+
"Avoid AI jargon, vague phrases, or overly formal language. Do not explicitly mention trust bucket names in headings or content. Instead, use the following enhanced guidelines for a polished, publication-ready copy that scores 10/10 in quality:\n\n"
|
| 2251 |
+
|
| 2252 |
+
"1. **Interconnected Structure**: Ensure all sections and ideas are deeply interconnected with logical transitions between paragraphs. Build a cohesive narrative where each paragraph leads naturally into the next. Use linking phrases to reinforce connections (e.g., 'Building on this success...' or 'This aligns with our broader mission...'). Avoid isolated or disjointed sections.\n\n"
|
| 2253 |
+
|
| 2254 |
+
"2. **Tailored Formatting for Blogs and Newsletters**:\n"
|
| 2255 |
+
"- **For Blogs**: Use detailed, narrative-style paragraphs to explore topics in depth. Each section must have a creative subheading summarizing the content.\n"
|
| 2256 |
+
"- **For Newsletters**: Focus on concise summaries with bullet points and clear headings. Ensure the content is visually digestible and quick to read.\n\n"
|
| 2257 |
+
|
| 2258 |
+
"3. **Seamless Integration of TrustBuilders®**: Naturally weave TrustBuilders® into the narrative without isolating them. Highlight their relevance subtly to build credibility and trust while maintaining readability and engagement.\n\n"
|
| 2259 |
+
|
| 2260 |
+
"4. **Relatable and Conversational Tone**: Engage the audience with a human, approachable tone. Avoid repetitive phrasing, overly technical explanations, or mechanical structures. Use active voice consistently for a professional yet friendly style.\n\n"
|
| 2261 |
+
|
| 2262 |
+
"5. **Audience-Centric Engagement**: Tailor the content to resonate with the audience’s needs, challenges, and aspirations. Use relatable examples, vivid imagery, and direct appeals to create emotional connections. Highlight actionable insights and practical relevance.\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2263 |
|
| 2264 |
+
"6. **Purpose-Driven Impact**: Clearly define and achieve the content's purpose—whether to inform, persuade, or inspire action. Ensure each paragraph contributes to the overall objective and reinforces the key message.\n\n"
|
| 2265 |
+
|
| 2266 |
+
"7. **Content Elements for Newsletters**:\n"
|
| 2267 |
+
"- Use bullet points for key highlights or statistics to improve readability.\n"
|
| 2268 |
+
"- Summarize sections into digestible pieces that are easy to scan.\n"
|
| 2269 |
+
"- Add clear calls-to-action (e.g., 'Join us,' 'Learn more,' 'Donate now') at the end of relevant sections.\n\n"
|
| 2270 |
+
|
| 2271 |
+
"8. **Polished Presentation**: Refine the output to ensure it is professional, cohesive, and suitable for publication. Avoid ambiguity or errors. Structure the content to highlight key points effectively and keep the reader engaged.\n\n"
|
| 2272 |
+
|
| 2273 |
+
"9. **Mandatory Sections for Blogs and Newsletters**:\n"
|
| 2274 |
+
"1. ##List of TrustBuilders Used: Provide TrustBuilders used followed by *Source links always.*\n"
|
| 2275 |
+
"2. ##Heuristics and Creative Techniques:\n"
|
| 2276 |
+
" - List them in a footnote-style small heading.\n"
|
| 2277 |
+
" - Use the following structure:\n"
|
| 2278 |
+
" - Heuristics: Mention names only (e.g., social proof, authority, commitment).\n"
|
| 2279 |
+
" - Creative Techniques: Mention names only (list only relevant marketing techniques without additional details).\n\n"
|
| 2280 |
+
|
| 2281 |
+
"10. **Flow and Consistency**:\n"
|
| 2282 |
+
"- Strengthen connections between paragraphs to create a seamless flow.\n"
|
| 2283 |
+
"- Ensure newsletters are concise, with key points prominently displayed, and blogs maintain a deeper narrative structure with smooth transitions.\n\n"
|
| 2284 |
+
|
| 2285 |
+
"11. **Creative Subheadings**:\n"
|
| 2286 |
+
"- Each section must have a subheading that captures the essence of the content below.\n"
|
| 2287 |
+
"- For example, instead of 'Empowering Communities,' use action-driven headlines like 'Driving Sustainable Change Globally.'\n"
|
| 2288 |
+
"- Avoid generic titles or -ing endings.\n\n"
|
| 2289 |
+
|
| 2290 |
+
"12. **Key Reminder**:\n"
|
| 2291 |
+
"Ensure the final output:\n"
|
| 2292 |
+
"- Is deeply interconnected, with transitions between sections creating a cohesive narrative.\n"
|
| 2293 |
+
"- Maintains a balance between detail and brevity to suit both blogs and newsletters.\n"
|
| 2294 |
+
"- Includes action-oriented subheadings and avoids disjointed or isolated content blocks.\n"
|
| 2295 |
+
)
|
| 2296 |
|
| 2297 |
+
else:
|
| 2298 |
+
|
| 2299 |
|
| 2300 |
+
appended_instructions = ""
|
| 2301 |
final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
|
| 2302 |
|
| 2303 |
try:
|