Adoption commited on
Commit
b6d7af1
Β·
verified Β·
1 Parent(s): 7a274fe

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +25 -12
src/streamlit_app.py CHANGED
@@ -106,16 +106,29 @@ st.markdown("""
106
 
107
  </style>
108
  """, unsafe_allow_html=True)
109
-
110
- # --- 4. SIDEBAR ---
111
- with st.sidebar:
112
- st.markdown("## πŸ¦… Settings")
113
- mode = st.radio("Choose Mode:", ["πŸ—£οΈ Chat with Bro. Branham", "πŸ” Search Quotes Only"])
114
- st.divider()
115
- if st.button("πŸ—‘οΈ Start New Conversation", use_container_width=True):
 
 
 
 
 
 
 
 
 
 
 
116
  st.session_state.messages = []
117
  st.rerun()
118
 
 
 
119
  # --- 5. INITIALIZE STATE ---
120
  if "messages" not in st.session_state: st.session_state.messages = []
121
 
@@ -125,17 +138,17 @@ def load_system():
125
  if backend_loaded: return get_rag_chain()
126
  return None
127
 
128
- # --- 7. HEADER ---
129
- if mode.startswith("πŸ—£οΈ"):
130
- st.markdown("<h1 style='text-align: center;'>πŸ¦… The 7th Handle</h1>", unsafe_allow_html=True)
131
  st.caption("Interactive AI Archive β€’ Ask any question")
132
  else:
133
- st.markdown("<h1 style='text-align: center;'>πŸ” The Table</h1>", unsafe_allow_html=True)
134
  st.caption("Direct Quote Search β€’ Search the tapes")
135
 
136
  if not backend_loaded: st.stop()
137
 
138
- # --- 8. CHAT LOGIC ---
139
  if mode.startswith("πŸ—£οΈ"):
140
  # Initial Greeting
141
  if not st.session_state.messages:
 
106
 
107
  </style>
108
  """, unsafe_allow_html=True)
109
+ # ... (Keep Sections 1, 2, and 3 exactly as they are) ...
110
+
111
+ # --- 4. NAVIGATION & SETTINGS (Moved to Main Page) ---
112
+ # We use columns to make it look neat on mobile
113
+ col1, col2 = st.columns([3, 1])
114
+
115
+ with col1:
116
+ # Mode Selection - Horizontal for better mobile layout
117
+ mode = st.radio(
118
+ "Select Mode:",
119
+ ["πŸ—£οΈ Chat with Bro. Branham", "πŸ” Search Quotes Only"],
120
+ horizontal=True,
121
+ label_visibility="collapsed" # Hides the label to save space
122
+ )
123
+
124
+ with col2:
125
+ # A discreet 'Reset' button nicely aligned to the right
126
+ if st.button("πŸ”„ Reset", help="Start a new conversation", use_container_width=True):
127
  st.session_state.messages = []
128
  st.rerun()
129
 
130
+ st.divider()
131
+
132
  # --- 5. INITIALIZE STATE ---
133
  if "messages" not in st.session_state: st.session_state.messages = []
134
 
 
138
  if backend_loaded: return get_rag_chain()
139
  return None
140
 
141
+ # --- 7. HEADER (Dynamic based on Mode) ---
142
+ if mode == "πŸ—£οΈ Chat with Bro. Branham":
143
+ st.markdown("<h2 style='text-align: center;'>πŸ¦… The 7th Handle</h2>", unsafe_allow_html=True)
144
  st.caption("Interactive AI Archive β€’ Ask any question")
145
  else:
146
+ st.markdown("<h2 style='text-align: center;'>πŸ” The Table</h2>", unsafe_allow_html=True)
147
  st.caption("Direct Quote Search β€’ Search the tapes")
148
 
149
  if not backend_loaded: st.stop()
150
 
151
+ # --- 8. CHAT LOGIC ---.
152
  if mode.startswith("πŸ—£οΈ"):
153
  # Initial Greeting
154
  if not st.session_state.messages: