Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1561,21 +1561,46 @@ Generating Content**
|
|
| 1561 |
2. **Content Integration:**
|
| 1562 |
- Use **all TrustBuilders®** from all buckets without exceptions.
|
| 1563 |
- Incorporate each TrustBuilder® clearly and meaningfully into the narrative.
|
| 1564 |
-
|
| 1565 |
-
|
| 1566 |
-
|
| 1567 |
-
|
| 1568 |
-
|
| 1569 |
-
|
| 1570 |
-
|
| 1571 |
-
|
| 1572 |
-
|
| 1573 |
-
|
| 1574 |
-
|
| 1575 |
-
|
| 1576 |
-
|
| 1577 |
-
|
| 1578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1579 |
---
|
| 1580 |
**Content Guidelines**
|
| 1581 |
**General Rules**
|
|
@@ -1774,15 +1799,15 @@ def chatbot_response(message, history):
|
|
| 1774 |
try:
|
| 1775 |
# Recompute DATAFRAME_PROOF_POINT based on the selected dataset
|
| 1776 |
#df_builder_pivot_str = compute_dataframe_proof_point()
|
| 1777 |
-
|
|
|
|
| 1778 |
# Get top-scoring statements based on selected dataset
|
| 1779 |
-
top_scoring_statements = get_top_scoring_statements(selected_dataset_ai)
|
| 1780 |
|
| 1781 |
output = agent_executor.invoke({"input": message, "chat_history": chat_history})
|
| 1782 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 1783 |
|
| 1784 |
# Prepend top-scoring statements to the response
|
| 1785 |
-
response = f"**Selected Dataset: {selected_dataset_ai}**\n\n{
|
| 1786 |
|
| 1787 |
# Add Trust Tip and Suggestion if not already in history
|
| 1788 |
if not any(f"**Trust Tip**: {trust_tip}" in entry["bot"] and f"**Suggestion**: {suggestion}" in entry["bot"] for entry in history):
|
|
@@ -1865,8 +1890,10 @@ def display_trust_score_2():
|
|
| 1865 |
|
| 1866 |
|
| 1867 |
def update_ai_dataset_selection(selection):
|
| 1868 |
-
|
| 1869 |
-
|
|
|
|
|
|
|
| 1870 |
return selected_dataset_ai
|
| 1871 |
|
| 1872 |
placeholder_text = """
|
|
|
|
| 1561 |
2. **Content Integration:**
|
| 1562 |
- Use **all TrustBuilders®** from all buckets without exceptions.
|
| 1563 |
- Incorporate each TrustBuilder® clearly and meaningfully into the narrative.
|
| 1564 |
+
|
| 1565 |
+
If dataset is VW Customers there are top scoring statements:
|
| 1566 |
+
Top Scoring Statements:
|
| 1567 |
+
|
| 1568 |
+
*Development*
|
| 1569 |
+
- We bring together the world's best talent in many disciplines to create your cars.(25%)
|
| 1570 |
+
- Building great and affordable cars is our foundation.(22%)
|
| 1571 |
+
- Our beginnings are a unique combination of investors and unions, and today 9 of our 20 board members are staff representatives.(18%)
|
| 1572 |
+
|
| 1573 |
+
*Benefit*
|
| 1574 |
+
- We bring together the world's best talent in many disciplines to create your cars.(23%)
|
| 1575 |
+
- We strongly focus on keeping and nurturing our team and have a 99.5% retention rate.(18%)
|
| 1576 |
+
- Employees are provided with extensive continuous training.(16%)
|
| 1577 |
+
|
| 1578 |
+
*Vision*
|
| 1579 |
+
- Our brands are ranked No. 2 and 5 in the reliability rankings.(27%)
|
| 1580 |
+
- Our technology and manufacturing capabilities are second to none.(22%)
|
| 1581 |
+
- We produce almost 9 million cars per year.(15%)
|
| 1582 |
+
|
| 1583 |
+
|
| 1584 |
+
If dataset is VW Prospects there are top scoring statements:
|
| 1585 |
+
Top Scoring Statements:
|
| 1586 |
+
|
| 1587 |
+
*Stability*
|
| 1588 |
+
- We work with our unions in our restructuring and future plans.(21%)
|
| 1589 |
+
- We have learned from our mistakes in the Diesel Affair and made fundamental changes.(19%)
|
| 1590 |
+
- Building great and affordable cars is our foundation.(18%)
|
| 1591 |
+
|
| 1592 |
+
*Relationship*
|
| 1593 |
+
- We put a lot of emphasis on the interior experience and two of our cars have been ranked in the top 10. (24%)
|
| 1594 |
+
- We are at the forefront of technology to deliver better cars and driving experiences. (17%)
|
| 1595 |
+
- Our beginnings are a unique combination of investors and unions, and today 9 of our 20 board members are staff representatives. (17%)
|
| 1596 |
+
|
| 1597 |
+
*Competence*
|
| 1598 |
+
- At the heart of our decision-making is the long-term quality of life for all of us. (20%)
|
| 1599 |
+
- We put a lot of emphasis on the interior experience and two of our cars have been ranked in the top 10. (19%)
|
| 1600 |
+
- We are one of the longest-established car companies. (18%)
|
| 1601 |
+
|
| 1602 |
+
just use them as per dataset and mention
|
| 1603 |
+
|
| 1604 |
---
|
| 1605 |
**Content Guidelines**
|
| 1606 |
**General Rules**
|
|
|
|
| 1799 |
try:
|
| 1800 |
# Recompute DATAFRAME_PROOF_POINT based on the selected dataset
|
| 1801 |
#df_builder_pivot_str = compute_dataframe_proof_point()
|
| 1802 |
+
selected_dataset_ai = read_ai_dataset_selection()
|
| 1803 |
+
|
| 1804 |
# Get top-scoring statements based on selected dataset
|
|
|
|
| 1805 |
|
| 1806 |
output = agent_executor.invoke({"input": message, "chat_history": chat_history})
|
| 1807 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 1808 |
|
| 1809 |
# Prepend top-scoring statements to the response
|
| 1810 |
+
response = f"**Selected Dataset: {selected_dataset_ai}**\n\n{output['output']}"
|
| 1811 |
|
| 1812 |
# Add Trust Tip and Suggestion if not already in history
|
| 1813 |
if not any(f"**Trust Tip**: {trust_tip}" in entry["bot"] and f"**Suggestion**: {suggestion}" in entry["bot"] for entry in history):
|
|
|
|
| 1890 |
|
| 1891 |
|
| 1892 |
def update_ai_dataset_selection(selection):
|
| 1893 |
+
if selection == "VW Customers":
|
| 1894 |
+
selected_dataset_ai = vw_customers_state.value[0] # Use the customer dataset
|
| 1895 |
+
elif selection == "VW Prospects":
|
| 1896 |
+
selected_dataset_ai = vw_prospects_state.value[0] # Use the prospects dataset
|
| 1897 |
return selected_dataset_ai
|
| 1898 |
|
| 1899 |
placeholder_text = """
|