Update src/streamlit_app.py
Browse files- src/streamlit_app.py +21 -1
src/streamlit_app.py
CHANGED
|
@@ -97,9 +97,27 @@ st.caption("Upload a PDF or use the sample file to explore intelligent document
|
|
| 97 |
# π§ Sidebar (Document Library + Settings + Diagnostics)
|
| 98 |
# ==========================================================
|
| 99 |
with st.sidebar:
|
|
|
|
| 100 |
if os.path.exists(LOGO_PATH):
|
| 101 |
st.image(LOGO_PATH, width=150)
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
st.header("π Document Library")
|
| 104 |
doc_choice = st.radio(
|
| 105 |
"Choose a document:",
|
|
@@ -109,12 +127,14 @@ with st.sidebar:
|
|
| 109 |
|
| 110 |
st.markdown("---")
|
| 111 |
|
|
|
|
| 112 |
st.header("βοΈ Settings")
|
| 113 |
-
reasoning_mode = st.toggle("π§ Enable Reasoning Mode", value=True)
|
| 114 |
chunk_size = st.slider("Chunk Size (characters)", 300, 1200, 800, step=100)
|
| 115 |
top_k = st.slider("Top K Results (retrieved chunks)", 1, 10, 5)
|
| 116 |
|
| 117 |
st.markdown("---")
|
|
|
|
|
|
|
| 118 |
st.caption("π¨βπ» Built by Shubham Sharma")
|
| 119 |
st.markdown("[π GitHub Repo](https://github.com/shubhamsharma170793-cpu/enterprise-knowledge-assistant)")
|
| 120 |
|
|
|
|
| 97 |
# π§ Sidebar (Document Library + Settings + Diagnostics)
|
| 98 |
# ==========================================================
|
| 99 |
with st.sidebar:
|
| 100 |
+
# πΌοΈ App Logo (if available)
|
| 101 |
if os.path.exists(LOGO_PATH):
|
| 102 |
st.image(LOGO_PATH, width=150)
|
| 103 |
|
| 104 |
+
# π§ Reasoning Mode Toggle (Persistent)
|
| 105 |
+
if "reasoning_mode" not in st.session_state:
|
| 106 |
+
st.session_state.reasoning_mode = True # Default ON
|
| 107 |
+
|
| 108 |
+
st.session_state.reasoning_mode = st.toggle(
|
| 109 |
+
"π§ Enable Reasoning Mode",
|
| 110 |
+
value=st.session_state.reasoning_mode,
|
| 111 |
+
help=(
|
| 112 |
+
"When ON, the assistant can use its world knowledge and reasoning ability "
|
| 113 |
+
"to generate richer, more explanatory answers.\n\n"
|
| 114 |
+
"When OFF, it sticks strictly to the document text for factual accuracy."
|
| 115 |
+
)
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
st.markdown("---")
|
| 119 |
+
|
| 120 |
+
# π Document Library
|
| 121 |
st.header("π Document Library")
|
| 122 |
doc_choice = st.radio(
|
| 123 |
"Choose a document:",
|
|
|
|
| 127 |
|
| 128 |
st.markdown("---")
|
| 129 |
|
| 130 |
+
# βοΈ Settings
|
| 131 |
st.header("βοΈ Settings")
|
|
|
|
| 132 |
chunk_size = st.slider("Chunk Size (characters)", 300, 1200, 800, step=100)
|
| 133 |
top_k = st.slider("Top K Results (retrieved chunks)", 1, 10, 5)
|
| 134 |
|
| 135 |
st.markdown("---")
|
| 136 |
+
|
| 137 |
+
# π¨βπ» Branding
|
| 138 |
st.caption("π¨βπ» Built by Shubham Sharma")
|
| 139 |
st.markdown("[π GitHub Repo](https://github.com/shubhamsharma170793-cpu/enterprise-knowledge-assistant)")
|
| 140 |
|