Spaces:
Sleeping
Sleeping
Commit
·
e5576ba
1
Parent(s):
ba4186b
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ def get_bot_response(user_input, user_id):
|
|
15 |
# Define Gradio interface
|
16 |
def chat_interface(user_id):
|
17 |
chat_history = []
|
18 |
-
chatbot = gr.Chatbot(get_bot_response
|
19 |
|
20 |
# Define function to handle user input and bot response
|
21 |
def chat(input_text):
|
22 |
# Add user input to chat history
|
23 |
chat_history.append(("You", input_text))
|
24 |
# Get bot response and add to chat history
|
25 |
-
bot_response = chatbot.get_response(input_text)
|
26 |
chat_history.append(("Bot", bot_response))
|
27 |
# Format chat history as string
|
28 |
chat_history_str = "\n".join([f"{name}: {msg}" for name, msg in chat_history])
|
|
|
15 |
# Define Gradio interface
|
16 |
def chat_interface(user_id):
|
17 |
chat_history = []
|
18 |
+
chatbot = gr.Chatbot(get_bot_response)
|
19 |
|
20 |
# Define function to handle user input and bot response
|
21 |
def chat(input_text):
|
22 |
# Add user input to chat history
|
23 |
chat_history.append(("You", input_text))
|
24 |
# Get bot response and add to chat history
|
25 |
+
bot_response = chatbot.get_response(input_text, user_id=user_id)
|
26 |
chat_history.append(("Bot", bot_response))
|
27 |
# Format chat history as string
|
28 |
chat_history_str = "\n".join([f"{name}: {msg}" for name, msg in chat_history])
|