ykl7 commited on
Commit
5f18a18
·
1 Parent(s): e4cab9a

alter session state and write utility functions for presets

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -253,11 +253,20 @@ def main():
253
 
254
  llm_client = LLMReasoner(options)
255
 
 
 
 
 
 
 
 
256
  # Accept user input
257
- if prompt := st.chat_input("Type here"):
 
258
  # Add user message to chat history
259
  display_message = prompt + " \n"+ " \n"+ f"Retriever: {selected_retriever}, Reasoner: {selected_reasoner}"
260
- st.session_state.messages.append({"role": "user", "content": display_message})
 
261
  # Display user message in chat message container
262
  with st.chat_message("user"):
263
  st.markdown(display_message)
 
253
 
254
  llm_client = LLMReasoner(options)
255
 
256
+ def send_preset_message(text):
257
+ # Add user message to chat history
258
+ st.session_state.messages.append({"role": "user", "content": text})
259
+ # Set the auto_submit flag to process this message
260
+ st.session_state.auto_submit = True
261
+ st.session_state.auto_submit_text = text
262
+
263
  # Accept user input
264
+ prompt = st.chat_input("Type your claim here"):
265
+ if prompt:
266
  # Add user message to chat history
267
  display_message = prompt + " \n"+ " \n"+ f"Retriever: {selected_retriever}, Reasoner: {selected_reasoner}"
268
+ st.session_state.messages.append({"role": "user", "content": prompt})
269
+ st.session_state.messages.append({"role": "summary", "content": display_message})
270
  # Display user message in chat message container
271
  with st.chat_message("user"):
272
  st.markdown(display_message)