<?php
namespace App\AI\SymfonyAiExtend\Agent; use Symfony\AI\Agent\Agent; use App\AI\SymfonyAiExtend\Contract\ClaudeContract; use App\AI\SymfonyAiExtend\Processor\ClaudeRouterInputProcessor; use App\AI\SymfonyAiExtend\Processor\DatabaseProcessor; use App\AI\SymfonyAiExtend\Claude\Factory as ClaudeFactory; use App\AI\SymfonyAiExtend\Claude\ModelCatalog as ClaudeModelCatalog; class ClaudeRouterAgentFactory implements RouterAgentFactoryInterface { public function __construct( private readonly string $model, private readonly string $apiKey, private readonly RouterAgentConfig $config, ) { } public function createRouterAgent(int $idTopic, string $userMessage): Agent { $platform = ClaudeFactory::createPlatform($this->apiKey, $this->config->traceable, ClaudeModelCatalog::create(), ClaudeContract::create()); $dbProcessor = new DatabaseProcessor($idTopic, $userMessage, 'router'); $claudeRouterInputProcessor = new ClaudeRouterInputProcessor($this->config->contextManager, $idTopic, $userMessage); $inputProcessors = [ $claudeRouterInputProcessor, $dbProcessor]; $outputProcessors = [ $dbProcessor, $this->config->routerOutputProcessor]; return new Agent($platform, $this->model, $inputProcessors, $outputProcessors, 'router'); } } 