Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -461,18 +461,11 @@ def load_main_data_source():
|
|
| 461 |
|
| 462 |
|
| 463 |
def refresh_faiss_index():
|
| 464 |
-
"""
|
| 465 |
-
Load documents, create embeddings, and refresh the FAISS index.
|
| 466 |
-
"""
|
| 467 |
combined_sources = load_main_data_source()
|
| 468 |
if combined_sources:
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
st.session_state["faiss_db"] = db_faiss
|
| 473 |
-
except Exception as e:
|
| 474 |
-
st.error("An error occurred while refreshing the FAISS index.")
|
| 475 |
-
logger.error(f"Error refreshing FAISS index: {e}")
|
| 476 |
|
| 477 |
|
| 478 |
def update_message_counter():
|
|
@@ -661,7 +654,6 @@ def side():
|
|
| 661 |
The Group aims to reduce the life-cycle carbon emissions of its vehicles by <strong>30%</strong> compared to 2018, promoting environmental responsibility for customers.
|
| 662 |
</li>
|
| 663 |
</ul>
|
| 664 |
-
|
| 665 |
<h3 class="development">Development Trust:</h3>
|
| 666 |
<p>Why can I trust you to develop well in the future?</p>
|
| 667 |
<h5>Examples</h5>
|
|
@@ -685,13 +677,10 @@ def side():
|
|
| 685 |
Dr. Herbert Diess, CEO of Volkswagen, led initiatives in 2023 to engage <strong>3,000 employees</strong> in community volunteering projects, enhancing corporate social responsibility. This supports community engagement for employees.
|
| 686 |
</li>
|
| 687 |
</ul>
|
| 688 |
-
|
| 689 |
-
|
| 690 |
|
| 691 |
<h3 class="benefit">Benefit Trust:</h3>
|
| 692 |
<p>What benefits can I trust you for?</p>
|
| 693 |
<h5>Examples</h5>
|
| 694 |
-
|
| 695 |
<ul>
|
| 696 |
<li>
|
| 697 |
Volkswagen's commitment to becoming a <strong>net-carbon-neutral</strong> company by 2050 includes using recycled materials to reduce primary raw material needs, supporting sustainability. This promotes environmental responsibility for future generations.
|
|
@@ -700,7 +689,6 @@ def side():
|
|
| 700 |
The company has reduced water consumption by <strong>24%</strong>, waste by <strong>75%</strong>, and VOC emissions by <strong>68%</strong> per vehicle as of 2023, highlighting its dedication to minimizing environmental impact. This supports eco-friendly manufacturing for industry stakeholders.
|
| 701 |
</li>
|
| 702 |
</ul>
|
| 703 |
-
|
| 704 |
|
| 705 |
|
| 706 |
|
|
@@ -708,8 +696,6 @@ def side():
|
|
| 708 |
<h3 class="vision">Vision Trust:</h3>
|
| 709 |
<p>What Vision and Values can I trust you for?</p>
|
| 710 |
<h5>Examples</h5>
|
| 711 |
-
|
| 712 |
-
|
| 713 |
<ul>
|
| 714 |
<li>
|
| 715 |
The company has committed to investing <strong>€180 billion</strong> between 2023 and 2027 in areas like battery technology, digitalization, and e-mobility, driving forward its vision of sustainable transport. This supports technological advancement for stakeholders.
|
|
@@ -718,12 +704,10 @@ def side():
|
|
| 718 |
Volkswagen's <strong>"NEW AUTO"</strong> strategy, unveiled in 2023, aims to transform the company into a leading provider of sustainable and software-driven mobility solutions by 2030. This supports future mobility innovation for the automotive industry.
|
| 719 |
</li>
|
| 720 |
</ul>
|
| 721 |
-
|
| 722 |
|
| 723 |
<h3 class="competence">Competence Trust:</h3>
|
| 724 |
<p>What competencies can I trust you for?</p>
|
| 725 |
<h5>Examples</h5>
|
| 726 |
-
|
| 727 |
|
| 728 |
<ul>
|
| 729 |
<li>
|
|
@@ -733,7 +717,6 @@ def side():
|
|
| 733 |
Volkswagen's design team, led by <strong>Klaus Bischoff</strong>, has received accolades for innovative vehicle designs, enhancing aesthetic appeal and functionality. For instance, the Volkswagen Touareg received the top gold award in the "Passenger Vehicles" category at the German Design Awards. This supports creativity for automotive designers.
|
| 734 |
</li>
|
| 735 |
</ul>
|
| 736 |
-
|
| 737 |
|
| 738 |
|
| 739 |
|
|
@@ -1043,7 +1026,7 @@ def search_knowledge_base(query):
|
|
| 1043 |
return []
|
| 1044 |
|
| 1045 |
# Retrieve the top 5 most relevant documents
|
| 1046 |
-
retrieved_docs = st.session_state["faiss_db"].similarity_search(query, k=
|
| 1047 |
return retrieved_docs
|
| 1048 |
|
| 1049 |
def google_search(query):
|
|
@@ -1120,14 +1103,15 @@ def rag_response(query):
|
|
| 1120 |
prompt = f"""
|
| 1121 |
Context:
|
| 1122 |
{context}
|
| 1123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1124 |
Question:
|
| 1125 |
{query}
|
| 1126 |
-
|
| 1127 |
Answer:
|
| 1128 |
-
Please provide an exact and concise response based only on the context above.
|
| 1129 |
"""
|
| 1130 |
-
|
| 1131 |
llm = ChatOpenAI(model="gpt-4", temperature=0.2, api_key=openai_api_key)
|
| 1132 |
response = llm.invoke(prompt)
|
| 1133 |
|
|
@@ -1148,21 +1132,42 @@ def google_search_tool(query: str):
|
|
| 1148 |
return google_search(query)
|
| 1149 |
|
| 1150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1151 |
|
| 1152 |
|
| 1153 |
|
| 1154 |
tavily_tool = TavilySearchResults(
|
| 1155 |
-
max_results=
|
| 1156 |
-
search_depth="
|
| 1157 |
include_answer=True,
|
| 1158 |
-
include_raw_content=
|
| 1159 |
-
include_images=
|
| 1160 |
# include_domains=[...],
|
| 1161 |
# exclude_domains=[...],
|
| 1162 |
# name="...", # overwrite default tool name
|
| 1163 |
# description="...", # overwrite default tool description
|
| 1164 |
# args_schema=..., # overwrite default args_schema: BaseModel
|
| 1165 |
)
|
|
|
|
| 1166 |
# Compile all tool functions into a list
|
| 1167 |
tools = [
|
| 1168 |
knowledge_base_tool, # Tool for querying the knowledge base and retrieving responses
|
|
@@ -1171,11 +1176,9 @@ tools = [
|
|
| 1171 |
]
|
| 1172 |
|
| 1173 |
prompt_message = f"""
|
| 1174 |
-
** You are a Professional
|
| 1175 |
-
-When 'our,','FH,' or 'Food for the Hungry ' is mentioned, give FH information.
|
| 1176 |
-
|
| 1177 |
**Top Trust Builders**:
|
| 1178 |
-
- When asked about
|
| 1179 |
- Provide same all statements present in knowledgebase with headings,
|
| 1180 |
Top Trust Builders for [Audience/Query Context]:
|
| 1181 |
[Trust Driver Name]:
|
|
@@ -1209,16 +1212,13 @@ Before submitting any content, ensure it includes:
|
|
| 1209 |
- "global presence" → "offices in 127 cities across 45 countries".
|
| 1210 |
- "industry leader" → "ranked #1 in customer satisfaction by J.D. Power in 2023".
|
| 1211 |
- "significant impact" → "47% reduction in processing time".
|
| 1212 |
-
|
| 1213 |
### Critical Mandatory Instructions
|
| 1214 |
- **Avoid Prohibited Terms**: Do not mention "trust," "trust buckets," or category names like Development, Stability, Competence, Relationship, Vision in the copy, except for headings and searches.
|
| 1215 |
- **Consistency**: Maintain uniform format across all content types.
|
| 1216 |
- **Tone**: Use an active, engaging, and direct tone.
|
| 1217 |
- **Accuracy**: Ensure all details are current and correct.
|
| 1218 |
- **Formatting**: Ensure clean and professional formatting, with no HTML tags.
|
| 1219 |
-
|
| 1220 |
### Content Types and Formats
|
| 1221 |
-
|
| 1222 |
#### Report/Article/Write-up/ Blog
|
| 1223 |
- **Introduction**: "Here is a draft of your [Annual Report/Article/Write-up]. Feel free to suggest further refinements."
|
| 1224 |
- **Content**: **Donot give source link in content**
|
|
@@ -1243,10 +1243,7 @@ Before submitting any content, ensure it includes:
|
|
| 1243 |
- **Additional Requirements**:
|
| 1244 |
- Do not include prohibited terms in hashtags or copy.
|
| 1245 |
- Ensure source links are not included in the post text.
|
| 1246 |
-
|
| 1247 |
-
|
| 1248 |
#### Sales Conversations(between two persons)
|
| 1249 |
-
|
| 1250 |
- **Introduction Line**: Start with "Here is a draft of your [Sales Conversation/Ad Copy]. Feel free to suggest further refinements."
|
| 1251 |
- **Content**:
|
| 1252 |
- Include **persuasive elements** with integrated trust-building elements, interconnecting them fluidly **without mentioning prohibited terms**.
|
|
@@ -1257,8 +1254,6 @@ Before submitting any content, ensure it includes:
|
|
| 1257 |
- List them in footnote-style tiny small heading.
|
| 1258 |
- Select and name only **3-5 relevant heuristics** with tight bullet points.
|
| 1259 |
- Name only the relevant marketing creative techniques, with no additional details.
|
| 1260 |
-
|
| 1261 |
-
|
| 1262 |
### Emails, Newsletter, Direct Marketing Letters**
|
| 1263 |
- **Introduction Line**: Start with "Here is a draft of your [Email/Newsletter/Letter,Blog]. Feel free to suggest further refinements."
|
| 1264 |
- **Structure**:
|
|
@@ -1279,7 +1274,7 @@ Before submitting any content, ensure it includes:
|
|
| 1279 |
-Limit to 3-5 items in each category.
|
| 1280 |
|
| 1281 |
### Trust-Based Queries:**
|
| 1282 |
-
|
| 1283 |
- When a query seeks a specific number of trust builders (e.g., "5 trust builders"), the AI should:
|
| 1284 |
- Randomly pick the requested number of trust buckets from the six available: Development Trust, Competence Trust, Stability Trust, Relationship Trust, Benefit Trust, and Vision Trust.
|
| 1285 |
- For each selected bucket, find 15 TrustBuilders® points be over specific with numbers,names,dollars, programs ,awards and action.
|
|
@@ -1302,7 +1297,6 @@ Before submitting any content, ensure it includes:
|
|
| 1302 |
- **For Specific Categories:**
|
| 1303 |
- When a query asks for a specific category (e.g., "Development trust builders"), find 15 trust-building points that are specific with relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions specifically for that category.
|
| 1304 |
- Categorize these points into Organization, People, and Offers/Services (with 5 points for each category).
|
| 1305 |
-
|
| 1306 |
-**Format:**
|
| 1307 |
- **Introduction Line:** Start with "Here are TrustBuilders® for [Selected Categories] at [Organization Name]. Let me know if you want to refine the results or find more."
|
| 1308 |
- **Categories:**
|
|
@@ -1326,10 +1320,9 @@ Before submitting any content, ensure it includes:
|
|
| 1326 |
- [Trust-Building Point 15] - [Source](#)
|
| 1327 |
|
| 1328 |
- Ensure each selected category contains 15 trust-building points, categorized as specified.
|
| 1329 |
-
- Provide bullet points under each section with
|
| 1330 |
-
|
| 1331 |
**Important Notes:**
|
| 1332 |
-
-
|
| 1333 |
- **No Subheadings or Labels:** Under each main category, list the trust-building points directly as bullet points or numbered lists **without any additional subheadings, labels, descriptors, phrases, or words before the points**.
|
| 1334 |
- **Avoid Flowery Language:** Do not use any flowery or exaggerated language.
|
| 1335 |
- **Do Not Include:**
|
|
@@ -1348,14 +1341,10 @@ Before submitting any content, ensure it includes:
|
|
| 1348 |
- **Each point must be followed by**:
|
| 1349 |
- "This [specific benefit] for [specific audience]"
|
| 1350 |
- **Example**: "This reduces wait times by 47% for patients seeking emergency care."
|
| 1351 |
-
|
| 1352 |
### General Queries
|
| 1353 |
- Do not use the knowledge base for non-trust content.
|
| 1354 |
- Always clarify the audience impact and ensure all information is based on verified sources.
|
| 1355 |
-Refer knowledgebase when asked about trustifier or TrustLogic.
|
| 1356 |
-
|
| 1357 |
-
|
| 1358 |
-
|
| 1359 |
"""
|
| 1360 |
|
| 1361 |
prompt_template = ChatPromptTemplate.from_messages([
|
|
@@ -1538,7 +1527,6 @@ def receive_wix_message():
|
|
| 1538 |
'wix_user_id': data.wixUserId,
|
| 1539 |
'email': data.email
|
| 1540 |
}, "*");
|
| 1541 |
-
|
| 1542 |
// Send message back to Streamlit
|
| 1543 |
window.parent.postMessage({
|
| 1544 |
wix_user_id: data.wixUserId,
|
|
@@ -1610,7 +1598,6 @@ def add_dot_typing_animation():
|
|
| 1610 |
display: flex;
|
| 1611 |
align-items: center;
|
| 1612 |
}
|
| 1613 |
-
|
| 1614 |
.dot {
|
| 1615 |
height: 10px;
|
| 1616 |
width: 10px;
|
|
@@ -1620,15 +1607,12 @@ def add_dot_typing_animation():
|
|
| 1620 |
display: inline-block;
|
| 1621 |
animation: dot-blink 1.5s infinite ease-in-out;
|
| 1622 |
}
|
| 1623 |
-
|
| 1624 |
.dot:nth-child(2) {
|
| 1625 |
animation-delay: 0.2s;
|
| 1626 |
}
|
| 1627 |
-
|
| 1628 |
.dot:nth-child(3) {
|
| 1629 |
animation-delay: 0.4s;
|
| 1630 |
}
|
| 1631 |
-
|
| 1632 |
@keyframes dot-blink {
|
| 1633 |
0% {
|
| 1634 |
opacity: 0.3;
|
|
@@ -2068,10 +2052,10 @@ def handle_prompt(prompt):
|
|
| 2068 |
display_typing_indicator()
|
| 2069 |
cleaned_text = ""
|
| 2070 |
base_instructions = (
|
| 2071 |
-
"
|
| 2072 |
"Strictly dont use trustbucket names in copy headings and content avoid it"
|
| 2073 |
-
"Avoid Flowery words and AI jargons."
|
| 2074 |
)
|
|
|
|
| 2075 |
# Check if user request includes blog, article, or newsletter
|
| 2076 |
if any(keyword in prompt.lower() for keyword in ["blog", "article","annual report","report", "newsletter"]):
|
| 2077 |
appended_instructions = (
|
|
|
|
| 461 |
|
| 462 |
|
| 463 |
def refresh_faiss_index():
|
|
|
|
|
|
|
|
|
|
| 464 |
combined_sources = load_main_data_source()
|
| 465 |
if combined_sources:
|
| 466 |
+
embeddings = OpenAIEmbeddings()
|
| 467 |
+
db_faiss = FAISS.from_documents(combined_sources, embeddings)
|
| 468 |
+
st.session_state["faiss_db"] = db_faiss
|
|
|
|
|
|
|
|
|
|
|
|
|
| 469 |
|
| 470 |
|
| 471 |
def update_message_counter():
|
|
|
|
| 654 |
The Group aims to reduce the life-cycle carbon emissions of its vehicles by <strong>30%</strong> compared to 2018, promoting environmental responsibility for customers.
|
| 655 |
</li>
|
| 656 |
</ul>
|
|
|
|
| 657 |
<h3 class="development">Development Trust:</h3>
|
| 658 |
<p>Why can I trust you to develop well in the future?</p>
|
| 659 |
<h5>Examples</h5>
|
|
|
|
| 677 |
Dr. Herbert Diess, CEO of Volkswagen, led initiatives in 2023 to engage <strong>3,000 employees</strong> in community volunteering projects, enhancing corporate social responsibility. This supports community engagement for employees.
|
| 678 |
</li>
|
| 679 |
</ul>
|
|
|
|
|
|
|
| 680 |
|
| 681 |
<h3 class="benefit">Benefit Trust:</h3>
|
| 682 |
<p>What benefits can I trust you for?</p>
|
| 683 |
<h5>Examples</h5>
|
|
|
|
| 684 |
<ul>
|
| 685 |
<li>
|
| 686 |
Volkswagen's commitment to becoming a <strong>net-carbon-neutral</strong> company by 2050 includes using recycled materials to reduce primary raw material needs, supporting sustainability. This promotes environmental responsibility for future generations.
|
|
|
|
| 689 |
The company has reduced water consumption by <strong>24%</strong>, waste by <strong>75%</strong>, and VOC emissions by <strong>68%</strong> per vehicle as of 2023, highlighting its dedication to minimizing environmental impact. This supports eco-friendly manufacturing for industry stakeholders.
|
| 690 |
</li>
|
| 691 |
</ul>
|
|
|
|
| 692 |
|
| 693 |
|
| 694 |
|
|
|
|
| 696 |
<h3 class="vision">Vision Trust:</h3>
|
| 697 |
<p>What Vision and Values can I trust you for?</p>
|
| 698 |
<h5>Examples</h5>
|
|
|
|
|
|
|
| 699 |
<ul>
|
| 700 |
<li>
|
| 701 |
The company has committed to investing <strong>€180 billion</strong> between 2023 and 2027 in areas like battery technology, digitalization, and e-mobility, driving forward its vision of sustainable transport. This supports technological advancement for stakeholders.
|
|
|
|
| 704 |
Volkswagen's <strong>"NEW AUTO"</strong> strategy, unveiled in 2023, aims to transform the company into a leading provider of sustainable and software-driven mobility solutions by 2030. This supports future mobility innovation for the automotive industry.
|
| 705 |
</li>
|
| 706 |
</ul>
|
|
|
|
| 707 |
|
| 708 |
<h3 class="competence">Competence Trust:</h3>
|
| 709 |
<p>What competencies can I trust you for?</p>
|
| 710 |
<h5>Examples</h5>
|
|
|
|
| 711 |
|
| 712 |
<ul>
|
| 713 |
<li>
|
|
|
|
| 717 |
Volkswagen's design team, led by <strong>Klaus Bischoff</strong>, has received accolades for innovative vehicle designs, enhancing aesthetic appeal and functionality. For instance, the Volkswagen Touareg received the top gold award in the "Passenger Vehicles" category at the German Design Awards. This supports creativity for automotive designers.
|
| 718 |
</li>
|
| 719 |
</ul>
|
|
|
|
| 720 |
|
| 721 |
|
| 722 |
|
|
|
|
| 1026 |
return []
|
| 1027 |
|
| 1028 |
# Retrieve the top 5 most relevant documents
|
| 1029 |
+
retrieved_docs = st.session_state["faiss_db"].similarity_search(query, k=3)
|
| 1030 |
return retrieved_docs
|
| 1031 |
|
| 1032 |
def google_search(query):
|
|
|
|
| 1103 |
prompt = f"""
|
| 1104 |
Context:
|
| 1105 |
{context}
|
| 1106 |
+
You are an expert assistant tasked with providing precise and accurate answers based only on the provided context.
|
| 1107 |
+
1. Use only the provided context to generate your answer.
|
| 1108 |
+
2. Match headings and content exactly as they appear in the knowledge base. Do not add, modify, or generalize content.
|
| 1109 |
+
|
| 1110 |
+
3. Maintain clarity, conciseness, and accuracy.
|
| 1111 |
Question:
|
| 1112 |
{query}
|
|
|
|
| 1113 |
Answer:
|
|
|
|
| 1114 |
"""
|
|
|
|
| 1115 |
llm = ChatOpenAI(model="gpt-4", temperature=0.2, api_key=openai_api_key)
|
| 1116 |
response = llm.invoke(prompt)
|
| 1117 |
|
|
|
|
| 1132 |
return google_search(query)
|
| 1133 |
|
| 1134 |
|
| 1135 |
+
# Initialize Redis connection
|
| 1136 |
+
redis_client = redis.StrictRedis(host="localhost", port=6379, decode_responses=True)
|
| 1137 |
+
|
| 1138 |
+
def generate_cache_key(query):
|
| 1139 |
+
"""Generate a unique key for caching based on query."""
|
| 1140 |
+
return hashlib.sha256(query.encode()).hexdigest()
|
| 1141 |
+
|
| 1142 |
+
def get_cached_response(query):
|
| 1143 |
+
"""Retrieve cached response if it exists."""
|
| 1144 |
+
cache_key = generate_cache_key(query)
|
| 1145 |
+
return redis_client.get(cache_key)
|
| 1146 |
+
|
| 1147 |
+
def cache_response(query, response, ttl=3600):
|
| 1148 |
+
"""Cache the response with a time-to-live (TTL)."""
|
| 1149 |
+
cache_key = generate_cache_key(query)
|
| 1150 |
+
redis_client.setex(cache_key, ttl, response)
|
| 1151 |
+
|
| 1152 |
+
|
| 1153 |
+
|
| 1154 |
+
|
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
tavily_tool = TavilySearchResults(
|
| 1159 |
+
max_results=5,
|
| 1160 |
+
search_depth="intermediate",
|
| 1161 |
include_answer=True,
|
| 1162 |
+
include_raw_content=False,
|
| 1163 |
+
include_images=False,
|
| 1164 |
# include_domains=[...],
|
| 1165 |
# exclude_domains=[...],
|
| 1166 |
# name="...", # overwrite default tool name
|
| 1167 |
# description="...", # overwrite default tool description
|
| 1168 |
# args_schema=..., # overwrite default args_schema: BaseModel
|
| 1169 |
)
|
| 1170 |
+
|
| 1171 |
# Compile all tool functions into a list
|
| 1172 |
tools = [
|
| 1173 |
knowledge_base_tool, # Tool for querying the knowledge base and retrieving responses
|
|
|
|
| 1176 |
]
|
| 1177 |
|
| 1178 |
prompt_message = f"""
|
| 1179 |
+
** You are a Professional copywriter tasked with creating non-flowery fluid, interconnected marketing content that integrates Trust Builders into various formats for food for the hungry. Your content should be compelling, factual, well-structured, concise, and based on the knowledgebase. Write in an active voice using the first-person perspective ("we"), and avoid the third-person perspective. Creatively interconnect trust-building elements to enhance flow and impact. Avoid using terms like Stability, Development, Competence, Relationship, Benefit, Vision, trust, beacon, beacon of hope, and realm, except where specified.
|
|
|
|
|
|
|
| 1180 |
**Top Trust Builders**:
|
| 1181 |
+
- When asked about top trust builders or trust builders for key trust drivers find exactly like this use knowledgebase only dont use google. :
|
| 1182 |
- Provide same all statements present in knowledgebase with headings,
|
| 1183 |
Top Trust Builders for [Audience/Query Context]:
|
| 1184 |
[Trust Driver Name]:
|
|
|
|
| 1212 |
- "global presence" → "offices in 127 cities across 45 countries".
|
| 1213 |
- "industry leader" → "ranked #1 in customer satisfaction by J.D. Power in 2023".
|
| 1214 |
- "significant impact" → "47% reduction in processing time".
|
|
|
|
| 1215 |
### Critical Mandatory Instructions
|
| 1216 |
- **Avoid Prohibited Terms**: Do not mention "trust," "trust buckets," or category names like Development, Stability, Competence, Relationship, Vision in the copy, except for headings and searches.
|
| 1217 |
- **Consistency**: Maintain uniform format across all content types.
|
| 1218 |
- **Tone**: Use an active, engaging, and direct tone.
|
| 1219 |
- **Accuracy**: Ensure all details are current and correct.
|
| 1220 |
- **Formatting**: Ensure clean and professional formatting, with no HTML tags.
|
|
|
|
| 1221 |
### Content Types and Formats
|
|
|
|
| 1222 |
#### Report/Article/Write-up/ Blog
|
| 1223 |
- **Introduction**: "Here is a draft of your [Annual Report/Article/Write-up]. Feel free to suggest further refinements."
|
| 1224 |
- **Content**: **Donot give source link in content**
|
|
|
|
| 1243 |
- **Additional Requirements**:
|
| 1244 |
- Do not include prohibited terms in hashtags or copy.
|
| 1245 |
- Ensure source links are not included in the post text.
|
|
|
|
|
|
|
| 1246 |
#### Sales Conversations(between two persons)
|
|
|
|
| 1247 |
- **Introduction Line**: Start with "Here is a draft of your [Sales Conversation/Ad Copy]. Feel free to suggest further refinements."
|
| 1248 |
- **Content**:
|
| 1249 |
- Include **persuasive elements** with integrated trust-building elements, interconnecting them fluidly **without mentioning prohibited terms**.
|
|
|
|
| 1254 |
- List them in footnote-style tiny small heading.
|
| 1255 |
- Select and name only **3-5 relevant heuristics** with tight bullet points.
|
| 1256 |
- Name only the relevant marketing creative techniques, with no additional details.
|
|
|
|
|
|
|
| 1257 |
### Emails, Newsletter, Direct Marketing Letters**
|
| 1258 |
- **Introduction Line**: Start with "Here is a draft of your [Email/Newsletter/Letter,Blog]. Feel free to suggest further refinements."
|
| 1259 |
- **Structure**:
|
|
|
|
| 1274 |
-Limit to 3-5 items in each category.
|
| 1275 |
|
| 1276 |
### Trust-Based Queries:**
|
| 1277 |
+
Be over specific with numbers,names,dollars, programs ,awards and action.
|
| 1278 |
- When a query seeks a specific number of trust builders (e.g., "5 trust builders"), the AI should:
|
| 1279 |
- Randomly pick the requested number of trust buckets from the six available: Development Trust, Competence Trust, Stability Trust, Relationship Trust, Benefit Trust, and Vision Trust.
|
| 1280 |
- For each selected bucket, find 15 TrustBuilders® points be over specific with numbers,names,dollars, programs ,awards and action.
|
|
|
|
| 1297 |
- **For Specific Categories:**
|
| 1298 |
- When a query asks for a specific category (e.g., "Development trust builders"), find 15 trust-building points that are specific with relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions specifically for that category.
|
| 1299 |
- Categorize these points into Organization, People, and Offers/Services (with 5 points for each category).
|
|
|
|
| 1300 |
-**Format:**
|
| 1301 |
- **Introduction Line:** Start with "Here are TrustBuilders® for [Selected Categories] at [Organization Name]. Let me know if you want to refine the results or find more."
|
| 1302 |
- **Categories:**
|
|
|
|
| 1320 |
- [Trust-Building Point 15] - [Source](#)
|
| 1321 |
|
| 1322 |
- Ensure each selected category contains 15 trust-building points, categorized as specified.
|
| 1323 |
+
- Provide bullet points under each section with relevant accurate source link.
|
|
|
|
| 1324 |
**Important Notes:**
|
| 1325 |
+
- Strictly search and provide accurate source links always.
|
| 1326 |
- **No Subheadings or Labels:** Under each main category, list the trust-building points directly as bullet points or numbered lists **without any additional subheadings, labels, descriptors, phrases, or words before the points**.
|
| 1327 |
- **Avoid Flowery Language:** Do not use any flowery or exaggerated language.
|
| 1328 |
- **Do Not Include:**
|
|
|
|
| 1341 |
- **Each point must be followed by**:
|
| 1342 |
- "This [specific benefit] for [specific audience]"
|
| 1343 |
- **Example**: "This reduces wait times by 47% for patients seeking emergency care."
|
|
|
|
| 1344 |
### General Queries
|
| 1345 |
- Do not use the knowledge base for non-trust content.
|
| 1346 |
- Always clarify the audience impact and ensure all information is based on verified sources.
|
| 1347 |
-Refer knowledgebase when asked about trustifier or TrustLogic.
|
|
|
|
|
|
|
|
|
|
| 1348 |
"""
|
| 1349 |
|
| 1350 |
prompt_template = ChatPromptTemplate.from_messages([
|
|
|
|
| 1527 |
'wix_user_id': data.wixUserId,
|
| 1528 |
'email': data.email
|
| 1529 |
}, "*");
|
|
|
|
| 1530 |
// Send message back to Streamlit
|
| 1531 |
window.parent.postMessage({
|
| 1532 |
wix_user_id: data.wixUserId,
|
|
|
|
| 1598 |
display: flex;
|
| 1599 |
align-items: center;
|
| 1600 |
}
|
|
|
|
| 1601 |
.dot {
|
| 1602 |
height: 10px;
|
| 1603 |
width: 10px;
|
|
|
|
| 1607 |
display: inline-block;
|
| 1608 |
animation: dot-blink 1.5s infinite ease-in-out;
|
| 1609 |
}
|
|
|
|
| 1610 |
.dot:nth-child(2) {
|
| 1611 |
animation-delay: 0.2s;
|
| 1612 |
}
|
|
|
|
| 1613 |
.dot:nth-child(3) {
|
| 1614 |
animation-delay: 0.4s;
|
| 1615 |
}
|
|
|
|
| 1616 |
@keyframes dot-blink {
|
| 1617 |
0% {
|
| 1618 |
opacity: 0.3;
|
|
|
|
| 2052 |
display_typing_indicator()
|
| 2053 |
cleaned_text = ""
|
| 2054 |
base_instructions = (
|
| 2055 |
+
"When asked for key trust drivers or top trustbuilders or brand positioning statement search in knowledgebase give as-is wording. for other quries also like mentioning food for the hungry or fh Search google Give valid verifiable sources links always *Be over specific with $ amounts awards, people and programs*."
|
| 2056 |
"Strictly dont use trustbucket names in copy headings and content avoid it"
|
|
|
|
| 2057 |
)
|
| 2058 |
+
|
| 2059 |
# Check if user request includes blog, article, or newsletter
|
| 2060 |
if any(keyword in prompt.lower() for keyword in ["blog", "article","annual report","report", "newsletter"]):
|
| 2061 |
appended_instructions = (
|