ofermend commited on
Commit
2baf34e
1 Parent(s): ac44fd4
Files changed (2) hide show
  1. requirements.txt +1 -1
  2. st_app.py +7 -3
requirements.txt CHANGED
@@ -6,4 +6,4 @@ streamlit_feedback==0.1.3
6
  uuid==1.30
7
  langdetect==1.0.9
8
  langcodes==3.4.0
9
- vectara-agentic==0.1.18
 
6
  uuid==1.30
7
  langdetect==1.0.9
8
  langcodes==3.4.0
9
+ vectara-agentic==0.1.19
st_app.py CHANGED
@@ -22,6 +22,10 @@ def show_example_questions():
22
  return True
23
  return False
24
 
 
 
 
 
25
  def agent_progress_callback(status_type: AgentStatusType, msg: str):
26
  output = f'<span style="color:blue;">{status_type.value}</span>: {msg}'
27
  st.session_state.log_messages.append(output)
@@ -37,15 +41,15 @@ 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 = 200
41
  with st.session_state.status:
42
  for log_msg in st.session_state.log_messages:
43
- st.markdown(log_msg[:max_log_msg_size]+'...', unsafe_allow_html=True)
44
 
45
  @st.dialog(title="Agent logs", width='large')
46
  def show_modal():
47
  for log_msg in st.session_state.log_messages:
48
- st.write(log_msg, unsafe_allow_html=True)
49
 
50
  async def launch_bot():
51
  def reset():
 
22
  return True
23
  return False
24
 
25
+ def format_log_msg(log_msg: str):
26
+ max_log_msg_size = 500
27
+ return log_msg if len(log_msg) <= max_log_msg_size else log_msg[:max_log_msg_size]+'...'
28
+
29
  def agent_progress_callback(status_type: AgentStatusType, msg: str):
30
  output = f'<span style="color:blue;">{status_type.value}</span>: {msg}'
31
  st.session_state.log_messages.append(output)
 
41
  return
42
 
43
  st.session_state.status.update(label=latest_message)
44
+
45
  with st.session_state.status:
46
  for log_msg in st.session_state.log_messages:
47
+ st.markdown(format_log_msg(log_msg), unsafe_allow_html=True)
48
 
49
  @st.dialog(title="Agent logs", width='large')
50
  def show_modal():
51
  for log_msg in st.session_state.log_messages:
52
+ st.markdown(format_log_msg(log_msg), unsafe_allow_html=True)
53
 
54
  async def launch_bot():
55
  def reset():