diff --git a/src/DependencyInjection/LlmChainExtension.php b/src/DependencyInjection/LlmChainExtension.php index 4cfed34..9ad223f 100644 --- a/src/DependencyInjection/LlmChainExtension.php +++ b/src/DependencyInjection/LlmChainExtension.php @@ -219,6 +219,7 @@ private function processChainConfig(string $name, array $config, ContainerBuilde // CHAIN $chainDefinition = (new Definition(Chain::class)) + ->setAutowired(true) ->setArgument('$platform', new Reference($config['platform'])) ->setArgument('$llm', new Reference('llm_chain.chain.'.$name.'.llm')); diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 101376b..0c44a93 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -40,6 +40,7 @@ // tools ->set('llm_chain.toolbox.abstract') ->class(ToolBox::class) + ->autowire() ->abstract() ->args([ '$tools' => abstract_arg('Collection of tools'), @@ -64,6 +65,7 @@ ->tag('llm_chain.chain.output_processor') ->args([ '$toolBox' => service(ToolBoxInterface::class), + '$eventDispatcher' => service('event_dispatcher')->nullOnInvalid(), ]) // profiler