Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,4 +53,16 @@ def main():
|
|
| 53 |
st.text_area("You", value=user_input, height=50, disabled=True)
|
| 54 |
st.text_area("Nietzsche", value=bot_response, height=100, disabled=True)
|
| 55 |
|
| 56 |
-
# User input
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
st.text_area("You", value=user_input, height=50, disabled=True)
|
| 54 |
st.text_area("Nietzsche", value=bot_response, height=100, disabled=True)
|
| 55 |
|
| 56 |
+
# User input
|
| 57 |
+
user_input = st.text_input("Your Question", placeholder="Ask Nietzsche...")
|
| 58 |
+
|
| 59 |
+
# Submit button
|
| 60 |
+
if st.button("Submit"):
|
| 61 |
+
if user_input.strip(): # Check if input is not empty
|
| 62 |
+
bot_response = chat_with_nietzsche(user_input)
|
| 63 |
+
st.session_state.history.append((user_input, bot_response))
|
| 64 |
+
st.experimental_rerun() # Refresh the app to display the new response
|
| 65 |
+
|
| 66 |
+
# Run the Streamlit app
|
| 67 |
+
if __name__ == "__main__":
|
| 68 |
+
main()
|