Nelly-43 commited on
Commit
143ed5d
Β·
verified Β·
1 Parent(s): afa3fa6

Update app_web.py

Browse files
Files changed (1) hide show
  1. app_web.py +5 -2
app_web.py CHANGED
@@ -46,6 +46,8 @@ def init_session():
46
  st.session_state.pending_clarification_question = None
47
  if "unresolved_category_question" not in st.session_state:
48
  st.session_state.unresolved_category_question = None
 
 
49
 
50
 
51
  # ── Sidebar ──────────────────────────────────────────────────────────────────
@@ -271,7 +273,8 @@ def render_chat():
271
  if qcat_result.get("action") == "error":
272
  options = {"explain the error":"explain",
273
  "suggest fix(es) for the error":"suggestfix"}
274
-
 
275
  st.session_state.unresolved_category_question = f"Please let me know what you need help with: {' or '.join(options.keys())}. List all options that apply."
276
  st.session_state.resolution_rounds += 1
277
  resolution_msg = f"**Before I search, could you clarify?** Please let me know what you need help with: {' or '.join(options.keys())}. List all options that apply."
@@ -285,7 +288,7 @@ def render_chat():
285
  print("selection: ", selection)
286
  if selection != "unresolved" or isinstance(selection, list):
287
  qu_enabled = False
288
- selected_options = [options.get(s) for s in selection]
289
  opts = {
290
  "rewrite": True if "rewrite" in selected_options else False,
291
  "explain": True if "explain" in selected_options else False,
 
46
  st.session_state.pending_clarification_question = None
47
  if "unresolved_category_question" not in st.session_state:
48
  st.session_state.unresolved_category_question = None
49
+ if "stata_options" not in st.session_state:
50
+ st.session_state.stata_options = None
51
 
52
 
53
  # ── Sidebar ──────────────────────────────────────────────────────────────────
 
273
  if qcat_result.get("action") == "error":
274
  options = {"explain the error":"explain",
275
  "suggest fix(es) for the error":"suggestfix"}
276
+
277
+ st.session_state.stata_options = options
278
  st.session_state.unresolved_category_question = f"Please let me know what you need help with: {' or '.join(options.keys())}. List all options that apply."
279
  st.session_state.resolution_rounds += 1
280
  resolution_msg = f"**Before I search, could you clarify?** Please let me know what you need help with: {' or '.join(options.keys())}. List all options that apply."
 
288
  print("selection: ", selection)
289
  if selection != "unresolved" or isinstance(selection, list):
290
  qu_enabled = False
291
+ selected_options = [st.session_state.stata_options.get(s) for s in selection]
292
  opts = {
293
  "rewrite": True if "rewrite" in selected_options else False,
294
  "explain": True if "explain" in selected_options else False,