Skip to content

Commit fd18c26

Browse files
committed
fix(bundle): check for bedrock platform only when bedrock is present in config
1 parent b774f6d commit fd18c26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ai-bundle/src/AiBundle.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,11 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
410410
}
411411

412412
if ('bedrock' === $type) {
413-
if (!ContainerBuilder::willBeAvailable('symfony/ai-bedrock-platform', BedrockFactory::class, ['symfony/ai-bundle'])) {
414-
throw new RuntimeException('Bedrock platform configuration requires "symfony/ai-bedrock-platform" package. Try running "composer require symfony/ai-bedrock-platform".');
415-
}
416-
417413
foreach ($platform as $name => $config) {
414+
if (!ContainerBuilder::willBeAvailable('symfony/ai-bedrock-platform', BedrockFactory::class, ['symfony/ai-bundle'])) {
415+
throw new RuntimeException('Bedrock platform configuration requires "symfony/ai-bedrock-platform" package. Try running "composer require symfony/ai-bedrock-platform".');
416+
}
417+
418418
$platformId = 'ai.platform.bedrock_'.$name;
419419
$definition = (new Definition(Platform::class))
420420
->setFactory(BedrockFactory::class.'::create')

0 commit comments

Comments
 (0)