{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ChatController.php",
"offset": 140
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/ChatController.php",
"content": "\n return;\n }\n\n $result = $response->toArray();\n $this->view('chat.partials.response', [\n 'question' => $question,\n 'result' => $result,\n 'model' => $model,\n 'formattedAnswer' => $this->formatter->formatAnswer($result['answer'] ?? ''),\n ]);\n }\n\n public function updateTitle(string $uuid): void\n {\n $session = $this->sessionsUseCase->getSession($uuid);\n\n if ($session === null) {\n $this->notFound('Session nicht gefunden');\n }\n\n $title = $this->sessionsUseCase->updateTitle($session->getId() ?? 0, $_POST['title'] ?? '');\n $this->html(htmlspecialchars($title));\n }\n\n public function systemPrompt(string $uuid): void\n {\n $session = $this->sessionsUseCase->getSession($uuid);\n\n if ($session === null) {\n $this->notFound('Session nicht gefunden');\n }\n\n $result = $this->sessionsUseCase->updateSystemPrompt($session->getId() ?? 0, $_POST['system_prompt'] ?? '');\n $this->view('chat.partials.success', ['message' => $result->message]);\n }\n\n public function getSystemPrompt(string $uuid): void\n {\n $session = $this->sessionsUseCase->getSession($uuid);\n\n if ($session === null) {\n $this->notFound('Session nicht gefunden');\n }\n\n $this->view('chat.partials.system-prompt-modal', [\n 'session' => $session->toArray(),\n 'currentPrompt' => $session->getSystemPrompt() ?? '',\n 'defaultPrompt' => $this->sessionsUseCase->getDefaultSystemPrompt(),\n ]);\n }\n\n public function delete(string $uuid): void\n {\n $session = $this->sessionsUseCase->getSession($uuid);\n\n if ($session !== null) {\n $this->sessionsUseCase->deleteSession($session->getId() ?? 0);\n }\n\n $this->htmxRedirect('\/chat');\n }\n\n public function export(string $uuid): void\n {\n $format = $this->getString('format') ?: 'markdown';\n $filename = $this->exportUseCase->generateFilename($uuid, $format);\n\n if ($format === 'json') {\n $data = $this->exportUseCase->exportAsJson($uuid);\n\n if ($data === null) {\n $this->notFound('Session nicht gefunden');\n }\n\n $content = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);\n $this->download($content, $filename, 'application\/json');\n } else {\n $content = $this->exportUseCase->exportAsMarkdown($uuid);\n\n if ($content === null) {\n $this->notFound('Session nicht gefunden');\n }\n\n $this->download($content, $filename, 'text\/markdown');\n }\n }\n}\n",
"numLines": 89,
"startLine": 140,
"totalLines": 228
}
}
}