From decaa1fec40795898b68210fd9045deb5410b2f4 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Fri, 26 Sep 2025 18:09:46 +0200 Subject: [PATCH] [Agent] Remove tool calling capability validation from `AgentProcessor` --- src/agent/src/Toolbox/AgentProcessor.php | 6 ------ src/agent/tests/Toolbox/AgentProcessorTest.php | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/src/agent/src/Toolbox/AgentProcessor.php b/src/agent/src/Toolbox/AgentProcessor.php index 366fb068b..b966d29d6 100644 --- a/src/agent/src/Toolbox/AgentProcessor.php +++ b/src/agent/src/Toolbox/AgentProcessor.php @@ -13,14 +13,12 @@ use Symfony\AI\Agent\AgentAwareInterface; use Symfony\AI\Agent\AgentAwareTrait; -use Symfony\AI\Agent\Exception\MissingModelSupportException; use Symfony\AI\Agent\Input; use Symfony\AI\Agent\InputProcessorInterface; use Symfony\AI\Agent\Output; use Symfony\AI\Agent\OutputProcessorInterface; use Symfony\AI\Agent\Toolbox\Event\ToolCallsExecuted; use Symfony\AI\Agent\Toolbox\StreamResult as ToolboxStreamResponse; -use Symfony\AI\Platform\Capability; use Symfony\AI\Platform\Message\AssistantMessage; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Result\ResultInterface; @@ -46,10 +44,6 @@ public function __construct( public function processInput(Input $input): void { - if (!$input->model->supports(Capability::TOOL_CALLING)) { - throw MissingModelSupportException::forToolCalling($input->model::class); - } - $toolMap = $this->toolbox->getTools(); if ([] === $toolMap) { return; diff --git a/src/agent/tests/Toolbox/AgentProcessorTest.php b/src/agent/tests/Toolbox/AgentProcessorTest.php index 6eb43aed7..a52bdb77e 100644 --- a/src/agent/tests/Toolbox/AgentProcessorTest.php +++ b/src/agent/tests/Toolbox/AgentProcessorTest.php @@ -13,7 +13,6 @@ use PHPUnit\Framework\TestCase; use Symfony\AI\Agent\AgentInterface; -use Symfony\AI\Agent\Exception\MissingModelSupportException; use Symfony\AI\Agent\Input; use Symfony\AI\Agent\Output; use Symfony\AI\Agent\Toolbox\AgentProcessor; @@ -76,17 +75,6 @@ public function testProcessInputWithRegisteredToolsButToolOverride() $this->assertSame(['tools' => [$tool2]], $input->getOptions()); } - public function testProcessInputWithUnsupportedToolCallingWillThrowException() - { - $this->expectException(MissingModelSupportException::class); - - $model = new Model('gpt-3'); - $processor = new AgentProcessor($this->createStub(ToolboxInterface::class)); - $input = new Input($model, new MessageBag()); - - $processor->processInput($input); - } - public function testProcessOutputWithToolCallResponseKeepingMessages() { $toolbox = $this->createMock(ToolboxInterface::class);