Update app.py
Browse files
app.py
CHANGED
@@ -144,11 +144,13 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
144 |
with st.chat_message("user"):
|
145 |
st.markdown(prompt)
|
146 |
with st.chat_message("assistant"):
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
152 |
|
153 |
def generate_pdf():
|
154 |
page_number = int(result['source_documents'][0].metadata['page'])
|
|
|
144 |
with st.chat_message("user"):
|
145 |
st.markdown(prompt)
|
146 |
with st.chat_message("assistant"):
|
147 |
+
with st.spinner(text="Looking for relevant answer"):
|
148 |
+
|
149 |
+
message_placeholder = st.empty()
|
150 |
+
full_response = ""
|
151 |
+
message_history = "\n".join(list(get_message_history())[-3:])
|
152 |
+
result = qa_chain(prompt)
|
153 |
+
output = [result['result']]
|
154 |
|
155 |
def generate_pdf():
|
156 |
page_number = int(result['source_documents'][0].metadata['page'])
|