Prompts: Element-Familie domänen-adaptiv, _fence entfernt

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
team3
2026-06-12 07:48:22 +02:00
parent e3cf9a83f4
commit fb5fc7bff9
7 changed files with 25 additions and 20 deletions

View File

@@ -1435,13 +1435,6 @@ async def generate_element(topic: str, hint: str, provider: str = DEFAULT_PROVID
return fallback
def _fence(content: str) -> str:
"""Beispiele müssen Codeblöcke sein — fehlende Fences nachrüsten."""
if content.startswith("```"):
return content
return f"```\n{content}\n```"
def _parse_suggestions(stdout: str) -> list[dict] | None:
"""Validiert Vorschlags-JSON aus KI-Output. None bei ungültigem JSON."""
data = _parse_json_text(stdout)
@@ -1455,8 +1448,6 @@ def _parse_suggestions(stdout: str) -> list[dict] | None:
target = s.get("target")
content = str(s.get("content", "")).strip()
if text and content and target in ("description", "examples", "hints"):
if target == "examples":
content = _fence(content)
suggestions.append({"text": text, "target": target, "content": content})
return suggestions
@@ -1530,8 +1521,6 @@ def _validate_change(c, element: dict) -> dict | None:
return None
else:
index = None
if target == "examples" and action in ("anpassen", "hinzufuegen"):
content = _fence(content)
return {"text": text, "action": action, "target": target, "index": index, "content": content}