ofermend commited on
Commit
d015953
1 Parent(s): ed18c6a

fix update_func

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -123,8 +123,9 @@ def initialize_agent(_cfg):
123
  """
124
 
125
  def update_func(status_type: AgentStatusType, msg: str):
126
- output = f"{status_type.value} - {msg}"
127
- st.session_state.log_messages.append(output)
 
128
 
129
  agent = Agent(
130
  tools=create_tools(_cfg),
@@ -218,7 +219,7 @@ def launch_bot():
218
  if st.session_state.show_logs:
219
  st.button("Hide Logs", on_click=toggle_logs)
220
  for msg in st.session_state.log_messages:
221
- st.write(msg)
222
  else:
223
  if len(st.session_state.log_messages) > 0:
224
  st.button("Show Logs", on_click=toggle_logs)
 
123
  """
124
 
125
  def update_func(status_type: AgentStatusType, msg: str):
126
+ if status_type != AgentStatusType.AGENT_UPDATE:
127
+ output = f"{status_type.value} - {msg}"
128
+ st.session_state.log_messages.append(output)
129
 
130
  agent = Agent(
131
  tools=create_tools(_cfg),
 
219
  if st.session_state.show_logs:
220
  st.button("Hide Logs", on_click=toggle_logs)
221
  for msg in st.session_state.log_messages:
222
+ st.text(msg)
223
  else:
224
  if len(st.session_state.log_messages) > 0:
225
  st.button("Show Logs", on_click=toggle_logs)