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
4 changes: 2 additions & 2 deletions src/ai-bundle/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'),
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
* @author Oskar Stark <[email protected]>
*/
#[AsCommand(
name: 'ai:chat',
description: 'Chat with an agent',
name: 'ai:agent:call',
aliases: ['ai:chat'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep the alias for now

description: 'Call an agent',
)]
final class ChatCommand extends Command
final class AgentCallCommand extends Command
{
/**
* @param ServiceLocator<AgentInterface> $agents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
{
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down