Update app.py
Browse files
app.py
CHANGED
|
@@ -272,9 +272,25 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 272 |
tts = gTTS(result['result'], lang='en')
|
| 273 |
tts.write_to_fp(sound_file)
|
| 274 |
st.audio(sound_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
|
| 276 |
-
|
| 277 |
-
st.button(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 279 |
|
| 280 |
|
|
|
|
| 272 |
tts = gTTS(result['result'], lang='en')
|
| 273 |
tts.write_to_fp(sound_file)
|
| 274 |
st.audio(sound_file)
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
#st.button(':speaker:', type='primary',on_click=generate_audio)
|
| 278 |
+
#st.button('Reference',type='primary',on_click=generate_pdf)
|
| 279 |
+
|
| 280 |
+
# Create placeholders for output
|
| 281 |
+
image_output = st.empty()
|
| 282 |
+
sound_output = st.empty()
|
| 283 |
|
| 284 |
+
# Create a button to display the image
|
| 285 |
+
if st.button(":Reference:"):
|
| 286 |
+
image_output.clear()
|
| 287 |
+
generate_pdf()
|
| 288 |
+
|
| 289 |
+
# Create a button to play the sound
|
| 290 |
+
if st.button(":speaker:"):
|
| 291 |
+
sound_output.clear()
|
| 292 |
+
generate_audio()
|
| 293 |
+
|
| 294 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 295 |
|
| 296 |
|