Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -483,7 +483,6 @@ if prompt and not st.session_state.chat_active:
|
|
| 483 |
|
| 484 |
# Generate AI response
|
| 485 |
with st.chat_message("assistant"):
|
| 486 |
-
message_placeholder = st.text()
|
| 487 |
full_response = ""
|
| 488 |
|
| 489 |
try:
|
|
@@ -497,7 +496,7 @@ if prompt and not st.session_state.chat_active:
|
|
| 497 |
|
| 498 |
# Display the response
|
| 499 |
|
| 500 |
-
|
| 501 |
follow_up_output = agent_executor.invoke({
|
| 502 |
"input": f"Extract 1-2 follow-up questions from the following text: {full_response}",
|
| 503 |
"chat_history": st.session_state.chat_history
|
|
@@ -510,7 +509,7 @@ if prompt and not st.session_state.chat_active:
|
|
| 510 |
except Exception as e:
|
| 511 |
logger.error(f"Error generating response: {e}")
|
| 512 |
full_response = "I apologize, but an error occurred while generating the response. Please try again."
|
| 513 |
-
|
| 514 |
|
| 515 |
# Add AI response to chat history
|
| 516 |
st.session_state.chat_history.append({"role": "assistant", "content": full_response})
|
|
|
|
| 483 |
|
| 484 |
# Generate AI response
|
| 485 |
with st.chat_message("assistant"):
|
|
|
|
| 486 |
full_response = ""
|
| 487 |
|
| 488 |
try:
|
|
|
|
| 496 |
|
| 497 |
# Display the response
|
| 498 |
|
| 499 |
+
st.write(full_response)
|
| 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
|
|
|
|
| 509 |
except Exception as e:
|
| 510 |
logger.error(f"Error generating response: {e}")
|
| 511 |
full_response = "I apologize, but an error occurred while generating the response. Please try again."
|
| 512 |
+
st.write(full_response)
|
| 513 |
|
| 514 |
# Add AI response to chat history
|
| 515 |
st.session_state.chat_history.append({"role": "assistant", "content": full_response})
|