updated chat_interface
Browse files
app.py
CHANGED
@@ -18,10 +18,16 @@ async def chat_interface(message, history):
|
|
18 |
updated_history = await bot(history + [(message, None)])
|
19 |
bot_response = updated_history[-1][1]
|
20 |
|
|
|
|
|
|
|
21 |
# Ensure the bot response is a string
|
22 |
if isinstance(bot_response, list):
|
23 |
bot_response = " ".join(bot_response)
|
24 |
|
|
|
|
|
|
|
25 |
return bot_response, updated_history
|
26 |
except Exception as e:
|
27 |
logger.error(f"Error in chat_interface: {str(e)}")
|
|
|
18 |
updated_history = await bot(history + [(message, None)])
|
19 |
bot_response = updated_history[-1][1]
|
20 |
|
21 |
+
# Debugging: Print the bot response
|
22 |
+
print(f"Bot response: {bot_response}")
|
23 |
+
|
24 |
# Ensure the bot response is a string
|
25 |
if isinstance(bot_response, list):
|
26 |
bot_response = " ".join(bot_response)
|
27 |
|
28 |
+
# Debugging: Print the formatted bot response
|
29 |
+
print(f"Formatted bot response: {bot_response}")
|
30 |
+
|
31 |
return bot_response, updated_history
|
32 |
except Exception as e:
|
33 |
logger.error(f"Error in chat_interface: {str(e)}")
|