This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/Platform/Bridge/Albert Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,17 @@ public static function create(
2222 if (!str_starts_with ($ baseUrl , 'https:// ' )) {
2323 throw new InvalidArgumentException ('The Albert URL must start with "https://". ' );
2424 }
25-
26- $ httpClient = $ httpClient instanceof EventSourceHttpClient ? $ httpClient : new EventSourceHttpClient ($ httpClient );
27-
28- // Validate that URL doesn't end with a slash
25+
2926 if (str_ends_with ($ baseUrl , '/ ' )) {
3027 throw new InvalidArgumentException ('The Albert URL must not end with a trailing slash. ' );
3128 }
3229
3330 // The base URL should include the full path to the API endpoint including version
3431 if (!preg_match ('/\/v\d+$/ ' , $ baseUrl )) {
3532 throw new InvalidArgumentException ('The Albert URL must include an API version (e.g., /v1, /v2). ' );
36- }
33+ }
34+
35+ $ httpClient = $ httpClient instanceof EventSourceHttpClient ? $ httpClient : new EventSourceHttpClient ($ httpClient );
3736
3837 // Create Albert-specific model clients with custom base URL
3938 $ gptClient = new GPTModelClient ($ httpClient , $ apiKey , $ baseUrl );
You can’t perform that action at this time.
0 commit comments