Spaces:
Paused
Paused
Update app_web.py
Browse files- app_web.py +23 -22
app_web.py
CHANGED
|
@@ -179,6 +179,11 @@ def render_chat():
|
|
| 179 |
cat_cfg = cfg.get("query_categorization", {})
|
| 180 |
max_history = cat_cfg.get("max_history", 6)
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
# ββ Check if this is a clarification response βββββββββββββββββββ
|
| 183 |
unresolved = st.session_state.unresolved_category
|
| 184 |
if unresolved is not None:
|
|
@@ -273,23 +278,24 @@ def render_chat():
|
|
| 273 |
st.session_state.messages.append({"role": "user", "content": resolution_msg})
|
| 274 |
|
| 275 |
with st.chat_message("assistant"):
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
| 293 |
|
| 294 |
# ββ Check if this is a clarification response βββββββββββββββββββ
|
| 295 |
pending = st.session_state.pending_clarification
|
|
@@ -309,11 +315,6 @@ def render_chat():
|
|
| 309 |
original_query = prompt
|
| 310 |
st.session_state.clarification_rounds = 0
|
| 311 |
|
| 312 |
-
# ββ Query understanding βββββββββββββββββββββββββββββββββββββββββ
|
| 313 |
-
qu_cfg = cfg.get("query_understanding", {})
|
| 314 |
-
qu_enabled = qu_cfg.get("enabled", True)
|
| 315 |
-
max_history = qu_cfg.get("max_history", 6)
|
| 316 |
-
|
| 317 |
search_query = combined
|
| 318 |
display_query = combined
|
| 319 |
route = "vector"
|
|
|
|
| 179 |
cat_cfg = cfg.get("query_categorization", {})
|
| 180 |
max_history = cat_cfg.get("max_history", 6)
|
| 181 |
|
| 182 |
+
# ββ Query understanding βββββββββββββββββββββββββββββββββββββββββ
|
| 183 |
+
qu_cfg = cfg.get("query_understanding", {})
|
| 184 |
+
qu_enabled = qu_cfg.get("enabled", True)
|
| 185 |
+
max_history = qu_cfg.get("max_history", 6)
|
| 186 |
+
|
| 187 |
# ββ Check if this is a clarification response βββββββββββββββββββ
|
| 188 |
unresolved = st.session_state.unresolved_category
|
| 189 |
if unresolved is not None:
|
|
|
|
| 278 |
st.session_state.messages.append({"role": "user", "content": resolution_msg})
|
| 279 |
|
| 280 |
with st.chat_message("assistant"):
|
| 281 |
+
st.markdown(resolution_msg)
|
| 282 |
+
return
|
| 283 |
+
|
| 284 |
+
selection = qcat_result.get("sub-action", ["explain"])
|
| 285 |
+
if selection != "unresolved" or isinstance(selection, list):
|
| 286 |
+
qu_enabled = False
|
| 287 |
+
selected_options = [options.get(s) for s in selection]
|
| 288 |
+
opts = {
|
| 289 |
+
"rewrite": True if "rewrite" in selected_options else False,
|
| 290 |
+
"explain": True if "explain" in selected_options else False,
|
| 291 |
+
"suggestfix": True if "suggestfix" in selected_options else False,
|
| 292 |
+
# "capture": True if "capture" in selected_options else False,
|
| 293 |
+
# "verbose": True if "verbose" in selected_options else False,
|
| 294 |
+
"lines": None#lines if "lines" in selected_options else None
|
| 295 |
+
}
|
| 296 |
+
result = explain_(qcat_result.get("action"), combined_cat, cfg, file_path, opts)
|
| 297 |
+
st.session_state.messages.append({"role": "assistant", "content": result})
|
| 298 |
+
st.markdown(result)
|
| 299 |
|
| 300 |
# ββ Check if this is a clarification response βββββββββββββββββββ
|
| 301 |
pending = st.session_state.pending_clarification
|
|
|
|
| 315 |
original_query = prompt
|
| 316 |
st.session_state.clarification_rounds = 0
|
| 317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
search_query = combined
|
| 319 |
display_query = combined
|
| 320 |
route = "vector"
|