Nelly-43 commited on
Commit
79ad407
·
verified ·
1 Parent(s): 0fd3783

Update app_web.py

Browse files
Files changed (1) hide show
  1. app_web.py +4 -3
app_web.py CHANGED
@@ -215,7 +215,8 @@ def render_chat():
215
  qcat_result = categorize_query(combined_cat, cfg, history)
216
  except Exception:
217
  qcat_result = {"category": "general", "action": "continue"}
218
-
 
219
  if qcat_result.get("category") == "contact_and_info" and qcat_result.get("action") == "contact":
220
  with st.chat_message("assistant"):
221
  st.markdown("For additional assistance, please contact the WEAI Helpdesk at IFPRI-WEAI@cgiar.org.\
@@ -299,9 +300,9 @@ def render_chat():
299
  "lines": None#lines if "lines" in selected_options else None
300
  }
301
  explanation = explain_(qcat_result.get("action"), combined_cat, cfg, st.session_state.stata_file, opts)
302
- st.session_state.unresolved_category_question = f"{explanation}\n Please let me know if this answer is helpful or if it requires further clarification."
303
  st.session_state.resolution_rounds += 1
304
- resolution_msg = f"{explanation}\n Please let me know if this answer is helpful or if it requires further clarification."
305
  st.session_state.messages.append({"role": "assistant", "content": resolution_msg})
306
 
307
  with st.chat_message("assistant"):
 
215
  qcat_result = categorize_query(combined_cat, cfg, history)
216
  except Exception:
217
  qcat_result = {"category": "general", "action": "continue"}
218
+ print("query: \n", combined_cat)
219
+ print("Result: \n", qcat_result)
220
  if qcat_result.get("category") == "contact_and_info" and qcat_result.get("action") == "contact":
221
  with st.chat_message("assistant"):
222
  st.markdown("For additional assistance, please contact the WEAI Helpdesk at IFPRI-WEAI@cgiar.org.\
 
300
  "lines": None#lines if "lines" in selected_options else None
301
  }
302
  explanation = explain_(qcat_result.get("action"), combined_cat, cfg, st.session_state.stata_file, opts)
303
+ st.session_state.unresolved_category_question = f"{explanation}\n\n Please let me know if this answer is helpful or if it requires further clarification."
304
  st.session_state.resolution_rounds += 1
305
+ resolution_msg = f"{explanation}\n\n Please let me know if this answer is helpful or if it requires further clarification."
306
  st.session_state.messages.append({"role": "assistant", "content": resolution_msg})
307
 
308
  with st.chat_message("assistant"):