Wajahat698 commited on
Commit
e6b9d26
·
verified ·
1 Parent(s): 3815086

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -36
app.py CHANGED
@@ -2198,30 +2198,52 @@ def handle_prompt(prompt):
2198
  add_dot_typing_animation()
2199
  display_typing_indicator()
2200
  cleaned_text = ""
2201
- base_instructions = """
2202
 
2203
- Avoid Flowery language and ai words.Always include alof of data of numbers,names,dollars, programs ,awards and action when finding trustbuilders from internet.*
2204
 
2205
- 1. **Adhere to Uploaded Document's Style**:
2206
- - When asked uploaded files or document means knowledgebase.
2207
- - Use the uploaded document as a primary guide for writing style, tone, and structure. Just directly give response.
2208
- - Match formatting such as headings, subheadings, and paragraph styles. If the uploaded document lacks headings, Strictly do not include them in the response.
2209
 
2210
- 2. **Prioritize Knowledge Base and Internet Sources**:
2211
- - Use uploaded documents or knowledge base files as the primary source.
2212
- - Perform a Google search to retrieve valid and correct internet links for references, ensuring only accurate and verified source links are used.
2213
 
2214
- 3. **Avoid Flowery Language and AI Jargon**:
2215
- - Use clear, professional language without exaggerated or vague expressions. Avoid jargon like "beacon," "realm," "exemplifies," etc.
2216
 
2217
- 4. **Ensure Accuracy**:
2218
- - Provide only verifiable and accurate information. Do not include placeholders, fabricated URLs, or vague references.
2219
 
2220
- - Give output in proper formatting.
2221
- - Response in same language in which asked.
2222
- -Use google to provide accurate sources links containing the trustbuilder text information.
2223
 
2224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2225
  """
2226
 
2227
 
@@ -2230,26 +2252,26 @@ def handle_prompt(prompt):
2230
  # Check if user request includes blog, article, or newsletter
2231
  if any(keyword in prompt.lower() for keyword in ["blog", "write","article","annual report","report", "newsletter","news letter ","website introduction"]):
2232
  appended_instructions = (
2233
- "Craft a flawless, engaging, and fluid compelling copy using *non-flowery language* that reads as though written in active language by a professional copywriter having 25 years of experience. "
2234
- "Keep Proper format when asked for article,blog,annual report,report, newsletter. Keep format of actual marketing copy search for format if not sure."
2235
- "Do not use AI jargon ,ai words, vague phrases, or formal language.Donot mention trustbucket names in the headings and content. Follow these enhanced guidelines to ensure a polished, publication-ready copy with a 10/10 quality: "
2236
- "1. **Interconnected Structure**: Ensure all sections and ideas flow seamlessly with logical transitions between paragraphs. Build a cohesive narrative where every part supports the overall theme, reinforcing the message at every step. "
2237
- "3. **Seamless Integration of TrustBuilders®**: Naturally incorporate TrustBuilders® into the narrative without isolating or explicitly listing them in the main body. Instead, weave them fluidly into sentences to build credibility and trust while maintaining the content’s readability and engagement. "
2238
- "4. **Human Tone**: Write in a relatable, conversational tone that engages the reader and feels natural. Avoid repetitive phrasing, overly technical explanations, or mechanical structures. Use active voice consistently, ensuring the tone is both approachable and professional."
2239
- "5. **Audience-Centric Engagement**: Tailor the content to meet the audience's needs, goals, and challenges. Create emotional connections by using relatable examples, vivid imagery, and direct appeals. Emphasize actionable insights and practical relevance to ensure the audience feels seen and understood."
2240
- "6. **Enhanced Audience Engagement**: Use storytelling techniques and mix the trustbuilders into a content. Begin with a compelling hook, maintain momentum through transitions, and conclude with a strong call-to-action that inspires the reader to act or reflect. "
2241
- "7. **Purpose-Driven Impact**: Clearly define and achieve the content’s purpose—whether to inform, persuade, or inspire action. Ensure every paragraph serves the overall objective while reinforcing the key message. "
2242
- "8. **Polished Presentation**: Ensure the final output is refined, professional, and suitable for publication. The copy should demonstrate mastery of language and content design, leaving no room for ambiguity or errors. "
2243
- "dont give source link in content"
2244
- "1. ##List of TrustBuilders Used: Provide trustbuilders used followed by *Source links always*"
2245
- " 2. ##Heuristics and Creative Techniques :"
2246
- " -List them in a footnote-style small heading."
2247
- " Use the following structure:"
2248
- " -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
2249
- " -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
2250
- "The final output must not include AI jargons. *With every paragraph give a creative headline that summarises the content give sub-headlines with each paragraph like example headline: Drive,empower use similar words but no driving, empowering etc *. Avoid mentioning trustbucket names."
2251
- "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."
2252
- )
2253
  else:
2254
  appended_instructions = ""
2255
  final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
 
2198
  add_dot_typing_animation()
2199
  display_typing_indicator()
2200
  cleaned_text = ""
2201
+ # base_instructions = """
2202
 
2203
+ # Avoid Flowery language and ai words.Always include alof of data of numbers,names,dollars, programs ,awards and action when finding trustbuilders from internet.*
2204
 
2205
+ # 1. **Adhere to Uploaded Document's Style**:
2206
+ # - When asked uploaded files or document means knowledgebase.
2207
+ # - Use the uploaded document as a primary guide for writing style, tone, and structure. Just directly give response.
2208
+ # - Match formatting such as headings, subheadings, and paragraph styles. If the uploaded document lacks headings, Strictly do not include them in the response.
2209
 
2210
+ # 2. **Prioritize Knowledge Base and Internet Sources**:
2211
+ # - Use uploaded documents or knowledge base files as the primary source.
2212
+ # - Perform a Google search to retrieve valid and correct internet links for references, ensuring only accurate and verified source links are used.
2213
 
2214
+ # 3. **Avoid Flowery Language and AI Jargon**:
2215
+ # - Use clear, professional language without exaggerated or vague expressions. Avoid jargon like "beacon," "realm," "exemplifies," etc.
2216
 
2217
+ # 4. **Ensure Accuracy**:
2218
+ # - Provide only verifiable and accurate information. Do not include placeholders, fabricated URLs, or vague references.
2219
 
2220
+ # - Give output in proper formatting.
2221
+ # - Response in same language in which asked.
2222
+ # -Use google to provide accurate sources links containing the trustbuilder text information.
2223
 
2224
 
2225
+ # """
2226
+ base_instructions = """
2227
+
2228
+ **General Guidelines**:
2229
+ - Use **clear, professional language** without exaggerated expressions or AI jargon (e.g., "beacon," "realm," "exemplifies").
2230
+ - Always include specific **numbers, names, dollar amounts, programs, awards, and actions** when identifying TrustBuilders®.
2231
+ - Prioritize **accuracy and verification**. Use the uploaded document or knowledge base as the primary source and validate references via Google search. Avoid placeholders or vague sources.
2232
+
2233
+ **Adhere to Uploaded Document's Style**:
2234
+ 1. Use the document's tone, structure, and formatting as a guide.
2235
+ 2. Match headings, subheadings, and paragraph styles exactly.
2236
+ 3. If no headings exist in the document, do not include them in the response.
2237
+
2238
+ **Formatting and Accuracy**:
2239
+ - Ensure responses are properly formatted and free of errors.
2240
+ - Respond in the same language as the query.
2241
+ - Provide **accurate source links** for all TrustBuilders® mentioned.
2242
+
2243
+ **Avoid**:
2244
+ - Flowery language or AI-specific phrases.
2245
+ - Isolated facts—always create logical connections between ideas.
2246
+
2247
  """
2248
 
2249
 
 
2252
  # Check if user request includes blog, article, or newsletter
2253
  if any(keyword in prompt.lower() for keyword in ["blog", "write","article","annual report","report", "newsletter","news letter ","website introduction"]):
2254
  appended_instructions = (
2255
+ "Craft a **flawless, engaging, and compelling copy** using *clear, non-flowery language*. Ensure the tone reflects the style of a seasoned professional copywriter."
2256
+ "Maintain **proper formatting** for the specific content type (e.g., blog, article, annual report, newsletter). If unsure, research appropriate formats."
2257
+ "Avoid **AI jargon**, vague phrases, or overly formal language. Do not mention TrustBucket names in headings or content."
2258
+
2259
+ "**Guidelines for High-Quality Copy**:"
2260
+ "1. **Interconnected Structure**: Ensure sections flow logically, with seamless transitions between ideas. Build a cohesive narrative where each part reinforces the main theme."
2261
+ "2. **Seamless TrustBuilder® Integration**: Weave TrustBuilders® naturally into sentences without explicitly listing them in the body. Highlight credibility and trust without disrupting readability."
2262
+ "3. **Relatable Human Tone**: Write in a conversational, engaging tone. Use active voice and avoid repetitive or overly technical phrasing."
2263
+ "4. **Audience-Centric Content**: Tailor the content to meet the reader's needs. Use examples, emotional appeals, and actionable insights to create connections."
2264
+ "5. **Storytelling and Engagement**: Use hooks, smooth transitions, and strong conclusions to maintain reader interest. Conclude with a clear, action-oriented CTA."
2265
+ "6. **Polished Presentation**: Proofread carefully for consistency, clarity, and impact. The final output must be **publication-ready** with no ambiguity or errors."
2266
+
2267
+ "**Critical Rules**:"
2268
+ "1. Avoid including source links in the content body unless explicitly requested."
2269
+ "2. **List of TrustBuilders® Used**: Provide them with *embedded source links* at the end."
2270
+ "3. **Heuristics and Creative Techniques**: Include them in a footnote-style format at the end:"
2271
+ " - **Heuristics**: List names only (e.g., social proof, authority, commitment)."
2272
+ " - **Creative Techniques**: List names only (e.g., storytelling, emotional appeal)."
2273
+
2274
+ "**Key Focus:** Ensure each paragraph connects logically to the next, creating a **unified, seamless flow**. The content should read as a single, cohesive piece rather than independent sections."
2275
  else:
2276
  appended_instructions = ""
2277
  final_prompt = f"{prompt} {base_instructions} {appended_instructions}"