99use function Codewithkyrian \Transformers \Pipelines \pipeline ;
1010
1111use Codewithkyrian \Transformers \Pipelines \Task ;
12+ use Codewithkyrian \Transformers \Tensor \Tensor ;
1213use Qdrant \Config ;
1314use Qdrant \Http \Transport ;
1415use Qdrant \Models \Request \SearchRequest ;
@@ -50,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5051 try {
5152 $ this ->initializeServices ();
5253 $ results = $ this ->searchProducts ($ query );
53- $ this ->displayResults ($ results , $ query , $ io );
54+ $ this ->displayResults ($ results , $ io );
5455
5556 return Command::SUCCESS ;
5657 } catch (\Exception $ e ) {
@@ -78,7 +79,7 @@ private function searchProducts(string $query): array
7879 if (is_array ($ embedding )) {
7980 $ vector = $ embedding [0 ];
8081 } else {
81- $ vector = $ embedding instanceof \ Codewithkyrian \ Transformers \ Tensor \ Tensor ? $ embedding [0 ] : [];
82+ $ vector = $ embedding instanceof Tensor ? $ embedding [0 ] : [];
8283 }
8384
8485 $ searchVector = new VectorStruct ($ vector , 'default ' );
@@ -93,9 +94,9 @@ private function searchProducts(string $query): array
9394 /**
9495 * @param array<int, array<string, mixed>> $results
9596 */
96- private function displayResults (array $ results , string $ query , SymfonyStyle $ io ): void
97+ private function displayResults (array $ results , SymfonyStyle $ io ): void
9798 {
98- if (empty ( $ results) ) {
99+ if ([] === $ results ) {
99100 $ io ->warning ('No products found ' );
100101
101102 return ;
0 commit comments