{
"event": "PostToolUse",
"tool_name": "Read",
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Command\/SendChatMessageCommand.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Command;\n\n\/\/ @responsibility: Command-Objekt für Chat-Nachrichten\n\nfinal class SendChatMessageCommand\n{\n \/**\n * @param array<string> $collections\n *\/\n public function __construct(\n public readonly string $sessionUuid,\n public readonly string $message,\n public readonly string $model,\n public readonly array $collections,\n public readonly int $contextLimit,\n public readonly int $authorProfileId,\n public readonly int $systemPromptId,\n public readonly float $temperature,\n public readonly int $maxTokens,\n ) {\n }\n\n \/**\n * @param array<string, mixed> $data\n *\/\n public static function fromRequest(string $sessionUuid, array $data): self\n {\n $collections = $data['collections'] ?? ['documents'];\n if (!is_array($collections)) {\n $collections = [$collections];\n }\n\n return new self(\n sessionUuid: $sessionUuid,\n message: trim((string) ($data['message'] ?? '')),\n model: (string) ($data['model'] ?? 'mistral'),\n collections: $collections,\n contextLimit: (int) ($data['context_limit'] ?? 5),\n authorProfileId: (int) ($data['author_profile_id'] ?? 0),\n systemPromptId: (int) ($data['system_prompt_id'] ?? 1),\n temperature: (float) ($data['temperature'] ?? 0.7),\n maxTokens: (int) ($data['max_tokens'] ?? 4096),\n );\n }\n\n \/**\n * @return array<string>\n *\/\n public function validate(): array\n {\n $errors = [];\n\n if ($this->sessionUuid === '') {\n $errors[] = 'Session-ID ist erforderlich.';\n }\n\n if ($this->message === '') {\n $errors[] = 'Nachricht ist erforderlich.';\n }\n\n if ($this->model === '') {\n $errors[] = 'Modell ist erforderlich.';\n }\n\n if ($this->temperature < 0.0 || $this->temperature > 2.0) {\n $errors[] = 'Temperature muss zwischen 0 und 2 liegen.';\n }\n\n if ($this->maxTokens < 100 || $this->maxTokens > 16000) {\n $errors[] = 'Max-Tokens muss zwischen 100 und 16000 liegen.';\n }\n\n return $errors;\n }\n\n public function isValid(): bool\n {\n return $this->validate() === [];\n }\n}\n",
"numLines": 85,
"startLine": 1,
"totalLines": 85
}
}
}