Skip to content

Commit ec4119e

Browse files
authored
fix: bundle should not throw errors on empty config (#51)
1 parent fa34561 commit ec4119e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DependencyInjection/LlmChainExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function load(array $configs, ContainerBuilder $container): void
5151

5252
$configuration = new Configuration();
5353
$config = $this->processConfiguration($configuration, $configs);
54-
foreach ($config['platform'] as $type => $platform) {
54+
foreach ($config['platform'] ?? [] as $type => $platform) {
5555
$this->processPlatformConfig($type, $platform, $container);
5656
}
5757
$platforms = array_keys($container->findTaggedServiceIds('llm_chain.platform'));
@@ -80,7 +80,7 @@ public function load(array $configs, ContainerBuilder $container): void
8080
$container->setAlias(LanguageModel::class, reset($llms));
8181
}
8282

83-
foreach ($config['store'] as $type => $store) {
83+
foreach ($config['store'] ?? [] as $type => $store) {
8484
$this->processStoreConfig($type, $store, $container);
8585
}
8686
$stores = array_keys($container->findTaggedServiceIds('llm_chain.store'));

0 commit comments

Comments
 (0)