File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -711,21 +711,20 @@ export async function* promptAiSdkStream(
711711 throw chunkValue . error
712712 }
713713 if ( chunkValue . type === 'reasoning-delta' ) {
714- for ( const provider of [ 'openrouter' , 'codebuff' ] as const ) {
715- if (
714+ const reasoningExcluded = ( [ 'openrouter' , 'codebuff' ] as const ) . some (
715+ ( p ) =>
716716 (
717- params . providerOptions ?. [ provider ] as
717+ params . providerOptions ?. [ p ] as
718718 | OpenRouterProviderOptions
719719 | undefined
720- ) ?. reasoning ?. exclude
721- ) {
722- continue
720+ ) ?. reasoning ?. exclude ,
721+ )
722+ if ( ! reasoningExcluded ) {
723+ yield {
724+ type : 'reasoning' ,
725+ text : chunkValue . text ,
723726 }
724727 }
725- yield {
726- type : 'reasoning' ,
727- text : chunkValue . text ,
728- }
729728 }
730729 if ( chunkValue . type === 'text-delta' ) {
731730 if ( ! params . stopSequences ) {
You can’t perform that action at this time.
0 commit comments