{
"tool_response": {
"mode": "content",
"numFiles": 0,
"filenames": [],
"content": "18: \/** @var array<string>|null Cached collections list *\/\n19: private ?array $collectionsCache = null;\n61: $collections = $this->getAvailableCollections();\n70: 'collections' => $collections,\n103: $collection = $this->validateCollection($_POST['collection'] ?? $session['collection']);\n115: if ($model !== $session['model'] || $collection !== $session['collection'] || $contextLimit !== $currentLimit || $authorProfileId !== $currentProfileId || $temperature !== $currentTemperature || $maxTokens !== $currentMaxTokens) {\n116: $this->updateSessionSettings($session['id'], $model, $collection, $contextLimit, $authorProfileId, $temperature, $maxTokens);\n149: $collection,\n182: $collection,\n312: 'INSERT INTO chat_sessions (uuid, model, collection, context_limit) VALUES (?, ?, ?, ?)'\n404: ?string $collection = null,\n410: start_microtime, end_microtime, author_profile_id, system_prompt_id, collection, context_limit)\n425: $collection,\n469: * Get available Qdrant collections (cached per request)\n471: * @return array<string> List of collection names\n475: if ($this->collectionsCache === null) {\n476: $this->collectionsCache = $this->qdrantService->listCollections();\n479: if ($this->collectionsCache === []) {\n480: $this->collectionsCache = ['documents'];\n484: return $this->collectionsCache;\n488: * Validate collection parameter against available collections\n490: private function validateCollection(string $collection): string\n494: return in_array($collection, $availableCollections, true)\n495: ? $collection\n589: * Update session model, collection, context limit, author profile, temperature and max_tokens settings\n591: private function updateSessionSettings(int $sessionId, string $model, string $collection, int $contextLimit = 5, int $authorProfileId = 0, float $temperature = 0.7, int $maxTokens = 4096): void\n593: $stmt = $this->db->prepare('UPDATE chat_sessions SET model = ?, collection = ?, context_limit = ?, author_profile_id = ?, temperature = ?, max_tokens = ? WHERE id = ?');\n594: $stmt->execute([$model, $collection, $contextLimit, $authorProfileId > 0 ? $authorProfileId : null, $temperature, $maxTokens, $sessionId]);\n648: private function askChat(string $question, string $model, string $collection, int $limit, ?string $stylePrompt = null, ?string $customSystemPrompt = null, float $temperature = 0.7, int $maxTokens = 4096): array\n651: return $this->chatService->chat($question, $model, $collection, $limit, $stylePrompt, $customSystemPrompt, $temperature, $maxTokens);",
"numLines": 30
}
}