Zekun Wu commited on
Commit
b6e7533
1 Parent(s): a60d2b1
Files changed (1) hide show
  1. app.py +60 -37
app.py CHANGED
@@ -271,12 +271,12 @@ def sidebar_components():
271
  question_templates = [
272
  "What are the main risks associated with {}’s profile?",
273
  "What are the implications of {}’s profile for working with others?",
274
- "What conclusions might we draw from his profile about {}’s style of leadership?",
275
- "Looking specifically at {}'s Red Flags, are there any particular areas of concern?",
276
- "Based on this profile, is {} better suited as a COO or a CEO?",
277
- "If speed of execution is important, based on his profile, how likely is {} to be able to achieve this?",
278
- "How is {} likely to react to business uncertainty and disruption?",
279
- "Based on his profile, what should a coaching plan designed for {} focus on?"
280
  ]
281
 
282
  # Formatting each question template with the name
@@ -308,38 +308,61 @@ def sidebar_components():
308
 
309
  st.sidebar.markdown(response)
310
 
311
-
312
- # Display the sidebar components based on the state
313
- if 'show_chat' not in st.session_state:
314
- st.session_state['show_chat'] = None
315
-
316
- if 'definition' not in st.session_state:
317
- st.session_state['definition'] = 1
318
-
319
- if 'chat_context' not in st.session_state:
320
- st.session_state['chat_context'] = "analysis"
321
-
322
- if 'profile' not in st.session_state:
323
- st.session_state['profile'] = None
324
-
325
- if 'analysis' not in st.session_state:
326
- st.session_state['analysis'] = None
327
-
328
- if 'temperature' not in st.session_state:
329
- st.session_state['temperature'] = 0
330
-
331
- if 'version' not in st.session_state:
332
- st.session_state['version'] = ""
333
-
334
- # Initialize session state for username, password, and authentication
335
- if 'username' not in st.session_state:
336
- st.session_state['username'] = ''
337
- if 'password' not in st.session_state:
338
- st.session_state['password'] = ''
339
- if 'authenticated' not in st.session_state:
340
- st.session_state['authenticated'] = False
341
- # Show login or main app based on authentication
342
  if st.session_state['authenticated']:
343
  main_app()
344
  else:
345
  login_page()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  question_templates = [
272
  "What are the main risks associated with {}’s profile?",
273
  "What are the implications of {}’s profile for working with others?",
274
+ # "What conclusions might we draw from his profile about {}’s style of leadership?",
275
+ # "Looking specifically at {}'s Red Flags, are there any particular areas of concern?",
276
+ # "Based on this profile, is {} better suited as a COO or a CEO?",
277
+ # "If speed of execution is important, based on his profile, how likely is {} to be able to achieve this?",
278
+ # "How is {} likely to react to business uncertainty and disruption?",
279
+ # "Based on his profile, what should a coaching plan designed for {} focus on?"
280
  ]
281
 
282
  # Formatting each question template with the name
 
308
 
309
  st.sidebar.markdown(response)
310
 
311
+ # Initialize session state variables with default values if not already set
312
+ session_defaults = {
313
+ 'show_chat': None,
314
+ 'definition': 1,
315
+ 'chat_context': "analysis",
316
+ 'profile': None,
317
+ 'analysis': None,
318
+ 'temperature': 0,
319
+ 'version': "",
320
+ 'username': '',
321
+ 'password': '',
322
+ 'authenticated': False
323
+ }
324
+
325
+ for key, default in session_defaults.items():
326
+ if key not in st.session_state:
327
+ st.session_state[key] = default
328
+
329
+ # Show login or main app based on authentication status
 
 
 
 
 
 
 
 
 
 
 
 
330
  if st.session_state['authenticated']:
331
  main_app()
332
  else:
333
  login_page()
334
+
335
+ # # Display the sidebar components based on the state
336
+ # if 'show_chat' not in st.session_state:
337
+ # st.session_state['show_chat'] = None
338
+ #
339
+ # if 'definition' not in st.session_state:
340
+ # st.session_state['definition'] = 1
341
+ #
342
+ # if 'chat_context' not in st.session_state:
343
+ # st.session_state['chat_context'] = "analysis"
344
+ #
345
+ # if 'profile' not in st.session_state:
346
+ # st.session_state['profile'] = None
347
+ #
348
+ # if 'analysis' not in st.session_state:
349
+ # st.session_state['analysis'] = None
350
+ #
351
+ # if 'temperature' not in st.session_state:
352
+ # st.session_state['temperature'] = 0
353
+ #
354
+ # if 'version' not in st.session_state:
355
+ # st.session_state['version'] = ""
356
+ #
357
+ # # Initialize session state for username, password, and authentication
358
+ # if 'username' not in st.session_state:
359
+ # st.session_state['username'] = ''
360
+ # if 'password' not in st.session_state:
361
+ # st.session_state['password'] = ''
362
+ # if 'authenticated' not in st.session_state:
363
+ # st.session_state['authenticated'] = False
364
+ # # Show login or main app based on authentication
365
+ # if st.session_state['authenticated']:
366
+ # main_app()
367
+ # else:
368
+ # login_page()