Spaces:
Sleeping
Sleeping
chat response
Browse files
app.py
CHANGED
|
@@ -380,14 +380,14 @@ def create_interface():
|
|
| 380 |
global message_store
|
| 381 |
|
| 382 |
if not message or not message.strip():
|
| 383 |
-
return chat_history, ""
|
| 384 |
|
| 385 |
# Format message for display with audio indicator if needed
|
| 386 |
display_message = message_store.add_message(message, audio_data)
|
| 387 |
|
| 388 |
# Add user message to history
|
| 389 |
chat_history.append((display_message, None))
|
| 390 |
-
yield chat_history, ""
|
| 391 |
|
| 392 |
try:
|
| 393 |
# Generate response
|
|
@@ -407,7 +407,7 @@ def create_interface():
|
|
| 407 |
error_msg = f"Error: {str(e)}"
|
| 408 |
chat_history[-1] = (display_message, error_msg)
|
| 409 |
yield chat_history, "", f"*{error_msg}*"
|
| 410 |
-
|
| 411 |
# Connect submit button
|
| 412 |
submit_btn.click(
|
| 413 |
chat_response,
|
|
|
|
| 380 |
global message_store
|
| 381 |
|
| 382 |
if not message or not message.strip():
|
| 383 |
+
return chat_history, "", "*Please enter a message*"
|
| 384 |
|
| 385 |
# Format message for display with audio indicator if needed
|
| 386 |
display_message = message_store.add_message(message, audio_data)
|
| 387 |
|
| 388 |
# Add user message to history
|
| 389 |
chat_history.append((display_message, None))
|
| 390 |
+
yield chat_history, "", "*Processing your request...*"
|
| 391 |
|
| 392 |
try:
|
| 393 |
# Generate response
|
|
|
|
| 407 |
error_msg = f"Error: {str(e)}"
|
| 408 |
chat_history[-1] = (display_message, error_msg)
|
| 409 |
yield chat_history, "", f"*{error_msg}*"
|
| 410 |
+
|
| 411 |
# Connect submit button
|
| 412 |
submit_btn.click(
|
| 413 |
chat_response,
|