Skip to content

Commit a1b1595

Browse files
committed
style(xai): format streaming endpoint guard
1 parent f08d1fd commit a1b1595

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

extensions/xai/tts.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,7 @@ export function assertXaiNativeTtsStreamEndpoint(baseUrl: string): void {
152152
);
153153
}
154154
const pathname = url.pathname.replace(/\/+$/, "");
155-
if (
156-
url.username ||
157-
url.password ||
158-
url.port ||
159-
pathname !== "/v1" ||
160-
url.search ||
161-
url.hash
162-
) {
155+
if (url.username || url.password || url.port || pathname !== "/v1" || url.search || url.hash) {
163156
throw new Error(`xAI streaming TTS requires the canonical ${XAI_BASE_URL} base URL`);
164157
}
165158
}
@@ -424,7 +417,7 @@ export async function xaiTTSStream(params: {
424417
});
425418

426419
try {
427-
for (let offset = 0; offset < text.length; ) {
420+
for (let offset = 0; offset < text.length;) {
428421
let end = Math.min(offset + XAI_TTS_STREAM_TEXT_DELTA_MAX_CHARS, text.length);
429422
// Keep a surrogate pair in the same frame, even if that frame is one unit shorter.
430423
if (

0 commit comments

Comments
 (0)