Skip to content

Commit 9733aee

Browse files
OskarStarkclaude
andcommitted
Rename ai:chat command to ai:agent:call with backward compatibility
- Renamed ChatCommand class to AgentCallCommand - Renamed ChatCommandTest class to AgentCallCommandTest - Updated command name from ai:chat to ai:agent:call - Added ai:chat as alias for backward compatibility - Updated service configuration to use new class name 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2f05b00 commit 9733aee

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

src/ai-bundle/config/services.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symfony\AI\Agent\Toolbox\ToolFactory\AbstractToolFactory;
2222
use Symfony\AI\Agent\Toolbox\ToolFactory\ReflectionToolFactory;
2323
use Symfony\AI\Agent\Toolbox\ToolResultConverter;
24-
use Symfony\AI\AiBundle\Command\ChatCommand;
24+
use Symfony\AI\AiBundle\Command\AgentCallCommand;
2525
use Symfony\AI\AiBundle\Profiler\DataCollector;
2626
use Symfony\AI\AiBundle\Profiler\TraceableToolbox;
2727
use Symfony\AI\AiBundle\Security\EventListener\IsGrantedToolAttributeListener;
@@ -154,7 +154,7 @@
154154
->set('ai.platform.search_result_processor.perplexity', PerplexitySearchResultProcessor::class)
155155

156156
// commands
157-
->set('ai.command.chat', ChatCommand::class)
157+
->set('ai.command.chat', AgentCallCommand::class)
158158
->args([
159159
tagged_locator('ai.agent', 'name'),
160160
])

src/ai-bundle/src/Command/ChatCommand.php renamed to src/ai-bundle/src/Command/AgentCallCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
* @author Oskar Stark <[email protected]>
3333
*/
3434
#[AsCommand(
35-
name: 'ai:chat',
35+
name: 'ai:agent:call',
36+
aliases: ['ai:chat'],
3637
description: 'Chat with an agent',
3738
)]
38-
final class ChatCommand extends Command
39+
final class AgentCallCommand extends Command
3940
{
4041
/**
4142
* @param ServiceLocator<AgentInterface> $agents

src/ai-bundle/tests/Command/ChatCommandTest.php renamed to src/ai-bundle/tests/Command/AgentCallCommandTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use PHPUnit\Framework\TestCase;
1919
use Symfony\AI\Agent\AgentInterface;
20-
use Symfony\AI\AiBundle\Command\ChatCommand;
20+
use Symfony\AI\AiBundle\Command\AgentCallCommand;
2121
use Symfony\AI\AiBundle\Exception\RuntimeException;
2222
use Symfony\AI\Platform\Message\Message;
2323
use Symfony\AI\Platform\Message\MessageBag;
@@ -27,7 +27,7 @@
2727
use Symfony\Component\Console\Tester\CommandTester;
2828
use Symfony\Component\DependencyInjection\ServiceLocator;
2929

30-
final class ChatCommandTest extends TestCase
30+
final class AgentCallCommandTest extends TestCase
3131
{
3232
public function testCommandFailsWithInvalidAgent()
3333
{
@@ -37,7 +37,7 @@ public function testCommandFailsWithInvalidAgent()
3737
'test' => $agent,
3838
];
3939

40-
$command = new ChatCommand($this->createServiceLocator($agents));
40+
$command = new AgentCallCommand($this->createServiceLocator($agents));
4141
$application = self::createApplication($command);
4242

4343
$commandTester = new CommandTester($command);
@@ -71,7 +71,7 @@ public function testCommandExecutesWithValidAgent()
7171
'test' => $agent,
7272
];
7373

74-
$command = new ChatCommand($this->createServiceLocator($agents));
74+
$command = new AgentCallCommand($this->createServiceLocator($agents));
7575
$application = self::createApplication($command);
7676

7777
$commandTester = new CommandTester($command);
@@ -100,7 +100,7 @@ public function testCommandHandlesQuitCommand()
100100
'test' => $agent,
101101
];
102102

103-
$command = new ChatCommand($this->createServiceLocator($agents));
103+
$command = new AgentCallCommand($this->createServiceLocator($agents));
104104
$application = self::createApplication($command);
105105

106106
$commandTester = new CommandTester($command);
@@ -128,7 +128,7 @@ public function testCommandHandlesAgentCallException()
128128
'test' => $agent,
129129
];
130130

131-
$command = new ChatCommand($this->createServiceLocator($agents));
131+
$command = new AgentCallCommand($this->createServiceLocator($agents));
132132
$application = self::createApplication($command);
133133

134134
$commandTester = new CommandTester($command);
@@ -165,7 +165,7 @@ public function testInitializeMethodSelectsCorrectAgent()
165165
'second' => $agent2,
166166
];
167167

168-
$command = new ChatCommand($this->createServiceLocator($agents));
168+
$command = new AgentCallCommand($this->createServiceLocator($agents));
169169
$application = self::createApplication($command);
170170

171171
$commandTester = new CommandTester($command);
@@ -203,7 +203,7 @@ public function testCommandWithSystemPromptDisplaysItOnce()
203203
'test' => $agent,
204204
];
205205

206-
$command = new ChatCommand($this->createServiceLocator($agents));
206+
$command = new AgentCallCommand($this->createServiceLocator($agents));
207207
$application = self::createApplication($command);
208208

209209
$commandTester = new CommandTester($command);

0 commit comments

Comments
 (0)