Protokoll #12381
| ID | 12381 |
|---|---|
| Zeitstempel | 2025-12-24 01:09:37.850809 |
| 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 | 764 (Input: 0, Output: 0) |
| Dauer | 85 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": "\/var\/www\/scripts\/pipeline\/generate.py",
"offset": 765,
"limit": 80
}
}
Response
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/scripts\/pipeline\/generate.py",
"content": "\ndef run_critique_round(version_id, model=\"anthropic\"):\n \"\"\"\n Run all active critics on a content version.\n\n Returns:\n dict with all critique results\n \"\"\"\n db.connect()\n\n try:\n # Get version content\n cursor = db.execute(\n \"SELECT cv.*, co.id as order_id, co.current_critique_round FROM content_versions cv JOIN content_orders co ON cv.order_id = co.id WHERE cv.id = %s\",\n (version_id,),\n )\n version = cursor.fetchone()\n cursor.close()\n\n if not version:\n return {\"error\": \"Version not found\"}\n\n content_data = json.loads(version[\"content\"]) if isinstance(version[\"content\"], str) else version[\"content\"]\n content_text = content_data.get(\"text\", \"\")\n\n # Get all active critics\n cursor = db.execute(\"SELECT id, name FROM critics WHERE is_active = 1 ORDER BY sort_order\")\n critics = cursor.fetchall()\n cursor.close()\n\n # Increment critique round\n new_round = (version[\"current_critique_round\"] or 0) + 1\n cursor = db.execute(\n \"UPDATE content_orders SET current_critique_round = %s WHERE id = %s\", (new_round, version[\"order_id\"])\n )\n db.commit()\n cursor.close()\n\n # Run each critic\n results = []\n all_passed = True\n\n for critic in critics:\n db.disconnect() # Disconnect before calling run_critic\n feedback = run_critic(content_text, critic[\"id\"], model)\n db.connect() # Reconnect\n\n if \"error\" not in feedback:\n # Save critique\n cursor = db.execute(\n \"\"\"INSERT INTO content_critiques (version_id, critic_id, round, feedback)\n VALUES (%s, %s, %s, %s)\"\"\",\n (version_id, critic[\"id\"], new_round, json.dumps(feedback)),\n )\n db.commit()\n cursor.close()\n\n if not feedback.get(\"passed\", True):\n all_passed = False\n\n results.append(feedback)\n\n # Update order status based on results\n if all_passed:\n update_order_status(version[\"order_id\"], \"validate\")\n else:\n update_order_status(version[\"order_id\"], \"revision\")\n\n return {\"success\": True, \"round\": new_round, \"critiques\": results, \"all_passed\": all_passed}\n\n except Exception as e:\n return {\"error\": str(e)}\n finally:\n db.disconnect()\n\n\ndef revise_content(version_id, model=\"anthropic\"):\n \"\"\"\n Create a revision based on critique feedback.\n",
"numLines": 80,
"startLine": 765,
"totalLines": 987
}
}
}