Update app.py
Browse files
app.py
CHANGED
|
@@ -292,14 +292,26 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 292 |
# generate_audio()
|
| 293 |
|
| 294 |
|
| 295 |
-
on_audio = st.checkbox(':speaker:', key="speaker")
|
| 296 |
-
on_ref = st.checkbox('Reference', key="reference")
|
| 297 |
-
if on_audio:
|
| 298 |
-
|
|
|
|
|
|
|
|
|
|
| 299 |
|
| 300 |
-
if on_ref:
|
| 301 |
-
generate_pdf()
|
| 302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
|
| 304 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 305 |
|
|
|
|
| 292 |
# generate_audio()
|
| 293 |
|
| 294 |
|
| 295 |
+
# on_audio = st.checkbox(':speaker:', key="speaker")
|
| 296 |
+
# on_ref = st.checkbox('Reference', key="reference")
|
| 297 |
+
# if on_audio:
|
| 298 |
+
# generate_audio()
|
| 299 |
+
|
| 300 |
+
# if on_ref:
|
| 301 |
+
# generate_pdf()
|
| 302 |
|
|
|
|
|
|
|
| 303 |
|
| 304 |
+
if 'clicked' not in st.session_state:
|
| 305 |
+
st.session_state.clicked = False
|
| 306 |
+
|
| 307 |
+
def click_button():
|
| 308 |
+
st.session_state.clicked = True
|
| 309 |
+
|
| 310 |
+
st.button(':speaker:', on_click=click_button)
|
| 311 |
+
|
| 312 |
+
if st.session_state.clicked:
|
| 313 |
+
# The message and nested widget will remain on the page
|
| 314 |
+
generate_audio()
|
| 315 |
|
| 316 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 317 |
|