{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Persistence\/ChatMessageRepository.php",
"content": " public function save(\n int $sessionId,\n string $role,\n string $content,\n string $model,\n ?int $tokensInput = null,\n ?int $tokensOutput = null,\n ?array $sources = null,\n ?float $startMicrotime = null,\n ?float $endMicrotime = null,\n ?int $authorProfileId = null,\n ?int $systemPromptId = null,\n ?string $collectionsJson = null,\n ?int $contextLimit = null,\n ?int $llmRequestId = null\n ): int {\n $stmt = $this->pdo->prepare(\n 'INSERT INTO chat_messages\n (session_id, role, content, model, tokens_input, tokens_output, sources,\n start_microtime, end_microtime, author_profile_id, system_prompt_id, collections, context_limit, llm_request_id)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'\n );\n $stmt->execute([\n $sessionId,\n $role,\n $content,\n $model,\n $tokensInput,\n $tokensOutput,\n $sources !== null ? json_encode($sources) : null,\n $startMicrotime,\n $endMicrotime,\n $authorProfileId,\n $systemPromptId,\n $collectionsJson,\n $contextLimit,\n $llmRequestId,\n ]);\n\n \/\/ Update session timestamp\n $this->pdo->prepare('UPDATE chat_sessions SET updated_at = NOW() WHERE id = ?')\n ->execute([$sessionId]);\n\n return (int) $this->pdo->lastInsertId();\n }",
"numLines": 45,
"startLine": 73,
"totalLines": 147
}
}
}