Update conversation_logic.py
Browse files- conversation_logic.py +0 -54
conversation_logic.py
CHANGED
|
@@ -320,60 +320,6 @@ def is_explainer_request(text: str) -> bool:
|
|
| 320 |
return any(p in t for p in triggers)
|
| 321 |
|
| 322 |
|
| 323 |
-
def _compose_explainer_reply(
|
| 324 |
-
result: ExplainerResult,
|
| 325 |
-
verbosity: float,
|
| 326 |
-
transparency: float,
|
| 327 |
-
) -> str:
|
| 328 |
-
lines: List[str] = []
|
| 329 |
-
|
| 330 |
-
if result.plain_english:
|
| 331 |
-
lines.append(result.plain_english)
|
| 332 |
-
|
| 333 |
-
if result.asks_for:
|
| 334 |
-
if transparency >= 0.35:
|
| 335 |
-
lines.append(f"\nThe question is asking for: {result.asks_for}")
|
| 336 |
-
|
| 337 |
-
if result.givens:
|
| 338 |
-
if verbosity >= 0.45:
|
| 339 |
-
lines.append("\nWhat the question gives you:")
|
| 340 |
-
for g in result.givens[:5]:
|
| 341 |
-
lines.append(f"- {g}")
|
| 342 |
-
|
| 343 |
-
if result.constraints:
|
| 344 |
-
if verbosity >= 0.65:
|
| 345 |
-
lines.append("\nConstraints or conditions:")
|
| 346 |
-
for c in result.constraints[:5]:
|
| 347 |
-
lines.append(f"- {c}")
|
| 348 |
-
|
| 349 |
-
if result.relationships:
|
| 350 |
-
if transparency >= 0.45:
|
| 351 |
-
lines.append("\nKey relationship:")
|
| 352 |
-
for r in result.relationships[:4]:
|
| 353 |
-
lines.append(f"- {r}")
|
| 354 |
-
|
| 355 |
-
if result.needed_concepts:
|
| 356 |
-
if transparency >= 0.5:
|
| 357 |
-
lines.append("\nConcepts you will probably need:")
|
| 358 |
-
for c in result.needed_concepts[:4]:
|
| 359 |
-
lines.append(f"- {c}")
|
| 360 |
-
|
| 361 |
-
if result.trap_notes:
|
| 362 |
-
if transparency >= 0.55 or verbosity >= 0.7:
|
| 363 |
-
lines.append("\nWatch out for:")
|
| 364 |
-
for t in result.trap_notes[:4]:
|
| 365 |
-
lines.append(f"- {t}")
|
| 366 |
-
|
| 367 |
-
if result.strategy_hint:
|
| 368 |
-
if verbosity >= 0.35:
|
| 369 |
-
lines.append(f"\nBest starting move: {result.strategy_hint}")
|
| 370 |
-
|
| 371 |
-
if not lines:
|
| 372 |
-
return "I can help explain what the question is asking, but I need the full wording of the question."
|
| 373 |
-
|
| 374 |
-
return "\n".join(lines).strip()
|
| 375 |
-
|
| 376 |
-
|
| 377 |
def _normalize_text(text: str) -> str:
|
| 378 |
return re.sub(r"\s+", " ", (text or "").strip().lower())
|
| 379 |
|
|
|
|
| 320 |
return any(p in t for p in triggers)
|
| 321 |
|
| 322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
def _normalize_text(text: str) -> str:
|
| 324 |
return re.sub(r"\s+", " ", (text or "").strip().lower())
|
| 325 |
|