3333use Symfony \AI \Platform \Bridge \Google \Gemini ;
3434use Symfony \AI \Platform \Bridge \Google \PlatformFactory as GooglePlatformFactory ;
3535use Symfony \AI \Platform \Bridge \Meta \Llama ;
36+ use Symfony \AI \Platform \Bridge \Mistral \Mistral ;
37+ use Symfony \AI \Platform \Bridge \Mistral \PlatformFactory as MistralPlatformFactory ;
3638use Symfony \AI \Platform \Bridge \OpenAI \Embeddings ;
3739use Symfony \AI \Platform \Bridge \OpenAI \GPT ;
3840use Symfony \AI \Platform \Bridge \OpenAI \PlatformFactory as OpenAIPlatformFactory ;
@@ -212,6 +214,21 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
212214 return ;
213215 }
214216
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+
215232 throw new \InvalidArgumentException (\sprintf ('Platform "%s" is not supported for configuration via bundle at this point. ' , $ type ));
216233 }
217234
@@ -228,6 +245,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
228245 'claude ' => Claude::class,
229246 'llama ' => Llama::class,
230247 'gemini ' => Gemini::class,
248+ 'mistral ' => Mistral::class,
231249 default => throw new \InvalidArgumentException (\sprintf ('Model "%s" is not supported. ' , $ modelName )),
232250 };
233251 $ modelDefinition = new Definition ($ modelClass );
0 commit comments