Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions demo/src/Blog/Command/EmbedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 2 additions & 6 deletions demo/src/Blog/Command/QueryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...');
Expand Down