mgbam commited on
Commit
88d42c6
·
verified ·
1 Parent(s): 31dadea

Create workspace.py

Browse files
Files changed (1) hide show
  1. mcp/workspace.py +15 -0
mcp/workspace.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # mcp/workspace.py
2
+
3
+ import streamlit as st
4
+
5
+ def get_workspace():
6
+ # Use Streamlit session state for per-user saved searches
7
+ if "saved_queries" not in st.session_state:
8
+ st.session_state["saved_queries"] = []
9
+ return st.session_state["saved_queries"]
10
+
11
+ def save_query(query, result):
12
+ ws = get_workspace()
13
+ # Only keep the last 10 searches for simplicity
14
+ ws.insert(0, {"query": query, "result": result})
15
+ ws[:] = ws[:10] # Cap at 10