Files
MtoRagSystem/src/Command/VectorIngestCommand.php
2026-02-12 11:22:56 +01:00

31 lines
788 B
PHP

<?php
declare(strict_types=1);
namespace App\Command;
use App\Vector\VectorIndexBuilder;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'mto:agent:vector:rebuild')]
class VectorIngestCommand extends Command
{
public function __construct(
private readonly VectorIndexBuilder $builder
) {
parent::__construct();
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Rebuilding vector index...');
$this->builder->rebuildFromNdjson();
$output->writeln('Done.');
return Command::SUCCESS;
}
}