Wajahat698 commited on
Commit
005ae08
·
verified ·
1 Parent(s): db41a35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -33
app.py CHANGED
@@ -2059,46 +2059,43 @@ def handle_prompt(prompt):
2059
  display_typing_indicator()
2060
 
2061
  cleaned_text = ""
2062
- # base_instructions = (
2063
- # "Follow previous conversation always. Avoid flowery language, typical AI phrases, or jargon. *Be specific with $ amounts awards, people and programs."
2064
- # "Sources must be always provided and be valid"
2065
- # "Strictly dont use trustbucket names in copy headings and content avoid it."
2066
 
2067
- # )
2068
 
2069
- # # Check if user request includes blog, article, or newsletter
2070
- # if any(keyword in prompt.lower() for keyword in ["blog", "article","report","annual report" "newsletter","website introduction"]):
2071
- # appended_instructions = (
2072
- # "Craft a flawless, engaging, and fluid compelling copy using *non-flowery language* that reads as though written by a professional copywriter having 25 years of experience. "
2073
- # "Do not use AI jargon, vague phrases, or formal language. Follow these enhanced guidelines to ensure a polished, publication-ready copy with a 10/10 quality: "
2074
- # "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. "
2075
- # "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. "
2076
- # "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."
2077
- # "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."
2078
- # "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. "
2079
- # "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. "
2080
- # "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. "
2081
- # "dont give source link in content"
2082
- # "Dont mention trust bucket names literally"
2083
- # "1. ##List of TrustBuilders Used: Provide trust-building elements with Source links."
2084
- # " 2. ##Heuristics and Creative Techniques :"
2085
- # " -List them in a footnote-style small heading."
2086
- # " Use the following structure:"
2087
- # " -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
2088
- # " -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
2089
- # "The final output must not include AI jargons.With every output give a active language creative headline that summarises the content give sub-headlines with each paragraph like example headline: We Empower or Similar Phrases. Avoid mentioning trustbucket names."
2090
- # "#MOST IMPORTANT RULES.EVERY PARAGRAPH SHOULD BE INTERCONNECTED 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."
2091
- # )
2092
- # else:
2093
- # appended_instructions = ""
2094
- # final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
2095
  global formatted_text
2096
 
2097
-
2098
  # Specialized responses if keywords detected
2099
  try:
2100
  output = agent_executor.invoke({
2101
- "input": f"{prompt}Eliminate Flowery words and Ai jargons.With copy always give curious active language sub-headlines with each interconnected paragraphs.Search on google provide accurate verifiable sources.",
2102
  "chat_history": st.session_state.chat_history
2103
  })
2104
  full_response = output["output"]
 
2059
  display_typing_indicator()
2060
 
2061
  cleaned_text = ""
2062
+ base_instructions = (
2063
+ "Eliminate Flowery words and Ai jargons.With copy always give curious active language sub-headlines with each interconnected paragraphs.Search on google provide accurate verifiable sources."
 
 
2064
 
2065
+ )
2066
 
2067
+ # Check if user request includes blog, article, or newsletter
2068
+ if any(keyword in prompt.lower() for keyword in ["blog", "article","report","annual report" "newsletter","website introduction"]):
2069
+ appended_instructions = (
2070
+ "Craft a flawless, engaging, and fluid compelling copy using *non-flowery language* that reads as though written by a professional copywriter having 25 years of experience. "
2071
+ "Do not use AI jargon, vague phrases, or formal language. Follow these enhanced guidelines to ensure a polished, publication-ready copy with a 10/10 quality: "
2072
+ "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. "
2073
+ "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. "
2074
+ "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."
2075
+ "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."
2076
+ "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. "
2077
+ "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. "
2078
+ "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. "
2079
+ "dont give source link in content"
2080
+ "Dont mention trust bucket names literally"
2081
+ "1. ##List of TrustBuilders Used: Provide trust-building elements with Source links."
2082
+ " 2. ##Heuristics and Creative Techniques :"
2083
+ " -List them in a footnote-style small heading."
2084
+ " Use the following structure:"
2085
+ " -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
2086
+ " -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
2087
+ "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: We Empower or Similar Phrases. Avoid mentioning trustbucket names."
2088
+ "#MOST IMPORTANT RULES.EVERY PARAGRAPH SHOULD BE INTERCONNECTED 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."
2089
+ )
2090
+ else:
2091
+ appended_instructions = ""
2092
+ final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
2093
  global formatted_text
2094
 
 
2095
  # Specialized responses if keywords detected
2096
  try:
2097
  output = agent_executor.invoke({
2098
+ "input": final_prompt,
2099
  "chat_history": st.session_state.chat_history
2100
  })
2101
  full_response = output["output"]