{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/opt\/scripts\/pipeline\/analyze.py",
"limit": 40
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/opt\/scripts\/pipeline\/analyze.py",
"content": "\"\"\"\nSemantic analysis for KI-System Pipeline\nEntity extraction, taxonomy classification, ontology mapping.\n\"\"\"\n\nimport json\nimport os\n\nimport requests\n\nfrom config import ANTHROPIC_MODEL, OLLAMA_CHAT_MODEL, OLLAMA_HOST\nfrom db import db\n\n\ndef get_anthropic_client():\n \"\"\"Get Anthropic API client.\"\"\"\n try:\n import anthropic\n\n api_key = os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not api_key:\n # Try reading from credentials\n cred_file = \"\/var\/www\/docs\/credentials\/credentials.md\"\n if os.path.exists(cred_file):\n with open(cred_file) as f:\n content = f.read()\n # Parse API key from markdown\n for line in content.split(\"\\n\"):\n if \"ANTHROPIC_API_KEY\" in line:\n parts = line.split(\"`\")\n if len(parts) >= 2:\n api_key = parts[1]\n break\n if api_key:\n return anthropic.Anthropic(api_key=api_key)\n except ImportError:\n pass\n return None\n\n",
"numLines": 40,
"startLine": 1,
"totalLines": 369
}
}
}