|
43 | 43 | use Symfony\AI\Chat\Chat; |
44 | 44 | use Symfony\AI\Chat\ChatInterface; |
45 | 45 | use Symfony\AI\Chat\MessageStoreInterface; |
| 46 | +use Symfony\AI\Platform\Bridge\Albert\PlatformFactory as AlbertPlatformFactory; |
46 | 47 | use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory as AnthropicPlatformFactory; |
47 | 48 | use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory as AzureOpenAiPlatformFactory; |
48 | 49 | use Symfony\AI\Platform\Bridge\Cartesia\PlatformFactory as CartesiaPlatformFactory; |
@@ -292,6 +293,26 @@ public function loadExtension(array $config, ContainerConfigurator $container, C |
292 | 293 | */ |
293 | 294 | private function processPlatformConfig(string $type, array $platform, ContainerBuilder $container): void |
294 | 295 | { |
| 296 | + if ('albert' === $type) { |
| 297 | + $platformId = 'ai.platform.albert'; |
| 298 | + $definition = (new Definition(Platform::class)) |
| 299 | + ->setFactory(AlbertPlatformFactory::class.'::create') |
| 300 | + ->setLazy(true) |
| 301 | + ->addTag('proxy', ['interface' => PlatformInterface::class]) |
| 302 | + ->setArguments([ |
| 303 | + $platform['api_key'], |
| 304 | + $platform['base_url'], |
| 305 | + new Reference($platform['http_client'], ContainerInterface::NULL_ON_INVALID_REFERENCE), |
| 306 | + new Reference('ai.platform.model_catalog.albert'), |
| 307 | + new Reference('event_dispatcher'), |
| 308 | + ]) |
| 309 | + ->addTag('ai.platform', ['name' => 'albert']); |
| 310 | + |
| 311 | + $container->setDefinition($platformId, $definition); |
| 312 | + |
| 313 | + return; |
| 314 | + } |
| 315 | + |
295 | 316 | if ('anthropic' === $type) { |
296 | 317 | $platformId = 'ai.platform.anthropic'; |
297 | 318 | $definition = (new Definition(Platform::class)) |
|
0 commit comments