Skip to content

Commit a19e234

Browse files
committed
-
1 parent b6f437a commit a19e234

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/platform/src/Bridge/Perplexity/PlatformFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\AI\Platform\Bridge\Perplexity\Contract\PerplexityContract;
1515
use Symfony\AI\Platform\Contract;
16+
use Symfony\AI\Platform\ModelCatalog\ModelCatalogInterface;
1617
use Symfony\AI\Platform\Platform;
1718
use Symfony\Component\HttpClient\EventSourceHttpClient;
1819
use Symfony\Contracts\HttpClient\HttpClientInterface;
@@ -25,14 +26,15 @@ final class PlatformFactory
2526
public static function create(
2627
#[\SensitiveParameter] string $apiKey,
2728
?HttpClientInterface $httpClient = null,
29+
ModelCatalogInterface $modelCatalog = new ModelCatalog(),
2830
?Contract $contract = null,
2931
): Platform {
3032
$httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
3133

3234
return new Platform(
3335
[new ModelClient($httpClient, $apiKey)],
3436
[new ResultConverter()],
35-
new ModelCatalog(),
37+
$modelCatalog,
3638
$contract ?? PerplexityContract::create(),
3739
);
3840
}

src/platform/src/Bridge/Voyage/PlatformFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\AI\Platform\Bridge\Voyage;
1313

1414
use Symfony\AI\Platform\Contract;
15+
use Symfony\AI\Platform\ModelCatalog\ModelCatalogInterface;
1516
use Symfony\AI\Platform\Platform;
1617
use Symfony\Component\HttpClient\EventSourceHttpClient;
1718
use Symfony\Contracts\HttpClient\HttpClientInterface;
@@ -24,10 +25,11 @@ final class PlatformFactory
2425
public static function create(
2526
#[\SensitiveParameter] string $apiKey,
2627
?HttpClientInterface $httpClient = null,
28+
ModelCatalogInterface $modelCatalog = new ModelCatalog(),
2729
?Contract $contract = null,
2830
): Platform {
2931
$httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
3032

31-
return new Platform([new ModelClient($httpClient, $apiKey)], [new ResultConverter()], new ModelCatalog(), $contract);
33+
return new Platform([new ModelClient($httpClient, $apiKey)], [new ResultConverter()], $modelCatalog, $contract);
3234
}
3335
}

0 commit comments

Comments
 (0)