ofermend commited on
Commit
27dc7b0
1 Parent(s): ec17431

fix update_func

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -166,8 +166,9 @@ def initialize_agent(_cfg):
166
  """
167
 
168
  def update_func(status_type: AgentStatusType, msg: str):
169
- output = f"{status_type.value} - {msg}"
170
- st.session_state.log_messages.append(output)
 
171
 
172
  agent = Agent(
173
  tools=create_tools(_cfg),
@@ -256,7 +257,7 @@ def launch_bot():
256
  if st.session_state.show_logs:
257
  st.button("Hide Logs", on_click=toggle_logs)
258
  for msg in st.session_state.log_messages:
259
- st.write(msg)
260
  else:
261
  if len(st.session_state.log_messages) > 0:
262
  st.button("Show Logs", on_click=toggle_logs)
 
166
  """
167
 
168
  def update_func(status_type: AgentStatusType, msg: str):
169
+ if status_type != AgentStatusType.AGENT_UPDATE:
170
+ output = f"{status_type.value} - {msg}"
171
+ st.session_state.log_messages.append(output)
172
 
173
  agent = Agent(
174
  tools=create_tools(_cfg),
 
257
  if st.session_state.show_logs:
258
  st.button("Hide Logs", on_click=toggle_logs)
259
  for msg in st.session_state.log_messages:
260
+ st.text(msg)
261
  else:
262
  if len(st.session_state.log_messages) > 0:
263
  st.button("Show Logs", on_click=toggle_logs)