Compress character helper fact output

This commit is contained in:
2026-08-14 13:55:42 +00:00
parent 7d4ab8fdd4
commit 24baee44e1
3 changed files with 14 additions and 26 deletions
+12 -17
View File
@@ -360,33 +360,28 @@ def _build_character_helper_text(
f"<Picture {secondary_picture}> is a frontal facial reference for {character_label}.",
]
if character_id:
lines.append(f'The character ID string is "{character_id}".')
fact_fragments = []
if alias:
lines.append(f"{character_label} is also known as {alias}.")
fact_fragments.append(f"is also known as {alias}")
if gender:
lines.append(f"{character_label} is {gender}.")
fact_fragments.append(f"is {gender}")
if age_value is not None:
lines.append(f"{character_label} is {age_value} years old.")
fact_fragments.append(f"is {age_value} years old")
if nationality:
lines.append(f"{character_label} is {nationality}.")
fact_fragments.append(f"is {nationality}")
if occupation:
lines.append(f"{character_label} works as {occupation}.")
fact_fragments.append(f"works as {occupation}")
height_text = _format_height_text(height_feet, height_inches)
if height_text:
lines.append(f"{character_label} is {height_text} tall.")
fact_fragments.append(f"is {height_text} tall")
if accent:
lines.append(
f"{character_label} speaks in {_indefinite_article(accent)} {accent} accent."
fact_fragments.append(
f"speaks in {_indefinite_article(accent)} {accent} accent"
)
if fact_fragments:
lines.append(f"{character_label} {', '.join(fact_fragments)}.")
if general:
lines.append(general)