Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,8 +93,13 @@ def text_to_speech(text):
|
|
| 93 |
|
| 94 |
# Wrap groq_chatbot so it also clears audio on new input
|
| 95 |
def chatbot_with_audio(input_text, chat_history):
|
| 96 |
-
chat_history, cleared_msg = groq_chatbot(input_text, chat_history)
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
def on_tts_click(chat_history):
|
| 100 |
if chat_history and chat_history[-1][1]:
|
|
|
|
| 93 |
|
| 94 |
# Wrap groq_chatbot so it also clears audio on new input
|
| 95 |
def chatbot_with_audio(input_text, chat_history):
|
| 96 |
+
chat_history, cleared_msg, _ = groq_chatbot(input_text, chat_history)
|
| 97 |
+
new_history = []
|
| 98 |
+
for user_msg, bot_msg in chat_history:
|
| 99 |
+
new_history.append({"role": "user", "content": user_msg})
|
| 100 |
+
new_history.append({"role": "assistant", "content": bot_msg})
|
| 101 |
+
return new_history, cleared_msg, None
|
| 102 |
+
|
| 103 |
|
| 104 |
def on_tts_click(chat_history):
|
| 105 |
if chat_history and chat_history[-1][1]:
|