MVP 0.93 - stabile, aber Writing Profile ohne erkennbaren Nutzen
This commit is contained in:
1 parent
53b1eff833
commit
f17b3083e8
56 files changed
+5366
-784
No files matched your search
@@ -46,6 +46,7 @@ def _turns(user_bodies: list[str]) -> list[str]:
|
||||
|
||||
|
||||
def is_verbatim_join(body: str, user_bodies: list[str]) -> bool:
|
||||
"""Diagnostic helper. Must not be used to overwrite accepted model text."""
|
||||
turns = _turns(user_bodies)
|
||||
if not turns or not (body or "").strip():
|
||||
return False
|
||||
@@ -172,14 +173,17 @@ def shape_journal(
|
||||
body: str,
|
||||
user_bodies: list[str],
|
||||
person_labels: list[str] | None = None,
|
||||
*,
|
||||
source: str = "model",
|
||||
) -> tuple[str, str]:
|
||||
"""Local post-shape. Never replaces accepted model wording with source turns."""
|
||||
turns = _turns(user_bodies)
|
||||
text = (body or "").strip()
|
||||
heading = (title or "").strip()
|
||||
text = _strip_roles(text)
|
||||
if is_verbatim_join(text, turns) and len(turns) > 1:
|
||||
text = "\n\n".join(turns)
|
||||
else:
|
||||
if source != "fallback":
|
||||
text = paragraphize(text)
|
||||
elif "\n\n" not in text:
|
||||
text = paragraphize(text)
|
||||
if person_labels:
|
||||
text = naturalize_person_mentions(text, person_labels, turns)
|
||||
|
||||
Reference in new issue
Block a user