diff --git a/demo/src/Blog/Command/EmbedCommand.php b/demo/src/Blog/Command/EmbedCommand.php index 370a25f34..a97ec064e 100644 --- a/demo/src/Blog/Command/EmbedCommand.php +++ b/demo/src/Blog/Command/EmbedCommand.php @@ -14,22 +14,18 @@ use App\Blog\Embedder; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; #[AsCommand('app:blog:embed', description: 'Create embeddings for Symfony blog and push to ChromaDB.')] -final class EmbedCommand extends Command +final class EmbedCommand { public function __construct( private readonly Embedder $embedder, ) { - parent::__construct(); } - protected function execute(InputInterface $input, OutputInterface $output): int + public function __invoke(SymfonyStyle $io): int { - $io = new SymfonyStyle($input, $output); $io->title('Loading RSS of Symfony blog as embeddings into ChromaDB'); $this->embedder->embedBlog(); diff --git a/demo/src/Blog/Command/QueryCommand.php b/demo/src/Blog/Command/QueryCommand.php index a8858f589..3128c7238 100644 --- a/demo/src/Blog/Command/QueryCommand.php +++ b/demo/src/Blog/Command/QueryCommand.php @@ -16,23 +16,19 @@ use Symfony\AI\Platform\PlatformInterface; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; #[AsCommand('app:blog:query', description: 'Test command for querying the blog collection in Chroma DB.')] -final class QueryCommand extends Command +final class QueryCommand { public function __construct( private readonly Client $chromaClient, private readonly PlatformInterface $platform, ) { - parent::__construct(); } - protected function execute(InputInterface $input, OutputInterface $output): int + public function __invoke(SymfonyStyle $io): int { - $io = new SymfonyStyle($input, $output); $io->title('Testing Chroma DB Connection'); $io->comment('Connecting to Chroma DB ...');