{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Docs\/ChunkAnalysisService.php",
"offset": 170,
"limit": 30
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Docs\/ChunkAnalysisService.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Docs;\n\nuse Infrastructure\\AI\\OllamaService;\nuse Infrastructure\\Traits\\JsonDecodeTrait;\nuse PDO;\nuse RuntimeException;\n\n\/**\n * Service for analyzing documentation chunks using local LLMs.\n *\n * Performs three types of analysis on each chunk:\n * - Taxonomy: Hierarchical classification (e.g., Server > Security > Firewall)\n * - Ontology: Entity extraction (technologies, concepts, configurations)\n * - Semantics: Keywords and glossary terms\n *\/\nfinal class ChunkAnalysisService\n{\n use JsonDecodeTrait;\n\n private const string TAXONOMY_MODEL = 'gemma3:4b-it-qat';\n private const string ONTOLOGY_MODEL = 'gemma3:4b-it-qat';\n private const int MAX_RETRIES = 3;\n private const int BATCH_SIZE = 10;\n\n private PDO $pdo;\n private OllamaService $ollama;\n\n public function __construct()\n {\n $this->ollama = new OllamaService();\n $this->pdo = $this->createConnection();\n }\n\n \/**\n * Analyzes a single chunk.\n *\n * @return array{taxonomy: array<string>, entities: array<array{name: string, type: string}>, keywords: array<string>}\n *\/\n public function analyzeChunk(int $chunkId): array\n {\n $chunk = $this->getChunk($chunkId);\n\n if ($chunk === null) {\n throw new RuntimeException(\"Chunk #{$chunkId} not found\");\n }\n",
"numLines": 50,
"startLine": 1,
"totalLines": 416
}
}
}