Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
| 2207 |
-
|
| 2208 |
-
|
| 2209 |
|
| 2210 |
-
2. **Prioritize Knowledge Base and Internet Sources**:
|
| 2211 |
-
|
| 2212 |
-
|
| 2213 |
|
| 2214 |
-
3. **Avoid Flowery Language and AI Jargon**:
|
| 2215 |
-
|
| 2216 |
|
| 2217 |
-
4. **Ensure Accuracy**:
|
| 2218 |
-
|
| 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 |
-
|
| 2234 |
-
|
| 2235 |
-
|
| 2236 |
-
|
| 2237 |
-
|
| 2238 |
-
|
| 2239 |
-
|
| 2240 |
-
|
| 2241 |
-
|
| 2242 |
-
|
| 2243 |
-
|
| 2244 |
-
|
| 2245 |
-
|
| 2246 |
-
|
| 2247 |
-
|
| 2248 |
-
|
| 2249 |
-
|
| 2250 |
-
|
| 2251 |
-
|
| 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}"
|