File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments