Spaces:
Sleeping
Sleeping
Update app_web.py
Browse files231 unmodified lines232233234235236237238239240241242231 unmodified linesst.markdown(f"Please specify the value chain or investment area in {qinit_result.get('country', None)} for which you'd like to run a PERI analysis")returnqcat_result = categorize_query(combined_cat, cfg, history)print("result: ", qinit_result)except Exception:qinit_result = {"country": None, "value_chain": None, "investment": None}qcat_result = {"category": "pillar_1", "action": "unresolved"}print("unresolved: ", unresolved)print("result: ", qinit_result)print("combined: ", combined_cat)231 unmodified lines232233234235236237238239240241242243244245246247248249250251252253254255256257258259231 unmodified linesst.markdown(f"Please specify the value chain or investment area in {qinit_result.get('country', None)} for which you'd like to run a PERI analysis")returnqcat_result = categorize_query(combined_cat, cfg, history)print("result: ", qcat_result)except Exception:qinit_result = {"country": None, "value_chain": None, "investment": None}qcat_result = {"category": "pillar_1", "action": "unresolved"}pillar_dict = {"pillar_1":f"would like to understand whether {qinit_result.get("value_chain")} aligns with the government's political incentives.","pillar_2":f"would like to understand to what degree decisions are impacted by the lobbying of particular groups or by elite influence","pillar_3":f"would like to understand if {qinit_result.get("value_chain")} and/or investing in {qinit_result.get("investment")} can be feasibly implemented given the broader institutional and policy environment",}st.session_state.unresolved_category = original_query_catst.session_state.unresolved_category_question = f"Please let me know if you {' and '.join([pillar_dict[c] for c in qcat_result.get("category")])}."st.session_state.resolution_rounds += 1resolution_msg = f"**Before I search, could you clarify?** Please let me know if you {' and '.join([pillar_dict[c] for c in qcat_result.get("category")])}."st.session_state.messages.append({"role": "assistant", "content": resolution_msg})with st.chat_message("assistant"):st.markdown(resolution_msg)returnprint("unresolved: ", unresolved)print("result: ", qinit_result)print("combined: ", combined_cat)
app_web.py+18-1