Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit f166e00

Browse files
committed
-
1 parent b880103 commit f166e00

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

src/Platform/Bridge/Albert/EmbeddingsModelClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function supports(Model $model): bool
3333

3434
public function request(Model $model, array|string $payload, array $options = []): ResponseInterface
3535
{
36-
return $this->httpClient->request('POST', sprintf('%s/embeddings', $this->baseUrl), [
36+
return $this->httpClient->request('POST', \sprintf('%s/embeddings', $this->baseUrl), [
3737
'auth_bearer' => $this->apiKey,
3838
'json' => \is_array($payload) ? array_merge($payload, $options) : $payload,
3939
]);

src/Platform/Bridge/Albert/GPTModelClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
private string $baseUrl,
2323
) {
2424
$this->httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
25-
25+
2626
if ('' === $apiKey) {
2727
throw new InvalidArgumentException('The API key must not be empty.');
2828
}
@@ -38,7 +38,7 @@ public function supports(Model $model): bool
3838

3939
public function request(Model $model, array|string $payload, array $options = []): ResponseInterface
4040
{
41-
return $this->httpClient->request('POST', sprintf('%s/chat/completions', $this->baseUrl), [
41+
return $this->httpClient->request('POST', \sprintf('%s/chat/completions', $this->baseUrl), [
4242
'auth_bearer' => $this->apiKey,
4343
'json' => \is_array($payload) ? array_merge($payload, $options) : $payload,
4444
]);

src/Platform/Bridge/Albert/PlatformFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ public static function create(
2222
if (!str_starts_with($baseUrl, 'https://')) {
2323
throw new InvalidArgumentException('The Albert URL must start with "https://".');
2424
}
25-
25+
2626
if (str_ends_with($baseUrl, '/')) {
2727
throw new InvalidArgumentException('The Albert URL must not end with a trailing slash.');
2828
}
29-
29+
3030
if (!preg_match('/\/v\d+$/', $baseUrl)) {
3131
throw new InvalidArgumentException('The Albert URL must include an API version (e.g., /v1, /v2).');
32-
}
32+
}
3333

3434
$httpClient = $httpClient instanceof EventSourceHttpClient ? $httpClient : new EventSourceHttpClient($httpClient);
3535

tests/Platform/Bridge/Albert/EmbeddingsModelClientTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public function requestSendsCorrectHttpRequest(array|string $payload, array $opt
111111
}
112112
}
113113

114-
115114
#[Test]
116115
public function requestHandlesBaseUrlWithoutTrailingSlash(): void
117116
{

tests/Platform/Bridge/Albert/GPTModelClientTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public function requestSendsCorrectHttpRequest(array|string $payload, array $opt
157157
}
158158
}
159159

160-
161160
#[Test]
162161
public function requestHandlesBaseUrlWithoutTrailingSlash(): void
163162
{

tests/Platform/Bridge/Albert/PlatformFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function handlesUrlsCorrectly(string $url): void
3838
self::assertInstanceOf(Platform::class, $platform);
3939
}
4040

41-
4241
#[Test]
4342
public function throwsExceptionForNonHttpsUrl(): void
4443
{
@@ -74,5 +73,4 @@ public function throwsExceptionForUrlsWithoutVersion(string $url): void
7473

7574
PlatformFactory::create('test-key', $url);
7675
}
77-
7876
}

0 commit comments

Comments
 (0)