Update dashboard/logs.py
Browse files- dashboard/logs.py +9 -3
dashboard/logs.py
CHANGED
@@ -1,11 +1,17 @@
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
def show_logs():
|
6 |
st.header("π Agent Memory Logs")
|
7 |
-
conn =
|
8 |
df = pd.read_sql("SELECT * FROM agent_logs ORDER BY timestamp DESC", conn)
|
|
|
9 |
st.dataframe(df)
|
10 |
csv = df.to_csv(index=False).encode()
|
11 |
-
st.download_button("π₯ Download Logs
|
|
|
1 |
+
# dashboard/logs.py
|
2 |
+
|
3 |
import streamlit as st
|
4 |
import pandas as pd
|
5 |
+
import os
|
6 |
+
import sqlite3
|
7 |
+
|
8 |
+
DB_PATH = os.path.join("/tmp", "memory.db")
|
9 |
|
10 |
def show_logs():
|
11 |
st.header("π Agent Memory Logs")
|
12 |
+
conn = sqlite3.connect(DB_PATH)
|
13 |
df = pd.read_sql("SELECT * FROM agent_logs ORDER BY timestamp DESC", conn)
|
14 |
+
conn.close()
|
15 |
st.dataframe(df)
|
16 |
csv = df.to_csv(index=False).encode()
|
17 |
+
st.download_button("π₯ Download Logs", csv, "logs.csv")
|