NavyDevilDoc commited on
Commit
f21a4c7
·
verified ·
1 Parent(s): 7e43b15

Update src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +17 -17
src/app.py CHANGED
@@ -300,24 +300,24 @@ with tab2:
300
  # The token progress bar will be handled inside the prompt logic based on input length
301
 
302
  with c3:
303
- # --- NEW FEATURE: DOWNLOAD CHAT ---
304
- # Convert history to a readable string
305
- chat_log = ""
306
- for msg in st.session_state.messages:
307
- role = "USER" if msg['role'] == 'user' else "ASSISTANT"
308
- chat_log += f"[{role}]: {msg['content']}\n\n"
309
-
310
- # Only show button if there is history to save
311
- if chat_log:
312
- st.download_button(
313
- label="💾 Save Chat",
314
- data=chat_log,
315
- file_name="mission_log.txt",
316
- mime="text/plain",
317
- help="Download the current conversation history."
318
- )
319
 
320
- st.divider()
321
 
322
  # --- DISPLAY CONVERSATION HISTORY ---
323
  for message in st.session_state.messages:
 
300
  # The token progress bar will be handled inside the prompt logic based on input length
301
 
302
  with c3:
303
+ # --- NEW FEATURE: DOWNLOAD CHAT ---
304
+ # Convert history to a readable string
305
+ chat_log = ""
306
+ for msg in st.session_state.messages:
307
+ role = "USER" if msg['role'] == 'user' else "ASSISTANT"
308
+ chat_log += f"[{role}]: {msg['content']}\n\n"
309
+
310
+ # Only show button if there is history to save
311
+ if chat_log:
312
+ st.download_button(
313
+ label="💾 Save Chat",
314
+ data=chat_log,
315
+ file_name="mission_log.txt",
316
+ mime="text/plain",
317
+ help="Download the current conversation history."
318
+ )
319
 
320
+ st.divider()
321
 
322
  # --- DISPLAY CONVERSATION HISTORY ---
323
  for message in st.session_state.messages: