Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,9 +88,17 @@ user_input = st.text_input("Enter your question here:")
|
|
| 88 |
|
| 89 |
# Button to trigger response
|
| 90 |
if st.button("Get Response"):
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
# Footer
|
| 96 |
st.markdown(
|
|
@@ -103,3 +111,4 @@ st.markdown(
|
|
| 103 |
)
|
| 104 |
|
| 105 |
|
|
|
|
|
|
| 88 |
|
| 89 |
# Button to trigger response
|
| 90 |
if st.button("Get Response"):
|
| 91 |
+
if user_input:
|
| 92 |
+
# Fetch and display response
|
| 93 |
+
response = fetch_response(user_input)
|
| 94 |
+
st.session_state.chat_history.append({"role": "user", "content": user_input})
|
| 95 |
+
st.session_state.chat_history.append({"role": "assistant", "content": response})
|
| 96 |
+
|
| 97 |
+
# Display new chat history without refreshing
|
| 98 |
+
st.experimental_rerun()
|
| 99 |
+
|
| 100 |
+
# Display input field at the end
|
| 101 |
+
st.text_input("Enter your question here:", key="input")
|
| 102 |
|
| 103 |
# Footer
|
| 104 |
st.markdown(
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
|
| 114 |
+
|