This commit is contained in:
Team3
2026-05-29 15:49:22 +02:00
parent 5cf0822f5a
commit a826e9f6b3
5 changed files with 46 additions and 24 deletions

View File

@@ -365,7 +365,7 @@ FORMAT-SPEZIFIKATION:
REFERENZ-BEISPIEL:
{reference}
Schlage 8 Bausteine vor. Antworte AUSSCHLIESSLICH mit einem JSON-Array. Jedes Element hat:
Schlage 40 Bausteine vor. Antworte AUSSCHLIESSLICH mit einem JSON-Array. Jedes Element hat:
- "title"
- "description"
- "purpose"
@@ -375,9 +375,10 @@ Orientiere dich an der Spezifikation und Referenz. NUR das JSON-Array, kein weit
"""
def _build_baustein_detail_prompt(topic: str, title: str) -> str:
def _build_baustein_detail_prompt(topic: str, title: str, instructions: str = "") -> str:
spec = (TEMPLATES_DIR / "Format" / "Baustein.md").read_text(encoding="utf-8")
reference = (TEMPLATES_DIR / "Referenz" / "Baustein.md").read_text(encoding="utf-8")
extra = f"\n\nZUSÄTZLICHE INFOS VOM NUTZER:\n{instructions}\n" if instructions else ""
return f"""Generiere Details für den Baustein "{title}" im Kontext des Themas "{topic}".
@@ -386,7 +387,7 @@ FORMAT-SPEZIFIKATION:
REFERENZ-BEISPIEL:
{reference}
{extra}
Antworte AUSSCHLIESSLICH mit einem JSON-Objekt mit den Feldern "description", "purpose", "examples".
"examples" ist ein Array mit 1 Objekt {{"label": "...", "code": "..."}}.
Orientiere dich an der Spezifikation und Referenz. Kein weiterer Text, nur das JSON.
@@ -403,7 +404,7 @@ async def generate_suggestions(topic: str, html_paths: list[Path]) -> None:
prompt = _build_suggestions_prompt(topic, html_paths, existing_titles)
tools = "Read" if html_paths else None
returncode, stdout, stderr = await _run_claude("suggestions-" + topic, prompt, 180, tools=tools, model=MODEL_BAUSTEIN_GEN)
returncode, stdout, stderr = await _run_claude("suggestions-" + topic, prompt, 1800, tools=tools, model=MODEL_BAUSTEIN_GEN)
if returncode != 0:
return
@@ -414,7 +415,7 @@ async def generate_suggestions(topic: str, html_paths: list[Path]) -> None:
now = datetime.now(timezone.utc).isoformat()
suggestions = []
for item in items[:8]:
for item in items[:40]:
suggestions.append({
"id": str(uuid.uuid4()),
"topic": topic,
@@ -433,9 +434,9 @@ async def generate_suggestions(topic: str, html_paths: list[Path]) -> None:
_suggestions_generating.discard(topic)
async def generate_baustein_detail(baustein_id: str, topic: str, title: str) -> None:
async def generate_baustein_detail(baustein_id: str, topic: str, title: str, instructions: str = "") -> None:
try:
prompt = _build_baustein_detail_prompt(topic, title)
prompt = _build_baustein_detail_prompt(topic, title, instructions)
returncode, stdout, stderr = await _run_claude("baustein-" + baustein_id, prompt, 60, tools=None, model=MODEL_BAUSTEIN_GEN)
if returncode != 0: