Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -120,7 +120,7 @@ def main():
|
|
| 120 |
</style>
|
| 121 |
""", unsafe_allow_html=True)
|
| 122 |
|
| 123 |
-
dynamic_question = "No question generated yet."
|
| 124 |
|
| 125 |
if "chat_history" not in st.session_state:
|
| 126 |
st.session_state['chat_history'] = []
|
|
@@ -172,27 +172,27 @@ def main():
|
|
| 172 |
|
| 173 |
st.session_state['chat_history'] = [(sender, msg, "old") for sender, msg, _ in st.session_state['chat_history']]
|
| 174 |
|
| 175 |
-
# JavaScript for handling question box clicks
|
| 176 |
-
st.markdown("""
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
""".format(dynamic_question), unsafe_allow_html=True)
|
| 196 |
|
| 197 |
if __name__ == "__main__":
|
| 198 |
main()
|
|
|
|
| 120 |
</style>
|
| 121 |
""", unsafe_allow_html=True)
|
| 122 |
|
| 123 |
+
dynamic_question = "No question generated yet." # Initialize the variable here
|
| 124 |
|
| 125 |
if "chat_history" not in st.session_state:
|
| 126 |
st.session_state['chat_history'] = []
|
|
|
|
| 172 |
|
| 173 |
st.session_state['chat_history'] = [(sender, msg, "old") for sender, msg, _ in st.session_state['chat_history']]
|
| 174 |
|
| 175 |
+
# JavaScript for handling question box clicks
|
| 176 |
+
st.markdown("""
|
| 177 |
+
<script>
|
| 178 |
+
document.getElementById('question1').onclick = function() {
|
| 179 |
+
document.querySelector('input').value = 'Was genau ist ein Belegarzt?';
|
| 180 |
+
document.querySelector('input').dispatchEvent(new Event('change'));
|
| 181 |
+
};
|
| 182 |
+
document.getElementById('question2').onclick = function() {
|
| 183 |
+
document.querySelector('input').value = 'Wofür wird die Alpha-ID verwendet?';
|
| 184 |
+
document.querySelector('input').dispatchEvent(new Event('change'));
|
| 185 |
+
};
|
| 186 |
+
document.getElementById('question3').onclick = function() {
|
| 187 |
+
document.querySelector('input').value = 'Was sind die Vorteile des ambulanten operierens?';
|
| 188 |
+
document.querySelector('input').dispatchEvent(new Event('change'));
|
| 189 |
+
};
|
| 190 |
+
document.getElementById('question4').onclick = function() {
|
| 191 |
+
document.querySelector('input').value = 'AI Generated Question: ' + '{0}';
|
| 192 |
+
document.querySelector('input').dispatchEvent(new Event('change'));
|
| 193 |
+
};
|
| 194 |
+
</script>
|
| 195 |
+
""".format(dynamic_question), unsafe_allow_html=True)
|
| 196 |
|
| 197 |
if __name__ == "__main__":
|
| 198 |
main()
|