Spaces:
Running
Running
Commit
·
fa5195a
1
Parent(s):
9e67862
Limit Log Message Length
Browse files
st_app.py
CHANGED
@@ -37,15 +37,22 @@ def agent_progress_callback(status_type: AgentStatusType, msg: str):
|
|
37 |
return
|
38 |
|
39 |
st.session_state.status.update(label=latest_message)
|
40 |
-
max_log_msg_size =
|
41 |
with st.session_state.status:
|
42 |
for log_msg in st.session_state.log_messages:
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
@st.dialog(title="Agent logs", width='large')
|
46 |
def show_modal():
|
|
|
47 |
for log_msg in st.session_state.log_messages:
|
48 |
-
|
|
|
|
|
|
|
49 |
|
50 |
async def launch_bot():
|
51 |
def reset():
|
|
|
37 |
return
|
38 |
|
39 |
st.session_state.status.update(label=latest_message)
|
40 |
+
max_log_msg_size = 500
|
41 |
with st.session_state.status:
|
42 |
for log_msg in st.session_state.log_messages:
|
43 |
+
if len(log_msg) > max_log_msg_size:
|
44 |
+
st.markdown(log_msg[:max_log_msg_size]+'...', unsafe_allow_html=True)
|
45 |
+
else:
|
46 |
+
st.markdown(log_msg, unsafe_allow_html=True)
|
47 |
|
48 |
@st.dialog(title="Agent logs", width='large')
|
49 |
def show_modal():
|
50 |
+
max_log_msg_size = 500
|
51 |
for log_msg in st.session_state.log_messages:
|
52 |
+
if len(log_msg) > max_log_msg_size:
|
53 |
+
st.write(log_msg[:max_log_msg_size]+'...', unsafe_allow_html=True)
|
54 |
+
else:
|
55 |
+
st.write(log_msg, unsafe_allow_html=True)
|
56 |
|
57 |
async def launch_bot():
|
58 |
def reset():
|