Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1796,12 +1796,7 @@ def initialize_user_session():
|
|
| 1796 |
st.error(f"Error initializing user session: {e}")
|
| 1797 |
|
| 1798 |
|
| 1799 |
-
|
| 1800 |
-
def update_message_usage(wix_user_id):
|
| 1801 |
-
|
| 1802 |
-
st.session_state["used_messages"] += 1
|
| 1803 |
-
update_message_counter()
|
| 1804 |
-
|
| 1805 |
|
| 1806 |
|
| 1807 |
|
|
@@ -1907,7 +1902,7 @@ def handle_prompt(prompt):
|
|
| 1907 |
display_typing_indicator() # Specialized responses if keywords detected
|
| 1908 |
try:
|
| 1909 |
output = agent_executor.invoke({
|
| 1910 |
-
"input": f"{prompt} Avoid flowery language and AI-Jargons.
|
| 1911 |
"chat_history": st.session_state.chat_history
|
| 1912 |
})
|
| 1913 |
full_response = output["output"]
|
|
@@ -1919,7 +1914,6 @@ def handle_prompt(prompt):
|
|
| 1919 |
with st.chat_message("assistant"):
|
| 1920 |
st.markdown(combined_text, unsafe_allow_html=True)
|
| 1921 |
|
| 1922 |
-
update_message_usage(st.session_state.get("wix_user_id", "default_user"))
|
| 1923 |
|
| 1924 |
except Exception as e:
|
| 1925 |
logging.error(f"Error generating response: {e}")
|
|
|
|
| 1796 |
st.error(f"Error initializing user session: {e}")
|
| 1797 |
|
| 1798 |
|
| 1799 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1800 |
|
| 1801 |
|
| 1802 |
|
|
|
|
| 1902 |
display_typing_indicator() # Specialized responses if keywords detected
|
| 1903 |
try:
|
| 1904 |
output = agent_executor.invoke({
|
| 1905 |
+
"input": f"{prompt} Avoid flowery language and AI-Jargons.Give conversational headings with each pargraph of copy .Do-not mention trustbucket names literally and word 'trust' in the copy applications.*Use only knowledgebase when asked about top trust buckets and builders give exactly those*. ",
|
| 1906 |
"chat_history": st.session_state.chat_history
|
| 1907 |
})
|
| 1908 |
full_response = output["output"]
|
|
|
|
| 1914 |
with st.chat_message("assistant"):
|
| 1915 |
st.markdown(combined_text, unsafe_allow_html=True)
|
| 1916 |
|
|
|
|
| 1917 |
|
| 1918 |
except Exception as e:
|
| 1919 |
logging.error(f"Error generating response: {e}")
|