Protokoll #11611
| ID | 11611 |
|---|---|
| Zeitstempel | 2025-12-23 20:21:54.629848 |
| Client | root |
| IP | Warning: Undefined array key "request_ip" in /var/www/dev.campus.systemische-tools.de/src/View/protokoll/show.php on line 13 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/dev.campus.systemische-tools.de/src/View/protokoll/show.php on line 13 |
| Modell | claude-sonnet-4-20250514 |
| Status | completed |
| Tokens | 1,723 (Input: 0, Output: 0) |
| Dauer | 19720 ms |
| Request-Zeit | Warning: Undefined array key "request_timestamp" in /var/www/dev.campus.systemische-tools.de/src/View/protokoll/show.php on line 18 |
| Response-Zeit | - |
Warning: Undefined array key "error_message" in /var/www/dev.campus.systemische-tools.de/src/View/protokoll/show.php on line 22
Request
{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/opt\/scripts\/pipeline\/generate.py",
"offset": 154,
"limit": 180
}
}
Response
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/opt\/scripts\/pipeline\/generate.py",
"content": "def build_generation_prompt(briefing, context, profile, contract, structure=None):\n \"\"\"Build the content generation prompt.\"\"\"\n\n # Format context\n context_text = \"\"\n for i, ctx in enumerate(context, 1):\n context_text += f\"\\n[Quelle {i}: {ctx['source']}]\\n{ctx['content']}\\n\"\n\n # Build rich profile instructions\n profile_text = \"\"\n if profile:\n config = profile.get(\"config\", {})\n autorenprofil = config.get(\"autorenprofil\", config) # Support both structures\n\n # Extract voice\/stimme\n stimme = autorenprofil.get(\"stimme\", {})\n stimme_text = \"\"\n if stimme:\n stimme_text = f\"\"\"\n### Stimme\/Tonalität:\n- Ton: {stimme.get(\"ton\", \"neutral\")}\n- Perspektive: {stimme.get(\"perspektive\", \"neutral\")}\n- Komplexität: {stimme.get(\"komplexitaet\", \"mittel\")}\n- Autorität: {stimme.get(\"autoritaet\", \"Experte\")}\"\"\"\n\n # Extract style\/stil\n stil = autorenprofil.get(\"stil\", {})\n stil_text = \"\"\n if stil:\n fachsprache_beispiele = stil.get(\"fachsprache_beispiele\", [])\n fachsprache_str = \", \".join(fachsprache_beispiele[:5]) if fachsprache_beispiele else \"\"\n stil_text = f\"\"\"\n### Stil:\n- Fachsprache: {\"Ja\" if stil.get(\"fachsprache\", False) else \"Nein\"}\n- Fachbegriffe: {fachsprache_str}\n- Satzlänge: {stil.get(\"satzlaenge\", \"mittel\")}\n- Absatzstruktur: {stil.get(\"absatzstruktur\", \"klar gegliedert\")}\"\"\"\n\n # Extract language patterns\/sprachliche_muster\n muster = autorenprofil.get(\"sprachliche_muster\", {})\n muster_text = \"\"\n if muster:\n phrasen = muster.get(\"phrasen\", [])\n phrasen_str = \", \".join([f'\"{p}\"' for p in phrasen[:4]]) if phrasen else \"\"\n uebergaenge = muster.get(\"uebergaenge\", [])\n uebergaenge_str = \", \".join([f'\"{u}\"' for u in uebergaenge[:3]]) if uebergaenge else \"\"\n muster_text = f\"\"\"\n### Sprachliche Muster:\n- Typische Phrasen: {phrasen_str}\n- Übergangsformulierungen: {uebergaenge_str}\"\"\"\n\n # Extract taboos\/tabus\n tabus = autorenprofil.get(\"tabus\", [])\n tabus_text = \"\"\n if tabus:\n tabus_str = \", \".join(tabus[:5])\n tabus_text = f\"\"\"\n### Zu vermeiden (Tabus):\n{tabus_str}\"\"\"\n\n # Extract core messages\/kernbotschaften\n kernbotschaften = autorenprofil.get(\"kernbotschaften\", [])\n kern_text = \"\"\n if kernbotschaften:\n kern_str = \"\\n\".join([f\"- {k}\" for k in kernbotschaften[:4]])\n kern_text = f\"\"\"\n### Kernbotschaften (implizit vermitteln):\n{kern_str}\"\"\"\n\n # Extract output format (HTML for web profiles)\n output_format = autorenprofil.get(\"output_format\", {})\n format_text = \"\"\n if output_format and output_format.get(\"typ\") == \"html\":\n erlaubte = output_format.get(\"erlaubte_elemente\", {})\n verboten = output_format.get(\"verbotene_elemente\", [])\n regeln = output_format.get(\"struktur_regeln\", [])\n\n erlaubte_str = []\n for _kategorie, elemente in erlaubte.items():\n erlaubte_str.extend(elemente[:3])\n\n format_text = f\"\"\"\n### Output-Format: HTML\n**Erlaubte Elemente:**\n{\", \".join(erlaubte_str[:10])}\n\n**Struktur-Regeln:**\n- {chr(10).join(\"- \" + r for r in regeln[:4]) if regeln else \"Semantisches HTML verwenden\"}\n\n**Verboten:** {\", \".join(verboten[:4]) if verboten else \"div, span, br, style\"}\"\"\"\n\n # Combine all profile sections\n profile_text = f\"\"\"\n## Autorenprofil: {profile.get(\"name\", \"Standard\")}\n{stimme_text}\n{stil_text}\n{muster_text}\n{tabus_text}\n{kern_text}\n{format_text}\n\"\"\"\n\n # Build contract requirements\n contract_text = \"\"\n if contract:\n config = contract.get(\"config\", {})\n req = config.get(\"requirements\", {})\n contract_text = f\"\"\"\nContract: {contract.get(\"name\", \"Standard\")}\n- Wortanzahl: {req.get(\"min_words\", 500)} - {req.get(\"max_words\", 5000)} Wörter\n- Struktur-Validierung: {req.get(\"structure_validation\", True)}\n\"\"\"\n\n # Build structure instructions\n structure_text = \"\"\n if structure:\n config = structure.get(\"config\", {})\n structure_text = f\"\"\"\nStruktur-Template: {structure.get(\"name\", \"\")}\n- Typ: {structure.get(\"type\", \"\")}\n- Abschnitte: {json.dumps(config.get(\"sections\", []), ensure_ascii=False)}\n\"\"\"\n\n # Determine if HTML output is required\n html_output = False\n if profile:\n config = profile.get(\"config\", {})\n autorenprofil = config.get(\"autorenprofil\", config)\n output_format = autorenprofil.get(\"output_format\", {})\n html_output = output_format.get(\"typ\") == \"html\"\n\n format_instruction = \"\"\n if html_output:\n format_instruction = \"\"\"7. **WICHTIG: Ausgabe als wohlformatiertes HTML**\n - Verwende nur: h1, h2, h3, h4, p, ul, ol, li, strong, a, section, table, tr, td\n - Jeder h2-Abschnitt muss in einer eigenen <section> stehen\n - Kein Markdown, kein div\/span\/br\n - Fließtext immer in <p>-Tags\"\"\"\n\n # Load generate prompt template from database\n # Note: Assumes db.connect() was called by the caller (generate_content)\n prompt_template = get_prompt(\"content-generate\")\n\n if prompt_template:\n prompt = prompt_template.format(\n profile_text=profile_text,\n contract_text=contract_text,\n structure_text=structure_text,\n context=context_text,\n briefing=briefing,\n format_instruction=format_instruction,\n )\n else:\n # Fallback if prompt not in DB\n prompt = f\"\"\"Du bist ein professioneller Content-Autor. Erstelle basierend auf dem Briefing und dem bereitgestellten Kontext einen hochwertigen Text.\n\n{profile_text}\n{contract_text}\n{structure_text}\n\n## Kontext aus der Wissensbasis:\n{context_text}\n\n## Briefing:\n{briefing}\n\n## Anweisungen:\n1. Nutze die Informationen aus dem Kontext als Grundlage\n2. Halte dich an das Autorenprofil und den Schreibstil\n3. Beachte die Vorgaben aus dem Contract\n4. Strukturiere den Text gemäß dem Template (falls angegeben)\n5. Schreibe auf Deutsch\n6. Kennzeichne verwendete Quellen\n{format_instruction}\n\nErstelle nun den Content:\"\"\"\n\n return prompt\n\n",
"numLines": 180,
"startLine": 154,
"totalLines": 863
}
}
}