Spaces:
Running
Running
fix update_func
Browse files
app.py
CHANGED
|
@@ -51,8 +51,9 @@ def initialize_agent(_cfg):
|
|
| 51 |
"""
|
| 52 |
|
| 53 |
def update_func(status_type: AgentStatusType, msg: str):
|
| 54 |
-
|
| 55 |
-
|
|
|
|
| 56 |
|
| 57 |
agent = Agent(
|
| 58 |
tools=create_tools(_cfg),
|
|
@@ -142,7 +143,7 @@ def launch_bot():
|
|
| 142 |
if st.session_state.show_logs:
|
| 143 |
st.button("Hide Logs", on_click=toggle_logs)
|
| 144 |
for msg in st.session_state.log_messages:
|
| 145 |
-
st.
|
| 146 |
else:
|
| 147 |
if len(st.session_state.log_messages) > 0:
|
| 148 |
st.button("Show Logs", on_click=toggle_logs)
|
|
|
|
| 51 |
"""
|
| 52 |
|
| 53 |
def update_func(status_type: AgentStatusType, msg: str):
|
| 54 |
+
if status_type != AgentStatusType.AGENT_UPDATE:
|
| 55 |
+
output = f"{status_type.value} - {msg}"
|
| 56 |
+
st.session_state.log_messages.append(output)
|
| 57 |
|
| 58 |
agent = Agent(
|
| 59 |
tools=create_tools(_cfg),
|
|
|
|
| 143 |
if st.session_state.show_logs:
|
| 144 |
st.button("Hide Logs", on_click=toggle_logs)
|
| 145 |
for msg in st.session_state.log_messages:
|
| 146 |
+
st.text(msg)
|
| 147 |
else:
|
| 148 |
if len(st.session_state.log_messages) > 0:
|
| 149 |
st.button("Show Logs", on_click=toggle_logs)
|