suriya7 commited on
Commit
f1e456d
1 Parent(s): 657f41f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -93,16 +93,9 @@ with st.sidebar:
93
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
94
  if user_prompt:
95
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
96
- for message in st.session_state.messages:
97
- with st.chat_message(message['role']):
98
- st.write(message['content'])
99
  response = handle_query(user_prompt)
100
- if st.session_state.messages[-1]["role"] != "assistant":
101
- with st.chat_message("assistant"):
102
- with st.spinner("Thinking..."):
103
- st.write(response)
104
  st.session_state.messages.append({'role': 'assistant', "content": response})
105
 
106
- # for message in st.session_state.messages:
107
- # with st.chat_message(message['role']):
108
- # st.write(message['content'])
 
93
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
94
  if user_prompt:
95
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
 
 
 
96
  response = handle_query(user_prompt)
 
 
 
 
97
  st.session_state.messages.append({'role': 'assistant', "content": response})
98
 
99
+ for message in st.session_state.messages:
100
+ with st.chat_message(message['role']):
101
+ st.write(message['content'])