Skip to content

Commit decaa1f

Browse files
committed
[Agent] Remove tool calling capability validation from AgentProcessor
1 parent cb6ed69 commit decaa1f

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/agent/src/Toolbox/AgentProcessor.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313

1414
use Symfony\AI\Agent\AgentAwareInterface;
1515
use Symfony\AI\Agent\AgentAwareTrait;
16-
use Symfony\AI\Agent\Exception\MissingModelSupportException;
1716
use Symfony\AI\Agent\Input;
1817
use Symfony\AI\Agent\InputProcessorInterface;
1918
use Symfony\AI\Agent\Output;
2019
use Symfony\AI\Agent\OutputProcessorInterface;
2120
use Symfony\AI\Agent\Toolbox\Event\ToolCallsExecuted;
2221
use Symfony\AI\Agent\Toolbox\StreamResult as ToolboxStreamResponse;
23-
use Symfony\AI\Platform\Capability;
2422
use Symfony\AI\Platform\Message\AssistantMessage;
2523
use Symfony\AI\Platform\Message\Message;
2624
use Symfony\AI\Platform\Result\ResultInterface;
@@ -46,10 +44,6 @@ public function __construct(
4644

4745
public function processInput(Input $input): void
4846
{
49-
if (!$input->model->supports(Capability::TOOL_CALLING)) {
50-
throw MissingModelSupportException::forToolCalling($input->model::class);
51-
}
52-
5347
$toolMap = $this->toolbox->getTools();
5448
if ([] === $toolMap) {
5549
return;

src/agent/tests/Toolbox/AgentProcessorTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\AI\Agent\AgentInterface;
16-
use Symfony\AI\Agent\Exception\MissingModelSupportException;
1716
use Symfony\AI\Agent\Input;
1817
use Symfony\AI\Agent\Output;
1918
use Symfony\AI\Agent\Toolbox\AgentProcessor;
@@ -76,17 +75,6 @@ public function testProcessInputWithRegisteredToolsButToolOverride()
7675
$this->assertSame(['tools' => [$tool2]], $input->getOptions());
7776
}
7877

79-
public function testProcessInputWithUnsupportedToolCallingWillThrowException()
80-
{
81-
$this->expectException(MissingModelSupportException::class);
82-
83-
$model = new Model('gpt-3');
84-
$processor = new AgentProcessor($this->createStub(ToolboxInterface::class));
85-
$input = new Input($model, new MessageBag());
86-
87-
$processor->processInput($input);
88-
}
89-
9078
public function testProcessOutputWithToolCallResponseKeepingMessages()
9179
{
9280
$toolbox = $this->createMock(ToolboxInterface::class);

0 commit comments

Comments
 (0)