tirtho149 commited on
Commit
9d6a444
·
verified ·
1 Parent(s): 63af2a9

Deploy SyndemicGPS HealthBot — geography-conditioned syndemic reasoning

Browse files
Files changed (2) hide show
  1. app.py +5 -1
  2. syndemic/ops.py +1 -1
app.py CHANGED
@@ -328,7 +328,11 @@ def bot_turn(history: list, st: E.State, writer: str, parser: str,
328
  rows[6].update(state="done", r=st.tier().upper())
329
 
330
  header = f"**{result.title}**\n\n" if result.title else ""
331
- tail = "\n\n".join(x for x in [result.body, ops._md_sources(result.passages),
 
 
 
 
332
  panels.trace_md(result.trace)] if x)
333
  if result.passages:
334
  rows[2]["r"] = (rows[2]["r"] or "") + f" + {len(result.passages)} passages"
 
328
  rows[6].update(state="done", r=st.tier().upper())
329
 
330
  header = f"**{result.title}**\n\n" if result.title else ""
331
+ # The prose is the answer. The structured listing is the working — kept for
332
+ # inspection, folded away so it stops competing with what the person asked.
333
+ working = (f"<details><summary>Show the working</summary>\n\n{result.body}\n</details>"
334
+ if result.body else "")
335
+ tail = "\n\n".join(x for x in [working, ops._md_sources(result.passages),
336
  panels.trace_md(result.trace)] if x)
337
  if result.passages:
338
  rows[2]["r"] = (rows[2]["r"] or "") + f" + {len(result.passages)} passages"
syndemic/ops.py CHANGED
@@ -337,7 +337,7 @@ def _md_plan(items: List[Dict[str, Any]], name: str, other: Optional[List[Dict[s
337
  lines = [f"**{name}**"]
338
  for i, it in enumerate(items[:E.TOP]):
339
  uniq = " · *only here*" if other_ids is not None and it["id"] not in other_ids else ""
340
- ctxline = it["geo_why"][0] if it["geo_why"] else "no gated contextual factor applied"
341
  lines.append(f"{i+1}. **{it['lab']}** `{it['tier']}`{uniq} \n <sub>{ctxline}</sub>")
342
  return "\n".join(lines)
343
 
 
337
  lines = [f"**{name}**"]
338
  for i, it in enumerate(items[:E.TOP]):
339
  uniq = " · *only here*" if other_ids is not None and it["id"] not in other_ids else ""
340
+ ctxline = it["geo_why"][0] if it["geo_why"] else "nothing local changed this one"
341
  lines.append(f"{i+1}. **{it['lab']}** `{it['tier']}`{uniq} \n <sub>{ctxline}</sub>")
342
  return "\n".join(lines)
343