jayash391 commited on
Commit
d371680
·
verified ·
1 Parent(s): b577bc2

Update sherlock2.py

Browse files
Files changed (1) hide show
  1. sherlock2.py +9 -0
sherlock2.py CHANGED
@@ -213,12 +213,21 @@ def search_internet(case_text):
213
 
214
  return internet_search_results
215
 
 
 
 
 
 
216
  # Function to display chat history with highlighted user input and chatbot response
217
  def display_chat_history():
218
  for user_msg, bot_msg in st.session_state.chat_history:
219
  st.info(f"**You:** {user_msg}")
220
  st.success(f"**Sherlock:** {bot_msg}")
221
 
 
 
 
 
222
  def investigate():
223
  """Handles the case investigation process, including file upload, text extraction, embedding generation,
224
  image processing, information analysis using Gemini models, web/Wikipedia search, and case report generation.
 
213
 
214
  return internet_search_results
215
 
216
+
217
+ # Initialize chat history
218
+ if 'chat_history' not in st.session_state:
219
+ st.session_state.chat_history = []
220
+
221
  # Function to display chat history with highlighted user input and chatbot response
222
  def display_chat_history():
223
  for user_msg, bot_msg in st.session_state.chat_history:
224
  st.info(f"**You:** {user_msg}")
225
  st.success(f"**Sherlock:** {bot_msg}")
226
 
227
+ # Function to clear chat history
228
+ def clear_chat():
229
+ st.session_state.chat_history = []
230
+
231
  def investigate():
232
  """Handles the case investigation process, including file upload, text extraction, embedding generation,
233
  image processing, information analysis using Gemini models, web/Wikipedia search, and case report generation.