Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1710,7 +1710,6 @@ def get_trust_tip_and_suggestion():
|
|
| 1710 |
|
| 1711 |
|
| 1712 |
def chatbot_response(message, history):
|
| 1713 |
-
|
| 1714 |
global selected_dataset_ai
|
| 1715 |
global df_builder_pivot_str
|
| 1716 |
|
|
@@ -1727,9 +1726,13 @@ def chatbot_response(message, history):
|
|
| 1727 |
|
| 1728 |
# Prepend the selected dataset to the response
|
| 1729 |
response = f"**Selected Dataset: {selected_dataset_ai}**\n\n{output['output']}"
|
| 1730 |
-
|
| 1731 |
-
|
| 1732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1733 |
|
| 1734 |
# Save the interaction context
|
| 1735 |
chat_history.extend(
|
|
|
|
| 1710 |
|
| 1711 |
|
| 1712 |
def chatbot_response(message, history):
|
|
|
|
| 1713 |
global selected_dataset_ai
|
| 1714 |
global df_builder_pivot_str
|
| 1715 |
|
|
|
|
| 1726 |
|
| 1727 |
# Prepend the selected dataset to the response
|
| 1728 |
response = f"**Selected Dataset: {selected_dataset_ai}**\n\n{output['output']}"
|
| 1729 |
+
|
| 1730 |
+
# Only append trust tip and suggestion if they are not already included
|
| 1731 |
+
trust_tip_and_suggestion = f"\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 1732 |
+
|
| 1733 |
+
# Avoid duplication by ensuring that neither 'Trust Tip' nor 'Suggestion' appears in the response already
|
| 1734 |
+
if trust_tip_and_suggestion not in response:
|
| 1735 |
+
response += trust_tip_and_suggestion
|
| 1736 |
|
| 1737 |
# Save the interaction context
|
| 1738 |
chat_history.extend(
|