3737use Symfony \AI \Platform \Message \Content \Image ;
3838use Symfony \AI \Platform \Message \Message ;
3939use Symfony \AI \Platform \Message \MessageBag ;
40- use Symfony \AI \Platform \PlatformInterface ;
40+ use Symfony \AI \Platform \ProviderInterface ;
4141use Symfony \AI \Platform \TokenUsage \TokenUsageInterface ;
4242
4343/**
@@ -61,13 +61,13 @@ class SymfonyAiPlatformAdapter implements
6161 ToolCallingCapableInterface,
6262 EmbeddingCapableInterface
6363{
64- /** @var array<string, PlatformInterface> Platforms cached by configuration key */
64+ /** @var array<string, ProviderInterface> Providers cached by configuration key */
6565 private array $ platforms = [];
6666
6767 private readonly string $ maxTokensKey ;
6868
6969 /**
70- * @param string $factoryClass Fully-qualified class name of the bridge's PlatformFactory
70+ * @param string $factoryClass Fully-qualified class name of the bridge's Factory
7171 * @param string $factoryParam Name of the factory parameter to pass the config value to ('apiKey' or 'endpoint')
7272 */
7373 public function __construct (
@@ -237,16 +237,16 @@ public function processEmbeddingRequest(EmbeddingRequest $request): EmbeddingRes
237237 }
238238
239239 /**
240- * Lazily create and cache a Platform instance per provider configuration.
240+ * Lazily create and cache a Provider instance per provider configuration.
241241 */
242- private function getPlatform (ProviderConfiguration $ config ): PlatformInterface
242+ private function getPlatform (ProviderConfiguration $ config ): ProviderInterface
243243 {
244244 $ cacheKey = $ config ->uid > 0 ? (string )$ config ->uid : md5 ($ config ->apiKey . $ config ->model );
245245 if (!isset ($ this ->platforms [$ cacheKey ])) {
246246 $ factoryClass = $ this ->factoryClass ;
247247 $ this ->platforms [$ cacheKey ] = match ($ this ->factoryParam ) {
248- 'endpoint ' => $ factoryClass ::create (endpoint: $ config ->apiKey ),
249- default => $ factoryClass ::create (apiKey: $ config ->apiKey ),
248+ 'endpoint ' => $ factoryClass ::createProvider (endpoint: $ config ->apiKey ),
249+ default => $ factoryClass ::createProvider (apiKey: $ config ->apiKey ),
250250 };
251251 }
252252 return $ this ->platforms [$ cacheKey ];
0 commit comments