Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -491,19 +491,22 @@ if prompt :
|
|
| 491 |
"chat_history": st.session_state.chat_history
|
| 492 |
})
|
| 493 |
full_response = output["output"]
|
| 494 |
-
|
|
|
|
|
|
|
|
|
|
| 495 |
|
| 496 |
|
| 497 |
# Display the response
|
| 498 |
|
| 499 |
-
|
| 500 |
follow_up_output = agent_executor.invoke({
|
| 501 |
"input": f"Extract 1-2 follow-up questions from the following text: {full_response}",
|
| 502 |
"chat_history": st.session_state.chat_history
|
| 503 |
})
|
| 504 |
follow_up_questions = follow_up_output["output"]
|
| 505 |
if follow_up_questions:
|
| 506 |
-
st.
|
| 507 |
|
| 508 |
|
| 509 |
except Exception as e:
|
|
|
|
| 491 |
"chat_history": st.session_state.chat_history
|
| 492 |
})
|
| 493 |
full_response = output["output"]
|
| 494 |
+
|
| 495 |
+
|
| 496 |
+
full_response = re.sub(r'\s+', ' ', full_response).strip()
|
| 497 |
+
|
| 498 |
|
| 499 |
|
| 500 |
# Display the response
|
| 501 |
|
| 502 |
+
st.write(full_response)
|
| 503 |
follow_up_output = agent_executor.invoke({
|
| 504 |
"input": f"Extract 1-2 follow-up questions from the following text: {full_response}",
|
| 505 |
"chat_history": st.session_state.chat_history
|
| 506 |
})
|
| 507 |
follow_up_questions = follow_up_output["output"]
|
| 508 |
if follow_up_questions:
|
| 509 |
+
st.markdown(f"Follow-up questions:\n{follow_up_questions} \n")
|
| 510 |
|
| 511 |
|
| 512 |
except Exception as e:
|