{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/ContentQualityValidator.php",
"limit": 50
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/ContentQualityValidator.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\AI;\n\n\/\/ @responsibility: Validiert Content-Qualität mittels LLM\nfinal class ContentQualityValidator\n{\n private OllamaService $ollama;\n\n public function __construct(?OllamaService $ollama = null)\n {\n $this->ollama = $ollama ?? AIConfig::fromCredentialsFile()->createOllamaService();\n }\n\n \/**\n * Validate chat response quality.\n *\n * @param string $question Original question\n * @param string $answer LLM response\n * @param array<array{title: string, score: float}> $sources Used sources\n * @param string|null $structureName Applied structure (if any)\n *\n * @return array{passed: bool, score: float, issues: array<string>, details: string}\n *\/\n public function validate(\n string $question,\n string $answer,\n array $sources = [],\n ?string $structureName = null\n ): array {\n $prompt = $this->buildValidationPrompt($question, $answer, $sources, $structureName);\n\n try {\n $response = $this->ollama->generate($prompt, 'mistral', 0.1);\n $parsed = $this->parseResponse($response);\n\n return $parsed;\n } catch (\\Exception $e) {\n return [\n 'passed' => true,\n 'score' => 0.0,\n 'issues' => ['Validierung fehlgeschlagen: ' . $e->getMessage()],\n 'details' => 'Validierung konnte nicht durchgeführt werden.',\n ];\n }\n }\n\n \/**",
"numLines": 50,
"startLine": 1,
"totalLines": 125
}
}
}