updatd chat
Browse files- bot/chat.py +3 -2
bot/chat.py
CHANGED
|
@@ -114,11 +114,12 @@ async def bot(history):
|
|
| 114 |
logger.info(f"Corrected message: {corrected_message}")
|
| 115 |
|
| 116 |
# Update the history correctly
|
| 117 |
-
|
|
|
|
| 118 |
except Exception as e:
|
| 119 |
logger.error(f"Error in bot function: {str(e)}")
|
| 120 |
burner_error_message = (
|
| 121 |
"Yikes! The playa winds are strong today, and it seems our connection got a bit dusty. "
|
| 122 |
"But don't worry, let's give it another go! Radical self-expression, right?"
|
| 123 |
)
|
| 124 |
-
return history + [(
|
|
|
|
| 114 |
logger.info(f"Corrected message: {corrected_message}")
|
| 115 |
|
| 116 |
# Update the history correctly
|
| 117 |
+
new_history = history[:-1] + [(history[-1][0], corrected_message)]
|
| 118 |
+
return new_history
|
| 119 |
except Exception as e:
|
| 120 |
logger.error(f"Error in bot function: {str(e)}")
|
| 121 |
burner_error_message = (
|
| 122 |
"Yikes! The playa winds are strong today, and it seems our connection got a bit dusty. "
|
| 123 |
"But don't worry, let's give it another go! Radical self-expression, right?"
|
| 124 |
)
|
| 125 |
+
return history + [(history[-1][0], burner_error_message)]
|