Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Text input for user to type messages
|
| 4 |
+
user_input = st.text_input("User Input")
|
| 5 |
+
|
| 6 |
+
# Text area to display chat history
|
| 7 |
+
chat_history = st.text_area("Chat History", "")
|
| 8 |
+
|
| 9 |
+
# Simple echo chatbot logic
|
| 10 |
+
def chatbot_response(user_input):
|
| 11 |
+
return "You said: " + user_input
|
| 12 |
+
|
| 13 |
+
# Get response from chatbot
|
| 14 |
+
if st.button("Send"):
|
| 15 |
+
response = chatbot_response(user_input)
|
| 16 |
+
chat_history += f"\nYou: {user_input}\nChatbot: {response}\n"
|
| 17 |
+
user_input = ""
|