Skip to content

Commit e81727c

Browse files
authored
fix: convert platform to lazy services (#53)
1 parent f7a9bf2 commit e81727c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DependencyInjection/LlmChainExtension.php

+6
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
133133
$definition = (new Definition(Platform::class))
134134
->setFactory(OpenAIPlatformFactory::class.'::create')
135135
->setAutowired(true)
136+
->setLazy(true)
137+
->addTag('proxy', ['interface' => PlatformInterface::class])
136138
->setArguments(['$apiKey' => $platform['api_key']])
137139
->addTag('llm_chain.platform');
138140

@@ -147,6 +149,8 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
147149
$definition = (new Definition(Platform::class))
148150
->setFactory(AzureOpenAIPlatformFactory::class.'::create')
149151
->setAutowired(true)
152+
->setLazy(true)
153+
->addTag('proxy', ['interface' => PlatformInterface::class])
150154
->setArguments([
151155
'$baseUrl' => $config['base_url'],
152156
'$deployment' => $config['deployment'],
@@ -166,6 +170,8 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
166170
$definition = (new Definition(Platform::class))
167171
->setFactory(AnthropicPlatformFactory::class.'::create')
168172
->setAutowired(true)
173+
->setLazy(true)
174+
->addTag('proxy', ['interface' => PlatformInterface::class])
169175
->setArguments([
170176
'$apiKey' => $platform['api_key'],
171177
])

0 commit comments

Comments
 (0)