Skip to content

Commit 3685d4a

Browse files
committed
ref
1 parent 2c5c91b commit 3685d4a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ai-bundle/src/AiBundle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
302302
->setArguments([
303303
$platform['api_key'],
304304
$platform['version'],
305-
$platform['host'],
306305
new Reference($platform['http_client'], ContainerInterface::NULL_ON_INVALID_REFERENCE),
307306
new Reference('ai.platform.model_catalog.cartesia'),
308307
null,

src/platform/src/Bridge/Cartesia/PlatformFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\AI\Platform\Contract;
1717
use Symfony\AI\Platform\ModelCatalog\ModelCatalogInterface;
1818
use Symfony\AI\Platform\Platform;
19+
use Symfony\Component\HttpClient\EventSourceHttpClient;
1920
use Symfony\Contracts\HttpClient\HttpClientInterface;
2021

2122
/**
@@ -26,14 +27,15 @@ final class PlatformFactory
2627
public static function create(
2728
string $apiKey,
2829
string $version,
29-
?string $hostUrl = 'https://api.cartesia.ai',
3030
?HttpClientInterface $httpClient = null,
3131
ModelCatalogInterface $modelCatalog = new ModelCatalog(),
3232
?Contract $contract = null,
3333
?EventDispatcherInterface $eventDispatcher = null,
3434
): Platform {
35+
$httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
36+
3537
return new Platform(
36-
[new CartesiaClient($httpClient, $apiKey, $version, $hostUrl)],
38+
[new CartesiaClient($httpClient, $apiKey, $version)],
3739
[new CartesiaResultConverter()],
3840
$modelCatalog,
3941
$contract ?? CartesiaContract::create(),

0 commit comments

Comments
 (0)