{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/QdrantService.php",
"offset": 59,
"limit": 40
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/AI\/QdrantService.php",
"content": " public function search(array $vector, string $collection = 'documents', int $limit = 5): array\n {\n $url = sprintf('%s\/collections\/%s\/points\/search', $this->host, urlencode($collection));\n\n $payload = [\n 'vector' => array_values($vector),\n 'limit' => $limit,\n 'with_payload' => true,\n ];\n\n $response = $this->makeRequest($url, $payload, self::DEFAULT_TIMEOUT);\n\n if (!isset($response['result']) || !is_array($response['result'])) {\n throw new RuntimeException('Invalid search response from Qdrant API');\n }\n\n return array_map(\n static function (mixed $item): array {\n if (!is_array($item)) {\n throw new RuntimeException('Invalid search result item format');\n }\n\n return [\n 'id' => $item['id'] ?? throw new RuntimeException('Missing id in search result'),\n 'score' => (float) ($item['score'] ?? throw new RuntimeException('Missing score in search result')),\n 'payload' => is_array($item['payload'] ?? null) ? $item['payload'] : [],\n ];\n },\n $response['result']\n );\n }\n\n \/**\n * Checks if a collection exists in Qdrant.\n *\n * Verifies the existence of a specific collection by attempting to retrieve\n * its information. This is useful before performing searches or operations.\n *\n * @param string $collection The collection name to check\n *",
"numLines": 40,
"startLine": 59,
"totalLines": 392
}
}
}