33
33
use Symfony \AI \Platform \Bridge \Google \Gemini ;
34
34
use Symfony \AI \Platform \Bridge \Google \PlatformFactory as GooglePlatformFactory ;
35
35
use Symfony \AI \Platform \Bridge \Meta \Llama ;
36
+ use Symfony \AI \Platform \Bridge \Mistral \Mistral ;
37
+ use Symfony \AI \Platform \Bridge \Mistral \PlatformFactory as MistralPlatformFactory ;
36
38
use Symfony \AI \Platform \Bridge \OpenAI \Embeddings ;
37
39
use Symfony \AI \Platform \Bridge \OpenAI \GPT ;
38
40
use Symfony \AI \Platform \Bridge \OpenAI \PlatformFactory as OpenAIPlatformFactory ;
@@ -212,6 +214,21 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
212
214
return ;
213
215
}
214
216
217
+ if ('mistral ' === $ type ) {
218
+ $ platformId = 'llm_chain.platform.mistral ' ;
219
+ $ definition = (new Definition (Platform::class))
220
+ ->setFactory (MistralPlatformFactory::class.'::create ' )
221
+ ->setAutowired (true )
222
+ ->setLazy (true )
223
+ ->addTag ('proxy ' , ['interface ' => PlatformInterface::class])
224
+ ->setArguments (['$apiKey ' => $ platform ['api_key ' ]])
225
+ ->addTag ('llm_chain.platform ' );
226
+
227
+ $ container ->setDefinition ($ platformId , $ definition );
228
+
229
+ return ;
230
+ }
231
+
215
232
throw new \InvalidArgumentException (\sprintf ('Platform "%s" is not supported for configuration via bundle at this point. ' , $ type ));
216
233
}
217
234
@@ -228,6 +245,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
228
245
'claude ' => Claude::class,
229
246
'llama ' => Llama::class,
230
247
'gemini ' => Gemini::class,
248
+ 'mistral ' => Mistral::class,
231
249
default => throw new \InvalidArgumentException (\sprintf ('Model "%s" is not supported. ' , $ modelName )),
232
250
};
233
251
$ modelDefinition = new Definition ($ modelClass );
0 commit comments