{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/opt\/scripts\/pipeline\/config.py"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/opt\/scripts\/pipeline\/config.py",
"content": "\"\"\"\nKI-System Pipeline Configuration\n\"\"\"\n\nimport os\n\n# Nextcloud Settings\nNEXTCLOUD_PATH = \"\/var\/www\/nextcloud\/data\/root\/files\/Documents\"\nSUPPORTED_EXTENSIONS = [\".pdf\", \".pptx\", \".docx\", \".md\", \".txt\"]\n\n# MariaDB Settings - Content Database (chunks, entities, semantic data)\nDB_CONFIG = {\n \"host\": \"localhost\",\n \"database\": \"ki_content\",\n \"user\": \"root\",\n \"password\": \"\", # Set via environment variable DB_PASSWORD\n \"charset\": \"utf8mb4\",\n}\n\n# Logging\/System Database\nDB_LOG_CONFIG = {\n \"host\": \"localhost\",\n \"database\": \"ki_dev\",\n \"user\": \"root\",\n \"password\": \"\",\n \"charset\": \"utf8mb4\",\n}\n\n# Qdrant Settings\nQDRANT_HOST = \"localhost\"\nQDRANT_PORT = 6333\nQDRANT_COLLECTIONS = {\n \"documents\": {\"size\": 1024, \"distance\": \"Cosine\"},\n \"mail\": {\"size\": 1024, \"distance\": \"Cosine\"},\n \"entities\": {\"size\": 1024, \"distance\": \"Cosine\"},\n}\n\n# Ollama Settings (Embeddings)\nOLLAMA_HOST = \"http:\/\/localhost:11434\"\nEMBEDDING_MODEL = \"mxbai-embed-large\"\nEMBEDDING_DIMENSION = 1024\n\n# Ollama Settings (Chat\/Generation)\nOLLAMA_CHAT_MODEL = \"gemma3:4b-it-qat\"\n\n# Anthropic Settings (Chat\/Analysis)\nANTHROPIC_MODEL = \"claude-opus-4-5-20251101\"\n\n# Chunking Settings\nCHUNK_OVERLAP_PERCENT = 10\nMIN_CHUNK_SIZE = 100\nMAX_CHUNK_SIZE = 2000\n\n# Pipeline Settings\nMAX_RETRIES = 3\nRETRY_BACKOFF_BASE = 2 # Seconds, exponential: 2, 4, 8\n\n# OCR Settings\nOCR_ENABLED = True\nOCR_LANGUAGE = \"deu\" # German\n\n# Logging\nLOG_LEVEL = \"INFO\"\n\n\ndef get_db_password():\n \"\"\"Get database password from environment or credentials file.\"\"\"\n password = os.environ.get(\"DB_PASSWORD\", \"\")\n if not password:\n cred_file = \"\/var\/www\/docs\/credentials\/credentials.md\"\n if os.path.exists(cred_file):\n with open(cred_file) as f:\n for line in f:\n if \"MariaDB\" in line and \"root\" in line:\n parts = line.split(\"|\")\n if len(parts) >= 4:\n password = parts[3].strip()\n break\n return password\n\n\ndef get_anthropic_key():\n \"\"\"Get Anthropic API key from environment or credentials file.\"\"\"\n key = os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\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 for line in content.split(\"\\n\"):\n if line.startswith(\"sk-ant-\"):\n key = line.strip()\n break\n return key\n\n\n# Update DB configs with password\nDB_CONFIG[\"password\"] = get_db_password()\nDB_LOG_CONFIG[\"password\"] = get_db_password()\nANTHROPIC_API_KEY = get_anthropic_key()\n",
"numLines": 101,
"startLine": 1,
"totalLines": 101
}
}
}