Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,8 @@ def chatbot_response(user_input, history):
|
|
| 11 |
bot_message += char
|
| 12 |
history.append((user_input, bot_message))
|
| 13 |
time.sleep(0.05) # Delay to simulate typing speed
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
# Gradio Interface Setup
|
| 17 |
def create_gradio_interface():
|
|
@@ -20,8 +21,7 @@ def create_gradio_interface():
|
|
| 20 |
gr.Markdown("Talk to the bot and customize your food preferences.")
|
| 21 |
|
| 22 |
# Conversation Box
|
| 23 |
-
|
| 24 |
-
pass
|
| 25 |
|
| 26 |
# User input field
|
| 27 |
user_input = gr.Textbox(placeholder="Type your message here...", lines=1)
|
|
|
|
| 11 |
bot_message += char
|
| 12 |
history.append((user_input, bot_message))
|
| 13 |
time.sleep(0.05) # Delay to simulate typing speed
|
| 14 |
+
# Instead of yielding, update history for chatbox
|
| 15 |
+
yield history
|
| 16 |
|
| 17 |
# Gradio Interface Setup
|
| 18 |
def create_gradio_interface():
|
|
|
|
| 21 |
gr.Markdown("Talk to the bot and customize your food preferences.")
|
| 22 |
|
| 23 |
# Conversation Box
|
| 24 |
+
chatbox = gr.Chatbot()
|
|
|
|
| 25 |
|
| 26 |
# User input field
|
| 27 |
user_input = gr.Textbox(placeholder="Type your message here...", lines=1)
|