|
27 | 27 | use Symfony\AI\AiBundle\Security\Attribute\IsGrantedTool;
|
28 | 28 | use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory as AnthropicPlatformFactory;
|
29 | 29 | use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory as AzureOpenAiPlatformFactory;
|
| 30 | +use Symfony\AI\Platform\Bridge\Cerebras\PlatformFactory as CerebrasPlatformFactory; |
30 | 31 | use Symfony\AI\Platform\Bridge\Gemini\PlatformFactory as GeminiPlatformFactory;
|
31 | 32 | use Symfony\AI\Platform\Bridge\LmStudio\PlatformFactory as LmStudioPlatformFactory;
|
32 | 33 | use Symfony\AI\Platform\Bridge\Mistral\PlatformFactory as MistralPlatformFactory;
|
33 | 34 | use Symfony\AI\Platform\Bridge\Ollama\PlatformFactory as OllamaPlatformFactory;
|
34 | 35 | use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory as OpenAiPlatformFactory;
|
35 | 36 | use Symfony\AI\Platform\Bridge\OpenRouter\PlatformFactory as OpenRouterPlatformFactory;
|
36 |
| -use Symfony\AI\Platform\Bridge\Cerebras\PlatformFactory as CerebrasPlatformFactory; |
37 | 37 | use Symfony\AI\Platform\Model;
|
38 | 38 | use Symfony\AI\Platform\ModelClientInterface;
|
39 | 39 | use Symfony\AI\Platform\Platform;
|
|
56 | 56 | use Symfony\AI\Store\StoreInterface;
|
57 | 57 | use Symfony\AI\Store\VectorStoreInterface;
|
58 | 58 | use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
|
| 59 | +use Symfony\Component\DependencyInjection\Attribute\Target; |
59 | 60 | use Symfony\Component\DependencyInjection\ChildDefinition;
|
60 | 61 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
61 | 62 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
@@ -107,9 +108,6 @@ public function loadExtension(array $config, ContainerConfigurator $container, C
|
107 | 108 | foreach ($config['agent'] as $agentName => $agent) {
|
108 | 109 | $this->processAgentConfig($agentName, $agent, $builder);
|
109 | 110 | }
|
110 |
| - if (1 === \count($config['agent']) && isset($agentName)) { |
111 |
| - $builder->setAlias(AgentInterface::class, 'ai.agent.'.$agentName); |
112 |
| - } |
113 | 111 |
|
114 | 112 | foreach ($config['store'] ?? [] as $type => $store) {
|
115 | 113 | $this->processStoreConfig($type, $store, $builder);
|
@@ -460,6 +458,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
|
460 | 458 | ;
|
461 | 459 |
|
462 | 460 | $container->setDefinition('ai.agent.'.$name, $agentDefinition);
|
| 461 | + $container->registerAliasForArgument('ai.agent.'.$name, AgentInterface::class, (new Target($name.'Agent'))->getParsedName()); |
463 | 462 | }
|
464 | 463 |
|
465 | 464 | /**
|
|
0 commit comments