{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ChatController.php",
"offset": 180,
"limit": 60
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ChatController.php",
"content": "\n $this->setupSseStream();\n $this->setupProgressCallback();\n\n \/\/ Execute with streaming\n $response = $this->streamingUseCase->execute(\n sessionUuid: $uuid,\n message: $question,\n model: $model,\n collections: $collections,\n contextLimit: $contextLimit,\n authorProfileId: $authorProfileId,\n systemPromptId: $systemPromptId,\n temperature: $temperature,\n maxTokens: $maxTokens,\n structureId: $structureId,\n qualityCheck: $qualityCheck\n );\n\n \/\/ Send final result\n if ($response->hasError()) {\n $errorData = ['error' => $response->getError()];\n echo \"event: error\\n\";\n echo 'data: ' . json_encode($errorData, JSON_UNESCAPED_UNICODE) . \"\\n\\n\";\n } else {\n $result = $response->toArray();\n $formattedAnswer = $this->formatter->formatAnswer($result['answer'] ?? '');\n\n \/\/ Render the response partial to HTML\n ob_start();\n $this->view('chat.partials.response', [\n 'question' => $question,\n 'result' => $result,\n 'model' => $model,\n 'formattedAnswer' => $formattedAnswer,\n ]);\n $html = ob_get_clean();\n\n $doneData = ['html' => $html];\n echo \"event: done\\n\";\n echo 'data: ' . json_encode($doneData, JSON_UNESCAPED_UNICODE) . \"\\n\\n\";\n }\n\n @ob_flush();\n flush();\n }\n\n private function sseError(string $message): void\n {\n header('Content-Type: text\/event-stream; charset=utf-8');\n header('Cache-Control: no-cache, no-store, must-revalidate');\n header('Content-Encoding: none');\n while (ob_get_level()) {\n ob_end_clean();\n }\n \/\/ Padding for browser buffering\n echo ':' . str_repeat(' ', 4096) . \"\\n\\n\";\n $errorData = ['error' => $message];\n echo \"event: error\\n\";\n echo 'data: ' . json_encode($errorData, JSON_UNESCAPED_UNICODE) . \"\\n\\n\";",
"numLines": 60,
"startLine": 180,
"totalLines": 429
}
}
}