Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,10 +49,18 @@ def bot(chat_msg, history=None, audio_tts_checkbox=False):
|
|
49 |
stop=None,
|
50 |
)
|
51 |
bot_message = completion.choices[0].message.content
|
52 |
-
|
|
|
|
|
53 |
response_audio = audio_response(bot_message, voice="Sophia")
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
print(messages)
|
57 |
return "", messages, ""
|
58 |
except Exception as e:
|
|
|
49 |
stop=None,
|
50 |
)
|
51 |
bot_message = completion.choices[0].message.content
|
52 |
+
|
53 |
+
if audio_tts_checkbox=True:
|
54 |
+
print("AUDIO TTS CHECKBOY IS TURE!")
|
55 |
response_audio = audio_response(bot_message, voice="Sophia")
|
56 |
+
messages.append({"role": "assistant", "content": (gr.Audio(response_audio) if "Ein Fehler mit der GET_AUDIO_API" not in response_audio else bot_message)})
|
57 |
+
|
58 |
+
print("2. Messages:\n")
|
59 |
+
print(messages)
|
60 |
+
return "", messages, ""
|
61 |
+
|
62 |
+
messages.append({"role": "assistant", "content": bot_message})
|
63 |
+
print("3. Messages:\n")
|
64 |
print(messages)
|
65 |
return "", messages, ""
|
66 |
except Exception as e:
|