Wajahat698 commited on
Commit
85cba4d
·
verified ·
1 Parent(s): 47a2dcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -1796,12 +1796,7 @@ def initialize_user_session():
1796
  st.error(f"Error initializing user session: {e}")
1797
 
1798
 
1799
- # Update message usage in Firebase after each interaction
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.Only when asked to write an article, blog, newsletter, adhere to the following structure and ensure trust builders are fluidly interconnected for cohesive and logical flow. Use clear subheaders for each paragraph to structure the content effectively and Use explicit transitions to show how one section leads to or supports the next.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*. ",
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}")