File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,7 @@ protected function initialize(): void
5454 return ;
5555 }
5656
57- $ this ->httpClient ->request (
58- HttpRequest::put (
59- uri: '' ,
60- body: [
61- 'vectors ' => [
62- 'size ' => $ this ->dimension ,
63- 'distance ' => 'Cosine ' ,
64- ],
65- ],
66- )
67- );
57+ $ this ->createCollection ();
6858 }
6959
7060 /**
@@ -182,4 +172,19 @@ public function similaritySearch(array $embedding): iterable
182172 return $ document ;
183173 }, $ response ['result ' ]['points ' ]);
184174 }
175+
176+ protected function createCollection (): void
177+ {
178+ $ this ->httpClient ->request (
179+ HttpRequest::put (
180+ uri: '' ,
181+ body: [
182+ 'vectors ' => [
183+ 'size ' => $ this ->dimension ,
184+ 'distance ' => 'Cosine ' ,
185+ ],
186+ ],
187+ )
188+ );
189+ }
185190}
You can’t perform that action at this time.
0 commit comments