2727use Symfony \AI \Chat \ChatInterface ;
2828use Symfony \AI \Chat \ManagedStoreInterface as ManagedMessageStoreInterface ;
2929use Symfony \AI \Chat \MessageStoreInterface ;
30- use Symfony \AI \Platform \Bridge \ElevenLabs \PlatformFactory ;
30+ use Symfony \AI \Platform \Bridge \ElevenLabs \ElevenLabsApiCatalog ;
31+ use Symfony \AI \Platform \Bridge \ElevenLabs \ModelCatalog as ElevenLabsModelCatalog ;
32+ use Symfony \AI \Platform \Bridge \ElevenLabs \PlatformFactory as ElevenLabsPlatformFactory ;
3133use Symfony \AI \Platform \Bridge \Ollama \OllamaApiCatalog ;
3234use Symfony \AI \Platform \Capability ;
3335use Symfony \AI \Platform \Model ;
36+ use Symfony \AI \Platform \ModelCatalog \ModelCatalogInterface ;
3437use Symfony \AI \Platform \PlatformInterface ;
3538use Symfony \AI \Store \Bridge \AzureSearch \SearchStore as AzureStore ;
3639use Symfony \AI \Store \Bridge \Cache \Store as CacheStore ;
@@ -3785,7 +3788,7 @@ public function testElevenLabsPlatformCanBeRegistered()
37853788 $ definition = $ container ->getDefinition ('ai.platform.elevenlabs ' );
37863789
37873790 $ this ->assertTrue ($ definition ->isLazy ());
3788- $ this ->assertSame ([PlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
3791+ $ this ->assertSame ([ElevenLabsPlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
37893792
37903793 $ this ->assertCount (6 , $ definition ->getArguments ());
37913794 $ this ->assertSame ('foo ' , $ definition ->getArgument (0 ));
@@ -3805,6 +3808,14 @@ public function testElevenLabsPlatformCanBeRegistered()
38053808
38063809 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface $elevenlabs ' ));
38073810 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface ' ));
3811+
3812+ $ modelCatalogDefinition = $ container ->getDefinition ('ai.platform.model_catalog.elevenlabs ' );
3813+
3814+ $ this ->assertSame (ElevenLabsModelCatalog::class, $ modelCatalogDefinition ->getClass ());
3815+ $ this ->assertTrue ($ modelCatalogDefinition ->isLazy ());
3816+
3817+ $ this ->assertTrue ($ modelCatalogDefinition ->hasTag ('proxy ' ));
3818+ $ this ->assertSame ([['interface ' => ModelCatalogInterface::class]], $ modelCatalogDefinition ->getTag ('proxy ' ));
38083819 }
38093820
38103821 public function testElevenLabsPlatformWithCustomEndpointCanBeRegistered ()
@@ -3825,7 +3836,7 @@ public function testElevenLabsPlatformWithCustomEndpointCanBeRegistered()
38253836 $ definition = $ container ->getDefinition ('ai.platform.elevenlabs ' );
38263837
38273838 $ this ->assertTrue ($ definition ->isLazy ());
3828- $ this ->assertSame ([PlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
3839+ $ this ->assertSame ([ElevenLabsPlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
38293840
38303841 $ this ->assertCount (6 , $ definition ->getArguments ());
38313842 $ this ->assertSame ('foo ' , $ definition ->getArgument (0 ));
@@ -3845,6 +3856,14 @@ public function testElevenLabsPlatformWithCustomEndpointCanBeRegistered()
38453856
38463857 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface $elevenlabs ' ));
38473858 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface ' ));
3859+
3860+ $ modelCatalogDefinition = $ container ->getDefinition ('ai.platform.model_catalog.elevenlabs ' );
3861+
3862+ $ this ->assertSame (ElevenLabsModelCatalog::class, $ modelCatalogDefinition ->getClass ());
3863+ $ this ->assertTrue ($ modelCatalogDefinition ->isLazy ());
3864+
3865+ $ this ->assertTrue ($ modelCatalogDefinition ->hasTag ('proxy ' ));
3866+ $ this ->assertSame ([['interface ' => ModelCatalogInterface::class]], $ modelCatalogDefinition ->getTag ('proxy ' ));
38483867 }
38493868
38503869 public function testElevenLabsPlatformWithCustomHttpClientCanBeRegistered ()
@@ -3865,7 +3884,7 @@ public function testElevenLabsPlatformWithCustomHttpClientCanBeRegistered()
38653884 $ definition = $ container ->getDefinition ('ai.platform.elevenlabs ' );
38663885
38673886 $ this ->assertTrue ($ definition ->isLazy ());
3868- $ this ->assertSame ([PlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
3887+ $ this ->assertSame ([ElevenLabsPlatformFactory ::class, 'create ' ], $ definition ->getFactory ());
38693888
38703889 $ this ->assertCount (6 , $ definition ->getArguments ());
38713890 $ this ->assertSame ('foo ' , $ definition ->getArgument (0 ));
@@ -3885,6 +3904,68 @@ public function testElevenLabsPlatformWithCustomHttpClientCanBeRegistered()
38853904
38863905 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface $elevenlabs ' ));
38873906 $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface ' ));
3907+
3908+ $ modelCatalogDefinition = $ container ->getDefinition ('ai.platform.model_catalog.elevenlabs ' );
3909+
3910+ $ this ->assertSame (ElevenLabsModelCatalog::class, $ modelCatalogDefinition ->getClass ());
3911+ $ this ->assertTrue ($ modelCatalogDefinition ->isLazy ());
3912+
3913+ $ this ->assertTrue ($ modelCatalogDefinition ->hasTag ('proxy ' ));
3914+ $ this ->assertSame ([['interface ' => ModelCatalogInterface::class]], $ modelCatalogDefinition ->getTag ('proxy ' ));
3915+ }
3916+
3917+ public function testElevenLabsPlatformWithApiCatalogCanBeRegistered ()
3918+ {
3919+ $ container = $ this ->buildContainer ([
3920+ 'ai ' => [
3921+ 'platform ' => [
3922+ 'elevenlabs ' => [
3923+ 'api_key ' => 'foo ' ,
3924+ 'api_catalog ' => true ,
3925+ ],
3926+ ],
3927+ ],
3928+ ]);
3929+
3930+ $ this ->assertTrue ($ container ->hasDefinition ('ai.platform.elevenlabs ' ));
3931+ $ this ->assertTrue ($ container ->hasDefinition ('ai.platform.model_catalog.elevenlabs ' ));
3932+
3933+ $ definition = $ container ->getDefinition ('ai.platform.elevenlabs ' );
3934+
3935+ $ this ->assertTrue ($ definition ->isLazy ());
3936+ $ this ->assertSame ([ElevenLabsPlatformFactory::class, 'create ' ], $ definition ->getFactory ());
3937+
3938+ $ this ->assertCount (6 , $ definition ->getArguments ());
3939+ $ this ->assertSame ('foo ' , $ definition ->getArgument (0 ));
3940+ $ this ->assertSame ('https://api.elevenlabs.io/v1 ' , $ definition ->getArgument (1 ));
3941+ $ this ->assertInstanceOf (Reference::class, $ definition ->getArgument (2 ));
3942+ $ this ->assertSame ('http_client ' , (string ) $ definition ->getArgument (2 ));
3943+ $ this ->assertInstanceOf (Reference::class, $ definition ->getArgument (3 ));
3944+ $ this ->assertSame ('ai.platform.model_catalog.elevenlabs ' , (string ) $ definition ->getArgument (3 ));
3945+ $ this ->assertNull ($ definition ->getArgument (4 ));
3946+ $ this ->assertInstanceOf (Reference::class, $ definition ->getArgument (5 ));
3947+ $ this ->assertSame ('event_dispatcher ' , (string ) $ definition ->getArgument (5 ));
3948+
3949+ $ this ->assertTrue ($ definition ->hasTag ('proxy ' ));
3950+ $ this ->assertSame ([['interface ' => PlatformInterface::class]], $ definition ->getTag ('proxy ' ));
3951+ $ this ->assertTrue ($ definition ->hasTag ('ai.platform ' ));
3952+ $ this ->assertSame ([['name ' => 'elevenlabs ' ]], $ definition ->getTag ('ai.platform ' ));
3953+
3954+ $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface $elevenlabs ' ));
3955+ $ this ->assertTrue ($ container ->hasAlias ('Symfony\AI\Platform\PlatformInterface ' ));
3956+
3957+ $ modelCatalogDefinition = $ container ->getDefinition ('ai.platform.model_catalog.elevenlabs ' );
3958+
3959+ $ this ->assertSame (ElevenLabsApiCatalog::class, $ modelCatalogDefinition ->getClass ());
3960+ $ this ->assertTrue ($ modelCatalogDefinition ->isLazy ());
3961+ $ this ->assertCount (3 , $ modelCatalogDefinition ->getArguments ());
3962+ $ this ->assertInstanceOf (Reference::class, $ modelCatalogDefinition ->getArgument (0 ));
3963+ $ this ->assertSame ('http_client ' , (string ) $ modelCatalogDefinition ->getArgument (0 ));
3964+ $ this ->assertSame ('foo ' , $ modelCatalogDefinition ->getArgument (1 ));
3965+ $ this ->assertSame ('https://api.elevenlabs.io/v1 ' , $ modelCatalogDefinition ->getArgument (2 ));
3966+
3967+ $ this ->assertTrue ($ modelCatalogDefinition ->hasTag ('proxy ' ));
3968+ $ this ->assertSame ([['interface ' => ModelCatalogInterface::class]], $ modelCatalogDefinition ->getTag ('proxy ' ));
38883969 }
38893970
38903971 #[TestDox('Token usage processor tags use the correct agent ID ' )]
0 commit comments