Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
| 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'])
|