Skip to content

Commit ecc8f41

Browse files
committed
WIP
1 parent ed82f3d commit ecc8f41

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

scripts/py/chat/streamlit-chat.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import streamlit as st
33

44
import requests
5-
import json, os
5+
import json
6+
import os
67
from pathlib import Path
78

89
from dotenv import load_dotenv
@@ -317,7 +318,8 @@ def copy_to_clipboard_component_v2(text_to_copy, button_label="Click to Copy (Th
317318
if "speech_speed_saved" not in st.session_state:
318319
try:
319320
st.session_state.speech_speed_saved = float(st.query_params.get("spd", 1.0))
320-
except:
321+
except (ValueError, TypeError) as e:
322+
print(f"Fehler beim Laden der speech_speed: {e}")
321323
st.session_state.speech_speed_saved = 1.0
322324

323325
speech_speed = st.slider("Geschwindigkeit", 0.5, 2.0,
@@ -644,12 +646,12 @@ def process_command(param):
644646
if st.session_state.get('scroll_trigger', 0) > 0:
645647
st.session_state.scroll_trigger = 0
646648
components.html(
647-
f"""
649+
"""
648650
<script>
649-
setTimeout(function() {{
651+
setTimeout(function() {
650652
var el = window.parent.document.querySelector('section.main');
651-
if(el) el.scrollTo({{top: el.scrollHeight, behavior: 'smooth'}});
652-
}}, 200);
653+
if(el) el.scrollTo({top: el.scrollHeight, behavior: 'smooth'});
654+
}, 200);
653655
</script>
654656
""",
655657
height=0,

0 commit comments

Comments
 (0)