diff --git a/src/ai-bundle/config/services.php b/src/ai-bundle/config/services.php index 2437ef8d4..b1608d83a 100644 --- a/src/ai-bundle/config/services.php +++ b/src/ai-bundle/config/services.php @@ -21,7 +21,7 @@ use Symfony\AI\Agent\Toolbox\ToolFactory\AbstractToolFactory; use Symfony\AI\Agent\Toolbox\ToolFactory\ReflectionToolFactory; use Symfony\AI\Agent\Toolbox\ToolResultConverter; -use Symfony\AI\AiBundle\Command\ChatCommand; +use Symfony\AI\AiBundle\Command\AgentCallCommand; use Symfony\AI\AiBundle\Profiler\DataCollector; use Symfony\AI\AiBundle\Profiler\TraceableToolbox; use Symfony\AI\AiBundle\Security\EventListener\IsGrantedToolAttributeListener; @@ -154,7 +154,7 @@ ->set('ai.platform.search_result_processor.perplexity', PerplexitySearchResultProcessor::class) // commands - ->set('ai.command.chat', ChatCommand::class) + ->set('ai.command.chat', AgentCallCommand::class) ->args([ tagged_locator('ai.agent', 'name'), ]) diff --git a/src/ai-bundle/src/Command/ChatCommand.php b/src/ai-bundle/src/Command/AgentCallCommand.php similarity index 97% rename from src/ai-bundle/src/Command/ChatCommand.php rename to src/ai-bundle/src/Command/AgentCallCommand.php index 6a7f05063..6bee9c490 100644 --- a/src/ai-bundle/src/Command/ChatCommand.php +++ b/src/ai-bundle/src/Command/AgentCallCommand.php @@ -32,10 +32,11 @@ * @author Oskar Stark */ #[AsCommand( - name: 'ai:chat', - description: 'Chat with an agent', + name: 'ai:agent:call', + aliases: ['ai:chat'], + description: 'Call an agent', )] -final class ChatCommand extends Command +final class AgentCallCommand extends Command { /** * @param ServiceLocator $agents diff --git a/src/ai-bundle/tests/Command/ChatCommandTest.php b/src/ai-bundle/tests/Command/AgentCallCommandTest.php similarity index 93% rename from src/ai-bundle/tests/Command/ChatCommandTest.php rename to src/ai-bundle/tests/Command/AgentCallCommandTest.php index 4d388f0aa..43e0f1fc3 100644 --- a/src/ai-bundle/tests/Command/ChatCommandTest.php +++ b/src/ai-bundle/tests/Command/AgentCallCommandTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; use Symfony\AI\Agent\AgentInterface; -use Symfony\AI\AiBundle\Command\ChatCommand; +use Symfony\AI\AiBundle\Command\AgentCallCommand; use Symfony\AI\AiBundle\Exception\RuntimeException; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; @@ -27,7 +27,7 @@ use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\DependencyInjection\ServiceLocator; -final class ChatCommandTest extends TestCase +final class AgentCallCommandTest extends TestCase { public function testCommandFailsWithInvalidAgent() { @@ -37,7 +37,7 @@ public function testCommandFailsWithInvalidAgent() 'test' => $agent, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command); @@ -71,7 +71,7 @@ public function testCommandExecutesWithValidAgent() 'test' => $agent, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command); @@ -100,7 +100,7 @@ public function testCommandHandlesQuitCommand() 'test' => $agent, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command); @@ -128,7 +128,7 @@ public function testCommandHandlesAgentCallException() 'test' => $agent, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command); @@ -165,7 +165,7 @@ public function testInitializeMethodSelectsCorrectAgent() 'second' => $agent2, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command); @@ -203,7 +203,7 @@ public function testCommandWithSystemPromptDisplaysItOnce() 'test' => $agent, ]; - $command = new ChatCommand($this->createServiceLocator($agents)); + $command = new AgentCallCommand($this->createServiceLocator($agents)); $application = self::createApplication($command); $commandTester = new CommandTester($command);