Wajahat698 commited on
Commit
587b59a
·
verified ·
1 Parent(s): 5f36435

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -27
app.py CHANGED
@@ -1233,24 +1233,13 @@ tools = [
1233
  ]
1234
 
1235
  prompt_message = f"""
1236
- **You are an expert multilingual copywriter specializing in creating highly fluid, compelling, and interconnected marketing copy that seamlessly integrates Trust Builders into various content formats. Your goal is to craft concise, engaging material based on the knowledgebase, adhering to the following guidelines:**
1237
 
1238
  - Write in **active voice** using **first-person perspective (“we”)**, avoiding third-person.
1239
  - Ensure **seamless flow** with logical transitions between paragraphs, maintaining relevance and consistency.
1240
  - Contextually integrate trust-building elements creatively. Avoid using **Stability, Development, Competence, Relationship, Benefit, Vision**, and the terms **“trust,” “beacon,” “beacon of hope,” “realm”**, except in specific phrases like **“Development trust builders.”**
1241
  - Focus on clarity, avoiding jargon or repetition while emphasizing impact on the audience.
1242
 
1243
- **Top Trust Builders**:
1244
- - When asked about top trust builders or trust builders for key trust drivers find exactly like this use knowledgebase only dont use google. :
1245
- - Provide same all statements present in knowledgebase with headings,
1246
- Top Trust Builders for [Audience/Query Context]:
1247
- [Trust Driver Name]:
1248
- - [Statements from knowledgebase]
1249
- ...
1250
- [Next Trust Driver Name]:
1251
- - [Statements from knowledgebase]
1252
- ...
1253
-
1254
  ### MANDATORY VERIFICATION CHECKLIST:
1255
  Before submitting **any content**, ensure that each piece includes:
1256
  1. **Specific Details**:
@@ -1271,6 +1260,7 @@ Before submitting **any content**, ensure that each piece includes:
1271
  *SOURCE LINK*
1272
  1. **Each source link must**:
1273
  -Be Latest, factual and verifiable not page not found links please.
 
1274
  2. Refer knowledge base for description, guiding principles, question to consider and examples for relevant trustbucket then *google search* and then give relevant trustbuilders.
1275
 
1276
  ##SPECIFICITY ENFORCEMENT
@@ -1451,7 +1441,6 @@ Note: When including heuristics and creative techniques, use the structure “He
1451
  "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."
1452
 
1453
  """
1454
-
1455
  prompt_template = ChatPromptTemplate.from_messages([
1456
  ("system", prompt_message),
1457
  MessagesPlaceholder(variable_name="chat_history"),
@@ -2156,18 +2145,24 @@ def handle_prompt(prompt):
2156
  add_dot_typing_animation()
2157
  display_typing_indicator()
2158
  cleaned_text = ""
2159
- base_instructions = """
2160
- 1. **Exact Wording**:
2161
- - When asked for **key trust drivers**, **top trust builders**, or **brand positioning statements**, search the **provided knowledgebase** and give the exact wording as-is, maintaining the original formatting.
2162
-
2163
- 2. **External Queries**:
2164
- *Be overly specific with details like $dollar amounts, awards, people's names, and program title*
2165
- - For other queries, such as those mentioning **Food for the Hungry** or **FH**, search internet using reliable valid sources.
2166
- - Always provide valid, verifiable source links.
2167
-
2168
- 3. **Content Guidelines**:
2169
- - Do **not** use **trust bucket names** (e.g., Stability Trust, Benefit Trust) in headings or content. Strictly avoid mentioning them.Also (beacon of hope,realm)
2170
-
 
 
 
 
 
 
2171
  """
2172
 
2173
 
@@ -2192,9 +2187,10 @@ def handle_prompt(prompt):
2192
  " -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
2193
  " -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
2194
  "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."
2195
- "MOST IMPORTANT RULE. EVERY PARAGRAPH 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."
 
2196
 
2197
- )
2198
  else:
2199
  appended_instructions = ""
2200
  final_prompt = f"{prompt} {base_instructions} {appended_instructions}"
 
1233
  ]
1234
 
1235
  prompt_message = f"""
1236
+ **You are an expert multilingual copywriter specializing in creating highly fluid, compelling, and interconnected marketing copy that seamlessly integrates Trust Builders into various content formats for any organization. Your goal is to craft concise, engaging material based on the knowledgebase, adhering to the following guidelines:**
1237
 
1238
  - Write in **active voice** using **first-person perspective (“we”)**, avoiding third-person.
1239
  - Ensure **seamless flow** with logical transitions between paragraphs, maintaining relevance and consistency.
1240
  - Contextually integrate trust-building elements creatively. Avoid using **Stability, Development, Competence, Relationship, Benefit, Vision**, and the terms **“trust,” “beacon,” “beacon of hope,” “realm”**, except in specific phrases like **“Development trust builders.”**
1241
  - Focus on clarity, avoiding jargon or repetition while emphasizing impact on the audience.
1242
 
 
 
 
 
 
 
 
 
 
 
 
1243
  ### MANDATORY VERIFICATION CHECKLIST:
1244
  Before submitting **any content**, ensure that each piece includes:
1245
  1. **Specific Details**:
 
1260
  *SOURCE LINK*
1261
  1. **Each source link must**:
1262
  -Be Latest, factual and verifiable not page not found links please.
1263
+
1264
  2. Refer knowledge base for description, guiding principles, question to consider and examples for relevant trustbucket then *google search* and then give relevant trustbuilders.
1265
 
1266
  ##SPECIFICITY ENFORCEMENT
 
1441
  "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."
1442
 
1443
  """
 
1444
  prompt_template = ChatPromptTemplate.from_messages([
1445
  ("system", prompt_message),
1446
  MessagesPlaceholder(variable_name="chat_history"),
 
2145
  add_dot_typing_animation()
2146
  display_typing_indicator()
2147
  cleaned_text = ""
2148
+ base_instructions = """
2149
+ *Be overly specific with details such as $dollar amounts, awards, people's names, and program titles*
2150
+
2151
+ 1. **Focus on Knowledge Base Data**:
2152
+ - When asked using uploaded documents, files or using knowledgebase files, prioritize information fetch everything asked from there.
2153
+ - Provide answers based on the knowledge base content when relevant.
2154
+
2155
+ 2. **Eliminate Flowery Language and AI Jargon**:
2156
+ - Avoid unnecessary technical terms and complex vocabulary.
2157
+
2158
+ 3. **Provide Accurate, Factual Information with Valid Sources**:
2159
+ - When information is not available in the knowledge base, search on Google.
2160
+ - Always include valid and verifiable source links in your responses.for knowledgebase data also sources should be googled.
2161
+
2162
+ 4. **Content Guidelines**:
2163
+ - Do **not** use trust bucket names (e.g., Stability Trust, Benefit Trust etc.) in content.
2164
+ - Strictly avoid mentioning them in your responses.
2165
+
2166
  """
2167
 
2168
 
 
2187
  " -Heuristics: Mention names only like examples (e.g., social proof, authority, commitment)."
2188
  " -Creative Techniques: Mention names onlyexamples (list only relevant marketing techniques without additional details)."
2189
  "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."
2190
+ "MOST IMPORTANT RULE. EVERY PARAGRAPH SHOULD BE DEEPLY
2191
+
2192
 
2193
+ )
2194
  else:
2195
  appended_instructions = ""
2196
  final_prompt = f"{prompt} {base_instructions} {appended_instructions}"