TradingGameAI / formatting.py
j-js's picture
Create formatting.py
dd561c8 verified
raw
history blame contribute delete
873 Bytes
from __future__ import annotations
def style_prefix(tone: float) -> str:
if tone < 0.33:
return "Let’s solve it efficiently."
if tone < 0.66:
return "Let’s work through it."
return "You’ve got this — let’s solve it cleanly."
def format_reply(core: str, tone: float, verbosity: float, transparency: float, help_mode: str) -> str:
prefix = style_prefix(tone)
if help_mode == "hint":
if transparency < 0.4:
return f"{prefix}\n\nHint: {core}"
return f"{prefix}\n\nHint:\n{core}"
if help_mode == "walkthrough":
if verbosity < 0.35:
return f"{prefix}\n\n{core}"
return f"{prefix}\n\nWalkthrough:\n{core}"
if verbosity < 0.33:
return f"{prefix}\n\n{core}"
if transparency >= 0.5:
return f"{prefix}\n\n{core}"
return f"{prefix}\n\n{core}"