File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -321,12 +321,16 @@ export function handleStreamingMode(
321321 await writer . write ( encoder . encode ( chunk ) ) ;
322322 }
323323 } catch ( error ) {
324- console . error ( 'Error during stream processing:' , error ) ;
324+ console . error ( 'Error during stream processing:' , proxyProvider , error ) ;
325325 } finally {
326326 try {
327327 await writer . close ( ) ;
328328 } catch ( closeError ) {
329- console . error ( 'Failed to close the writer:' , closeError ) ;
329+ console . error (
330+ 'Failed to close the writer:' ,
331+ proxyProvider ,
332+ closeError
333+ ) ;
330334 }
331335 }
332336 } ) ( ) ;
@@ -345,12 +349,16 @@ export function handleStreamingMode(
345349 await writer . write ( encoder . encode ( chunk ) ) ;
346350 }
347351 } catch ( error ) {
348- console . error ( 'Error during stream processing:' , error ) ;
352+ console . error ( 'Error during stream processing:' , proxyProvider , error ) ;
349353 } finally {
350354 try {
351355 await writer . close ( ) ;
352356 } catch ( closeError ) {
353- console . error ( 'Failed to close the writer:' , closeError ) ;
357+ console . error (
358+ 'Failed to close the writer:' ,
359+ proxyProvider ,
360+ closeError
361+ ) ;
354362 }
355363 }
356364 } ) ( ) ;
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ export const TogetherAIChatCompleteStreamChunkTransform: (
230230 return `data: ${ chunk } \n\n` ;
231231 }
232232 const parsedChunk : TogetherAIChatCompletionStreamChunk = JSON . parse ( chunk ) ;
233- const finishReason = parsedChunk . choices [ 0 ] . finish_reason
233+ const finishReason = parsedChunk . choices [ 0 ] ? .finish_reason
234234 ? transformFinishReason (
235235 parsedChunk . choices [ 0 ] . finish_reason ,
236236 strictOpenAiCompliance
You can’t perform that action at this time.
0 commit comments